[Rpm-metadata] createrepo layout bug ?

Pierre Wieser pwieser at trychlos.org
Sun Nov 13 08:30:15 UTC 2011


Hi all,

I have searched in the mailing-list archives (and much google'd)
without finding any suitable pointer on my issue. So I ask this
list.

I would have a yum layout as:
    my_repo/
    +- RPMS/
    +- repodata/

So, I do:
    [pierre my_repo]$ createrepo -o . RPMS

This works almost fine, taking the RPMs from the RPMS/ subdirectory,
creating the repo files in repodata/ subdirectory. Except that
the location href tag in primary.xml does not embed the RPMS/ level
itself. I get:
    <location href="my_package.rpm"/>
instead of:
    <location href="RPMS/my_package.rpm"/>

I would consider this as a bug, as the /etc/yum.repos.d/my_repo.repo
file must address the my_repo/ directory, where Yum wants find a
repodata/ subdir. So, obviously, the href property should embed the
RPMS/ level.

Do you consider this as a bug or is there just something I'm missing ?
I am new with createrepo. I use createrepo 0.9.8 in CentOS6.
Below is a patch I may propose to get ride of this:

--- /usr/lib/python2.6/site-packages/createrepo/__init__.py.orig	2011-11-12 19:09:59.620327132 +0100
+++ /usr/lib/python2.6/site-packages/createrepo/__init__.py	2011-11-12 19:10:42.930273556 +0100
@@ -517,7 +517,7 @@
 
                     try:
                         po = self.read_in_package(pkg, pkgpath=pkgpath, 
-                                                  reldir=reldir)
+                                                  reldir=self.conf.basedir)
                     except MDError, e:
                         # need to say something here
                         self.callback.errorlog("\nError %s: %s\n" % (pkg, e))

Regards,
Pierre


More information about the Rpm-metadata mailing list