RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 980502 - libguestfs is not able to be built with yum cache from multiple repos
Summary: libguestfs is not able to be built with yum cache from multiple repos
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-02 14:23 UTC by Tomas Tomecek
Modified: 2019-08-27 13:44 UTC (History)
6 users (show)

Fixed In Version: libguestfs-1.20.9-7.el6
Doc Type: Bug Fix
Doc Text:
(This is a build-time problem, and does not need to be documented)
Clone Of:
Environment:
Last Closed: 2013-11-21 04:45:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1536 0 normal SHIPPED_LIVE Moderate: libguestfs security, bug fix, and enhancement update 2013-11-21 00:40:55 UTC

Description Tomas Tomecek 2013-07-02 14:23:11 UTC
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

Comment 2 Richard W.M. Jones 2013-07-02 15:09:53 UTC
Cheers, yes this is a bug and I'll include this shortly.

Comment 3 Richard W.M. Jones 2013-07-03 14:58:28 UTC
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]

Comment 4 Tomas Tomecek 2013-07-04 12:05:36 UTC
Well, your fix is much more secure than mine. I verified it and it works very well. Thank you.

Comment 5 bfan 2013-07-30 05:55:28 UTC
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

Comment 6 Tomas Tomecek 2013-07-30 08:57:36 UTC
(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.

Comment 9 Lingfei Kong 2013-10-21 05:41:37 UTC
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

Comment 10 Lingfei Kong 2013-10-21 05:56:37 UTC
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

Comment 13 Lingfei Kong 2013-10-22 00:37:41 UTC
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.

Comment 15 errata-xmlrpc 2013-11-21 04:45:44 UTC
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


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