Bug 441481 - autopoint corrupts CVS control files if xargs doesn't work
autopoint corrupts CVS control files if xargs doesn't work
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: gettext (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Jens Petersen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-08 08:24 EDT by Richard W.M. Jones
Modified: 2008-06-09 22:19 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-09 22:18:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2008-04-08 08:24:27 EDT
'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@libvirt.org:2401/data/cvs' co login
anoncvs
$ cvs -d ':pserver:anoncvs@libvirt.org: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 16:07:53 EDT
I reported it upstream, along with a patch:

To: bug-gnu-gettext@gnu.org
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 03:16:59 EDT
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 01:31:22 EDT
Thank you.

Fixing in gettext-0.17-5.fc10.

Do you think a f9 update is warranted?
Comment 4 Bug Zapper 2008-05-14 05:08:06 EDT
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-09 22:19:12 EDT
Feel free to reopen if you want an update for f9.

Note You need to log in before you can comment on or make changes to this bug.