[quilt] Fix quilt setup regression (rhbz #768787)

Josh Boyer jwboyer at fedoraproject.org
Mon Dec 19 14:49:53 UTC 2011


commit 315b1c2055aacb9bf26e714c69444309b537f72e
Author: Josh Boyer <jwboyer at fedoraproject.org>
Date:   Mon Dec 19 09:49:39 2011 -0500

    Fix quilt setup regression (rhbz #768787)

 quilt-0001-configure-Honor-TMPDIR-if-set.patch     |   40 ++++++++++++++++++++
 ...sistently-use-TMPDIR-.-when-testing-if-TM.patch |   27 +++++++++++++
 ...t-File-name-means-read-from-stdin-for-tar.patch |   26 +++++++++++++
 ...t-0004-Don-t-let-TMPDIR-take-over-var-tmp.patch |   40 ++++++++++++++++++++
 quilt.spec                                         |   13 ++++++-
 5 files changed, 145 insertions(+), 1 deletions(-)
---
diff --git a/quilt-0001-configure-Honor-TMPDIR-if-set.patch b/quilt-0001-configure-Honor-TMPDIR-if-set.patch
new file mode 100644
index 0000000..372875a
--- /dev/null
+++ b/quilt-0001-configure-Honor-TMPDIR-if-set.patch
@@ -0,0 +1,40 @@
+From 91eae497495be15cf6a6a95101ca37fc027d69af Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare at suse.de>
+Date: Thu, 8 Dec 2011 16:34:28 +0100
+Subject: [PATCH 1/7] configure*: Honor $TMPDIR if set
+
+---
+ configure     |    2 +-
+ configure.ac  |    2 +-
+ quilt.changes |    5 +++++
+ 3 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index b57dbbb..e73dc92 100755
+--- a/configure
++++ b/configure
+@@ -5805,7 +5805,7 @@ $as_echo "$as_me: WARNING: Using internal mktemp mechanism.  Use option '--with-
+ if test -z "$INTERNAL_MKTEMP" ; then
+     { $as_echo "$as_me:$LINENO: checking whether $MKTEMP -d works" >&5
+ $as_echo_n "checking whether $MKTEMP -d works... " >&6; }
+-    if tempdir=`$MKTEMP -d /tmp/$PACKAGE_NAME.XXXXXX 2>/dev/null` && \
++    if tempdir=`$MKTEMP -d ${TMPDIR:-/tmp}/$PACKAGE_NAME.XXXXXX 2>/dev/null` && \
+        rmdir "$tempdir" ; then
+ 	{ $as_echo "$as_me:$LINENO: result: yes" >&5
+ $as_echo "yes" >&6; }
+diff --git a/configure.ac b/configure.ac
+index fba5f2c..b5851eb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -216,7 +216,7 @@ fi
+ QUILT_COMPAT_PROG_PATH(MKTEMP, mktemp)
+ if test -z "$INTERNAL_MKTEMP" ; then
+     AC_MSG_CHECKING(whether $MKTEMP -d works)
+-    if tempdir=`$MKTEMP -d /tmp/$PACKAGE_NAME.XXXXXX 2>/dev/null` && \
++    if tempdir=`$MKTEMP -d ${TMPDIR:-/tmp}/$PACKAGE_NAME.XXXXXX 2>/dev/null` && \
+        rmdir "$tempdir" ; then
+ 	AC_MSG_RESULT(yes)
+     else
+-- 
+1.7.7.4
+
diff --git a/quilt-0002-inspect-Consistently-use-TMPDIR-.-when-testing-if-TM.patch b/quilt-0002-inspect-Consistently-use-TMPDIR-.-when-testing-if-TM.patch
new file mode 100644
index 0000000..c9ae2fe
--- /dev/null
+++ b/quilt-0002-inspect-Consistently-use-TMPDIR-.-when-testing-if-TM.patch
@@ -0,0 +1,27 @@
+From 8ff76066f0937297f34b2800a4d8dbee57da5232 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare at suse.de>
+Date: Thu, 8 Dec 2011 17:09:36 +0100
+Subject: [PATCH 2/7] inspect: Consistently use ${TMPDIR:-...} when testing if
+ TMPDIR is set
+
+---
+ quilt.changes            |    6 ++++++
+ quilt/scripts/inspect.in |    2 +-
+ 2 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/quilt/scripts/inspect.in b/quilt/scripts/inspect.in
+index 1ad1866..b05ec73 100644
+--- a/quilt/scripts/inspect.in
++++ b/quilt/scripts/inspect.in
+@@ -61,7 +61,7 @@ else
+ 	specdir=$PWD
+ fi
+ 
+-tmpdir="$(gen_tempfile -d ${TMPDIR-/var/tmp}/${0##*/})"
++tmpdir="$(gen_tempfile -d ${TMPDIR:-/var/tmp}/${0##*/})"
+ mkdir -p $tmpdir || exit 1
+ add_exit_handler "rm -rf $tmpdir"
+ mkdir -p $tmpdir/build
+-- 
+1.7.7.4
+
diff --git a/quilt-0003-inspect-File-name-means-read-from-stdin-for-tar.patch b/quilt-0003-inspect-File-name-means-read-from-stdin-for-tar.patch
new file mode 100644
index 0000000..e1e4a6a
--- /dev/null
+++ b/quilt-0003-inspect-File-name-means-read-from-stdin-for-tar.patch
@@ -0,0 +1,26 @@
+From a8eae6b84f446e9cda14977acba88ead040a4600 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare at suse.de>
+Date: Thu, 15 Dec 2011 13:55:47 +0100
+Subject: [PATCH 3/7] inspect: File name "-" means "read from stdin" for tar
+
+---
+ quilt.changes            |    6 ++++++
+ quilt/scripts/inspect.in |    2 ++
+ 2 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/quilt/scripts/inspect.in b/quilt/scripts/inspect.in
+index b05ec73..8d5f229 100644
+--- a/quilt/scripts/inspect.in
++++ b/quilt/scripts/inspect.in
+@@ -266,6 +266,8 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
+ 		;;
+ 	tar)
+ 		inputfile=$(tar_input_file "$@")
++		# For tar, file - means read from stdin
++		[ "$inputfile" = "-" ] && inputfile=
+ 		;;
+ 	esac
+ 	if [ -z "$inputfile" ]; then
+-- 
+1.7.7.4
+
diff --git a/quilt-0004-Don-t-let-TMPDIR-take-over-var-tmp.patch b/quilt-0004-Don-t-let-TMPDIR-take-over-var-tmp.patch
new file mode 100644
index 0000000..ffe1682
--- /dev/null
+++ b/quilt-0004-Don-t-let-TMPDIR-take-over-var-tmp.patch
@@ -0,0 +1,40 @@
+From b850ecea0cf22fd3222cf68d600b86866b08b109 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare at suse.de>
+Date: Thu, 15 Dec 2011 14:22:57 +0100
+Subject: [PATCH 4/7] Don't let TMPDIR take over /var/tmp
+
+TMPDIR is set to /tmp by default on some systems [1], in this case
+letting it take over /var/tmp voids the point of using /var/tmp for
+data size reasons in the first place [2]. I'd rather hardcode
+/var/tmp. But in case someone really wants to control this, we can
+check if VARTMPDIR is set and use that if it is set.
+
+[1] I tried to track down how it was happening and I am far from
+certain that this is on purpose. I've seen it happen only on local
+graphical login, not on text console login nor remote login. This
+suggests a leak from some piece of the graphical desktop stack. And
+I've seen it on both KDE and Gnome, but not Xfce. Go figure.
+
+[2] This is the reason given in commit
+d4074d26276b9a2d452563dbf57ed497afa7b710 for using /var/tmp.
+---
+ quilt.changes            |    5 +++++
+ quilt/scripts/inspect.in |    2 +-
+ 2 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/quilt/scripts/inspect.in b/quilt/scripts/inspect.in
+index 8d5f229..63d8ba4 100644
+--- a/quilt/scripts/inspect.in
++++ b/quilt/scripts/inspect.in
+@@ -61,7 +61,7 @@ else
+ 	specdir=$PWD
+ fi
+ 
+-tmpdir="$(gen_tempfile -d ${TMPDIR:-/var/tmp}/${0##*/})"
++tmpdir="$(gen_tempfile -d ${VARTMPDIR:-/var/tmp}/${0##*/})"
+ mkdir -p $tmpdir || exit 1
+ add_exit_handler "rm -rf $tmpdir"
+ mkdir -p $tmpdir/build
+-- 
+1.7.7.4
+
diff --git a/quilt.spec b/quilt.spec
index a98a193..2acbf1f 100644
--- a/quilt.spec
+++ b/quilt.spec
@@ -7,7 +7,7 @@ Summary:	Scripts for working with series of patches
 License:	GPLv2
 Group:		Development/Tools
 Version:	0.50
-Release:	2%{?dist}
+Release:	3%{?dist}
 Source:		http://savannah.nongnu.org/download/quilt/quilt-%{version}.tar.gz
 URL:		http://savannah.nongnu.org/projects/quilt
 BuildRequires: gettext gawk util-linux-ng
@@ -23,6 +23,10 @@ Requires: util-linux-ng
 Requires: tar
 Requires: rpm-build
 Patch1: quilt-mail-Fix-delivery-address-checking.patch
+Patch2: quilt-0001-configure-Honor-TMPDIR-if-set.patch
+Patch3: quilt-0002-inspect-Consistently-use-TMPDIR-.-when-testing-if-TM.patch
+Patch4: quilt-0003-inspect-File-name-means-read-from-stdin-for-tar.patch
+Patch5: quilt-0004-Don-t-let-TMPDIR-take-over-var-tmp.patch
 
 %description
 These scripts allow one to manage a series of patches by keeping track of the
@@ -34,6 +38,10 @@ http://www.zip.com.au/~akpm/linux/patches/
 %prep
 %setup
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %build
 %configure --with-sendmail=%{_sbindir}/sendmail --with-diffstat=%{_bindir}/diffstat
@@ -59,6 +67,9 @@ rm -rf $RPM_BUILD_ROOT/%{_docdir}
 %{_mandir}/man1/*
 
 %changelog
+* Mon Dec 19 2011 Josh Boyer <jwboyer at redhat.com> - 0.50-3
+- Fix quilt setup regression (rhbz #768787)
+
 * Wed Dec 07 2011 Josh Boyer <jwboyer at redhat.com> - 0.50-2
 - Fix regression in email address checking
 


More information about the scm-commits mailing list