bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

autopoint --force can corrupt CVS/Entries files


From: Jim Meyering
Subject: autopoint --force can corrupt CVS/Entries files
Date: Tue, 08 Apr 2008 21:56:04 +0200

This was first reported by Rich Jones here:

  http://bugzilla.redhat.com/441481

In the presence of non-functional xargs, autopoint
corrupts existing CVS/Entries files.

Here's a small stand-alone reproducer:

#!/bin/sh
rm -rf j m
mkdir j && d=$PWD/j;
(cd j && printf '#!/bin/sh\nexit 1\n' > xargs; chmod a+x xargs; cvs -d $d init )
mkdir m && (cd m && touch a && cvs -d $d import -m x m M M0 )
rm -rf m; cvs -d $d co m && cd m
echo 'AM_GNU_GETTEXT_VERSION([0.15])' > configure.ac
PATH=$d:$PATH autopoint --force
cvs -n up

After running that, cvs -n up prints this:

    cvs update: in directory .:
    cvs update: ignoring CVS/Root because it specifies a non-existent 
repository /e/m/tmpcvs20759
    cvs update: No CVSROOT specified!  Please use the `-d' option
    cvs [update aborted]: or set the CVSROOT environment variable.

And here's a tiny patch:

Index: gettext-tools/misc/autopoint.in
===================================================================
RCS file: /sources/gettext/gettext/gettext-tools/misc/autopoint.in,v
retrieving revision 1.37
diff -u -p -r1.37 autopoint.in
--- gettext-tools/misc/autopoint.in     18 Jan 2008 23:30:16 -0000      1.37
+++ gettext-tools/misc/autopoint.in     8 Apr 2008 19:50:29 -0000
@@ -425,7 +425,7 @@ gzip -d -c < "$gettext_dir/archive.tar.g
 cd "$work_dir"
 cvsver=gettext-`echo "$ver" | sed -e 's/\./_/g'`
 (cvs checkout -r"$cvsver" archive > /dev/null) 2>&1 | grep -v '^cvs checkout: 
Updating'
-find archive -name CVS -type d -print | xargs rm -rf
+find archive -name CVS -type d -print | xargs rm -rf || exit 1
 if test `find archive -type f -print | wc -l` = 0; then
   cd ..
   rm -rf "$cvs_dir" "$work_dir"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]