Red Hat Bugzilla – Bug 980502
libguestfs is not able to be built with yum cache from multiple repos
Last modified: 2013-11-20 23:45:44 EST
If yum cache at /var/cache/yum contains packages from multiple repos and there are duplicate rpms, build fails: cp: will not overwrite just-created `repo/file-devel-5.04-15.el6.x86_64.rpm' with `/var/cache/yum/build-released/packages/file-devel-5.04-15.el6.x86_64.rpm' Unfortunately this is happening quite often when we try to run static analysis scans on this package in mock chroot environment. We have to modify SRPM to scan it properly. Slight modification was working for me fine (cp won't mind overwrite now): --- a/libguestfs.spec +++ b/libguestfs.spec @@ -649,7 +649,9 @@ if ping -c 3 -w 20 8.8.8.8 && wget http://libguestfs.org -O /dev/null; then extra= else mkdir repo - find /var/cache/yum -type f -name '*.rpm' -print0 | xargs -0 cp -t repo + for package in $(find /var/cache/yum -type f -name '*.rpm') ; do + cp $package repo ; + done createrepo repo cat > yum.conf <<EOF [main] RPMs we had problem with: libguestfs-1.16.34-2.el6 libguestfs-1.20.9-6.el6
Cheers, yes this is a bug and I'll include this shortly.
I fixed this in a slightly different way: --- a/libguestfs.spec +++ b/libguestfs.spec @@ -548,7 +548,8 @@ if ping -c 3 -w 20 8.8.8.8 && wget http://libguestfs.org -O /dev/null; then extra= else mkdir repo - find /var/cache/yum -type f -name '*.rpm' -print0 | xargs -0 cp -t repo + # -n 1 because of RHBZ#980502. + find /var/cache/yum -type f -name '*.rpm' -print0 | xargs -0 -n 1 cp -t repo createrepo repo cat > yum.conf <<EOF [main]
Well, your fix is much more secure than mine. I verified it and it works very well. Thank you.
Hello Tomas, May I know you verified this bug with developer's patch or a new build package? If only using patch, could you please help us to verify it with libguestfs-1.20.9-7.el6, thanks
(In reply to bfan from comment #5) > Hello Tomas, > May I know you verified this bug with developer's patch or a new build > package? > > If only using patch, could you please help us to verify it with > libguestfs-1.20.9-7.el6, thanks I've just rebuilt it (with multiple yum repos enabled) and it passed. This was the problematic part (no errors or even warnings anymore): + mkdir repo + find /var/cache/yum -type f -name '*.rpm' -print0 + xargs -0 -n 1 cp -t repo So, I can verify that the bug is fixed.
Hello Tomas, As I see, this bug occurred when build the libguestfs package, I spent time to read libguestfs.spec and try to build the package,but failed. It would be easier for you to build the libguestfs package than me, so could you help to reproduce and verify this bug with the latest version of libguestfs: libguestfs-1.20.11-2.el6 ? Thanks & Best regards
Hello Tomas, Thanks for your help. Also, I checked libguestfs.spec of libguestfs-1.20.11-2.el6, it have been changed like Comment 3. So, this bug is fixed.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-1536.html