From 60a8731613072737973f7fb1a5c31726584d0945 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Mon, 15 May 2017 08:49:08 -0500 Subject: [PATCH] Extend tmpdir to wrapper scripts. --- mc-tmpdir-cwd.patch | 41 +++++++++++++++++++++++++++++++++++++++++ mc.spec | 7 ++++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 mc-tmpdir-cwd.patch diff --git a/mc-tmpdir-cwd.patch b/mc-tmpdir-cwd.patch new file mode 100644 index 0000000..21fc0be --- /dev/null +++ b/mc-tmpdir-cwd.patch @@ -0,0 +1,41 @@ +--- a/Extends-TMPDIR_DEFAULT-to-mc-wrapper-scripts.patch ++++ a/Extends-TMPDIR_DEFAULT-to-mc-wrapper-scripts.patch +@@ -0,0 +1,38 @@ ++From e73f27b85de32a3a1cec751f13a06252b1f29bff Mon Sep 17 00:00:00 2001 ++From: poma ++Date: Sat, 18 Mar 2017 12:09:52 -0400 ++Subject: [PATCH] Extends TMPDIR_DEFAULT to mc-wrapper scripts, ++ resolves exit to mc's current working directory. ++ ++--- ++ contrib/mc-wrapper.csh.in | 2 +- ++ contrib/mc-wrapper.sh.in | 2 +- ++ 2 files changed, 2 insertions(+), 2 deletions(-) ++ ++diff --git a/contrib/mc-wrapper.csh.in b/contrib/mc-wrapper.csh.in ++index fdf2e1f..ec23784 100644 ++--- a/contrib/mc-wrapper.csh.in +++++ b/contrib/mc-wrapper.csh.in ++@@ -3,7 +3,7 @@ set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`" ++ if ($?TMPDIR) then ++ setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$ ++ else ++- setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$ +++ setenv MC_PWD_FILE /var/tmp/mc-$MC_USER/mc.pwd.$$ ++ endif ++ ++ @bindir@/mc -P "$MC_PWD_FILE" $* ++diff --git a/contrib/mc-wrapper.sh.in b/contrib/mc-wrapper.sh.in ++index 773bbd1..26ab673 100644 ++--- a/contrib/mc-wrapper.sh.in +++++ b/contrib/mc-wrapper.sh.in ++@@ -1,5 +1,5 @@ ++ MC_USER=`id | sed 's/[^(]*(//;s/).*//'` ++-MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$" +++MC_PWD_FILE="${TMPDIR-/var/tmp}/mc-$MC_USER/mc.pwd.$$" ++ @bindir@/mc -P "$MC_PWD_FILE" "$@" ++ ++ if test -r "$MC_PWD_FILE"; then ++-- ++2.12.0 ++ diff --git a/mc.spec b/mc.spec index b62d3aa..74d6df4 100644 --- a/mc.spec +++ b/mc.spec @@ -3,7 +3,7 @@ Summary: User-friendly text console file manager and visual shell Name: mc Version: 4.8.19 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: GPLv3+ URL: http://www.midnight-commander.org/ @@ -11,6 +11,7 @@ Source0: http://www.midnight-commander.org/downloads/mc-%{version}.tar.xz # Downstream-only patch to make mc use /var/tmp for large temporary # files. See also: https://bugzilla.redhat.com/show_bug.cgi?id=895444 Patch0: %{name}-tmpdir.patch +Patch1: mc-tmpdir-cwd.patch BuildRequires: aspell-devel BuildRequires: e2fsprogs-devel BuildRequires: glib2-devel @@ -29,6 +30,7 @@ view tar and zip files, and to poke into RPMs for specific files. %prep %autosetup -p0 +%patch1 -p1 %build %configure \ @@ -81,6 +83,9 @@ install contrib/mc.{sh,csh} %{buildroot}%{_sysconfdir}/profile.d %{_mandir}/man1/* %changelog +* Mon May 15 2017 Gwyn Ciesla - 1:4.8.19-4 +- Patch to fix tmpdir default, wrapper scripts. + * Fri May 05 2017 Gwyn Ciesla - 1:4.8.19-3 - Fix conditional.