[arch-commits] Commit in findutils/trunk (3 files)

Stéphane Gaudreault stephane at archlinux.org
Sun Nov 21 19:35:11 UTC 2010


    Date: Sunday, November 21, 2010 @ 14:35:10
  Author: stephane
Revision: 100210

upgpkg: findutils 4.5.9-1
rebuild of old package, tidy up PKGBUILD, fix bug in handling of -execdir

Added:
  findutils/trunk/findutils-4.5.9-execdir.patch
Modified:
  findutils/trunk/PKGBUILD
  findutils/trunk/findutils.install

-------------------------------+
 PKGBUILD                      |   32 ++++++------
 findutils-4.5.9-execdir.patch |  106 ++++++++++++++++++++++++++++++++++++++++
 findutils.install             |    2 
 3 files changed, 125 insertions(+), 15 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-11-21 18:53:17 UTC (rev 100209)
+++ PKGBUILD	2010-11-21 19:35:10 UTC (rev 100210)
@@ -1,32 +1,36 @@
 # $Id$
-# Maintainer: 
+# Maintainer:
 
 pkgname=findutils
-pkgver=4.4.2
-pkgrel=2
+pkgver=4.5.9
+pkgrel=1
 pkgdesc="GNU utilities to locate files"
 arch=('i686' 'x86_64')
 license=('GPL3')
 groups=('base')
 depends=('glibc' 'sh')
 url="http://www.gnu.org/software/findutils"
