Bug 441481

Summary: autopoint corrupts CVS control files if xargs doesn't work
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: gettextAssignee: Jens Petersen <petersen>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-10 02:18:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2008-04-08 12:24:27 UTC
'xargs' is broken in Fedora 8 at the moment and this exposes a
bug in autopoint which causes it to corrupt CVS control files.

This will probably work with any CVS repo.  I'm using libvirt's
CVS repository just as an example (http://libvirt.org/downloads.html).

$ cvs -d ':pserver:anoncvs:2401/data/cvs' co login
anoncvs
$ cvs -d ':pserver:anoncvs:2401/data/cvs' co libvirt
$ cd libvirt/

$ cvs up
[Note that the CVS copy is fine]

$ echo 'exit 1' > /tmp/xargs
$ chmod +x /tmp/xargs
$ PATH=/tmp:$PATH
$ autopoint --force

[At this point the CVS control files have become corrupt ...]

$ cvs up
cvs update: in directory .:
cvs update: ignoring CVS/Root because it specifies a non-existent repository
/tmp/t/libvirt/tmpcvs20502
cvs update: No CVSROOT specified!  Please use the `-d' option
cvs [update aborted]: or set the CVSROOT environment variable.
$ cat CVS/Root
/tmp/t/libvirt/tmpcvs20502

Comment 1 Jim Meyering 2008-04-08 20:07:53 UTC
I reported it upstream, along with a patch:

To: bug-gnu-gettext
Subject: autopoint --force can corrupt CVS/Entries files

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"


Comment 2 Jim Meyering 2008-04-20 07:16:59 UTC
FYI, this is now fixed upstream:

  http://thread.gmane.org/gmane.comp.gnu.utils.bugs/15508/focus=15525

Comment 3 Jens Petersen 2008-04-24 05:31:22 UTC
Thank you.

Fixing in gettext-0.17-5.fc10.

Do you think a f9 update is warranted?

Comment 4 Bug Zapper 2008-05-14 09:08:06 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Jens Petersen 2008-06-10 02:19:12 UTC
Feel free to reopen if you want an update for f9.