exclude rpmlib requires from metadata b/c they are silly
authorSeth Vidal <skvidal@fedoraproject.org>
Mon, 3 Mar 2008 15:58:52 +0000 (10:58 -0500)
committerSeth Vidal <skvidal@fedoraproject.org>
Mon, 3 Mar 2008 15:58:52 +0000 (10:58 -0500)
store them in the repomd.xml per-repo so we have them if we ever actually need them

createrepo/__init__.py
createrepo/yumbased.py

index e91cf85f197a479009401b7e53efa1fe0961f5f0..7c463460d8a11abdcb5413cf005ef543f40d33d8 100644 (file)
@@ -104,7 +104,8 @@ class MetaDataGenerator:
         self.ts = rpmUtils.transaction.initReadOnlyTransaction()
         self.pkgcount = 0
         self.files = []
-        
+        self.rpmlib_reqs = {}
+                
         if not self.conf.directory and not self.conf.directories:
             raise MDError, "No directory given on which to run."
         
@@ -394,9 +395,12 @@ class MetaDataGenerator:
         po.crp_cachedir = self.conf.cachedir
         po.crp_baseurl = baseurl
         po.crp_reldir = reldir
-
+        for r in po.requires_print:
+            if r.startswith('rpmlib('):
+                self.rpmlib_reqs[r] = 1
+           
         if po.checksum in (None, ""):
-            raise MDError, "No Package ID found for package %s, not going to add it" % e
+            raise MDError, "No Package ID found for package %s, not going to add it" % po
         
         return po
 
@@ -677,7 +681,13 @@ class MetaDataGenerator:
         if self.conf.groupfile is not None:
             self.addArbitraryMetadata(self.conf.groupfile, 'group_gz', reporoot)
             self.addArbitraryMetadata(self.conf.groupfile, 'group', reporoot, compress=False)            
-
+        
+        if self.rpmlib_reqs:
+            rpmlib = reporoot.newChild(None, 'rpmlib_requirements', None)
+            for r in self.rpmlib_reqs.keys():
+                req  = rpmlib.newChild(None, 'requires', r)
+                
+            
         # save it down
         try:
             repodoc.saveFormatFileEnc(repofilepath, 'UTF-8', 1)
index 17af4e60b0b0800c1b8f265f04db4d1b2b6f1414..58d240509cb625c554597bd587c7657842b2b007 100644 (file)
@@ -338,6 +338,8 @@ class CreateRepoPackage(YumLocalPackage):
 
         if mylist: msg = "\n    <rpm:requires>\n"
         for (name, flags, (e,v,r),pre) in mylist:
+            if name.startswith('rpmlib('):
+                continue
             prcostring = '''      <rpm:entry name="%s"''' % name
             if flags:
                 prcostring += ''' flags="%s"''' % flags