-source=(ftp://ftp.gnu.org/pub/gnu/findutils/findutils-$pkgver.tar.gz)
+source=(ftp://alpha.gnu.org/gnu/findutils/${pkgname}-${pkgver}.tar.gz findutils-4.5.9-execdir.patch)
 install=findutils.install
-md5sums=('351cc4adb07d54877fa15f75fb77d39f')
+sha1sums=('7bfaadeb7a93c1bd959a360ecb0971a63ff43677'
+          '0c44872ea89b85c509c780b8096a23f1c2db96fe')
 
 build() {
-  cd $srcdir/$pkgname-$pkgver
+  cd "${srcdir}/${pkgname}-${pkgver}"
+
+  # Fix some bugs in handling of -execdir, including upstream commit 443487e
+  # and the proposed fix for https://savannah.gnu.org/bugs/index.php?29949
+  patch -Np1 -i ../findutils-4.5.9-execdir.patch
+
+  # Don't build or install locate because we use mlocate,
+  # which is a secure version of locate.
+  sed -i '/^SUBDIRS/s/locate//' Makefile.in
+
   ./configure --prefix=/usr
-  make || return 1
+  make
 }
 
 package() {
-  cd $srcdir/$pkgname-$pkgver
+  cd "${srcdir}/${pkgname}-${pkgver}"
   make DESTDIR=$pkgdir install
-  rm -rf $pkgdir/usr/{libexec,var}
-
-  # remove locate utils (we use mlocate instead)
-  rm -f $pkgdir/usr/bin/{locate,updatedb}
-  rm -f $pkgdir/usr/share/man/man1/{updatedb.1,locate.1}
-  rm -f $pkgdir/usr/share/man/man5/locatedb.5
 }

Added: findutils-4.5.9-execdir.patch
===================================================================
--- findutils-4.5.9-execdir.patch	                        (rev 0)
+++ findutils-4.5.9-execdir.patch	2010-11-21 19:35:10 UTC (rev 100210)
@@ -0,0 +1,106 @@
+ ChangeLog                                    |   18 ++++++++++++++++++
+ NEWS                                         |    4 ++++
+ find/pred.c                                  |   10 ++++------
+ find/testsuite/find.gnu/execdir-multiple.exp |    1 +
+ lib/dircallback.c                            |    7 ++++++-
+ 5 files changed, 33 insertions(+), 7 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index ba12e93..e2451c4 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,21 @@
++2010-05-24  Kamil Dudka  <kdudka at redhat.com>
++
++	Fix Savannah bug #29949, -execdir does not change working directory
++	* find/pred.c (record_exec_dir): Do not throw the execdir when not
++	working in the cumulative mode.
++	* find/testsuite/find.gnu/execdir-multiple.exp: Add a test-case for
++	the bug #29949.
++	* NEWS: Mention this bugfix.
++
++2010-05-07  Kamil Dudka  <kdudka at redhat.com>
++
++	* lib/dircallback.c (run_in_dir): Make sure that if the callback
++	doesn't get run, the return value is nonzero.  Make sure that if
++	the directory save/restore fails, we don't overwrite errno with a
++	random value (and hence report some unrelated and nonexistent
++	error, instead of the real problem).  Restore the previous current
++	directory.
++
+ 2010-04-29  James Youngman  <jay at gnu.org>
+ 
+ 	Prepare for the release of findutils version 4.5.9.
+diff --git a/NEWS b/NEWS
+index e27a834..cae1eab 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,5 +1,9 @@
+ GNU findutils NEWS - User visible changes.      -*- outline -*- (allout)
+ 
++** Bug Fixes
++
++#29949: find -execdir does not change working directory
++
+ * Major changes in release 4.5.9, 2010-04-29
+ 
+ ** Bug Fixes
+diff --git a/find/pred.c b/find/pred.c
+index 6eeaa42..0efb55f 100644
+--- a/find/pred.c
++++ b/find/pred.c
+@@ -528,13 +528,11 @@ initialise_wd_for_exec (struct exec_val *execp, int cwd_fd, const char *dir)
+ static bool
+ record_exec_dir (struct exec_val *execp)
+ {
+-  if (!execp->wd_for_exec)
++  /* working directory not already known, so must be a *dir variant,
++     and this must be the first arg we added.   However, this may
++     be -execdir foo {} \; (i.e. not multiple).  */
++  if (!execp->state.todo)
+     {
+-      /* working directory not already known, so must be a *dir variant,
+-	 and this must be the first arg we added.   However, this may
+-	 be -execdir foo {} \; (i.e. not multiple).  */
+-      assert (!execp->state.todo);
+-
+       /* Record the WD. If we're using -L or fts chooses to do so for
+ 	 any other reason, state.cwd_dir_fd may in fact not be the
+ 	 directory containing the target file.  When this happens,
+diff --git a/find/testsuite/find.gnu/execdir-multiple.exp b/find/testsuite/find.gnu/execdir-multiple.exp
+index 6d4bd66..495b93b 100644
+--- a/find/testsuite/find.gnu/execdir-multiple.exp
++++ b/find/testsuite/find.gnu/execdir-multiple.exp
+@@ -49,6 +49,7 @@ if { [ safe_path ] } {
+     }
+ 
+     set SKIP_OLD 1
++    find_start p {tmp -type f -empty -execdir sh ./runme \{\} \; } ""
+     find_start p {tmp -type f -empty -execdir sh ./runme  \{\} + } ""
+     set SKIP_OLD 0
+     exec rm -rf tmp
+diff --git a/lib/dircallback.c b/lib/dircallback.c
+index 8497bee..c1e4088 100644
+--- a/lib/dircallback.c
++++ b/lib/dircallback.c
+@@ -37,7 +37,8 @@ int
+ run_in_dir (const struct saved_cwd *there,
+ 	    int (*callback)(void*), void *usercontext)
+ {
+-  int err, saved_errno;
++  int err = -1;
++  int saved_errno = 0;
+   struct saved_cwd here;
+   if (0 == save_cwd (&here))
+     {
+@@ -50,6 +51,10 @@ run_in_dir (const struct saved_cwd *there,
+ 	{
+ 	  openat_restore_fail (errno);
+ 	}
++
++      if (restore_cwd (&here) != 0)
++	openat_restore_fail (errno);
++
+       free_cwd (&here);
+     }
+   else

Modified: findutils.install
===================================================================
--- findutils.install	2010-11-21 18:53:17 UTC (rev 100209)
+++ findutils.install	2010-11-21 19:35:10 UTC (rev 100210)
@@ -1,5 +1,5 @@
 infodir=/usr/share/info
-filelist=(find-maint.info find.info)
+filelist=(find-maint.info find.info find.info-1)
 
 post_install() {
   [ -x usr/bin/install-info ] || return 0




More information about the arch-commits mailing list