createrepo/__init__.py

[email protected] (Seth Vidal)
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
 createrepo/__init__.py |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit b732307670bf0c9a5198d02c93e512c6c22287a1
Author: Seth Vidal <[email protected]>
Date:   Fri Oct 17 15:31:31 2008 -0400

    add arbitrary metadata to config options for api callers

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index e9f1e08..b10c1e2 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -83,6 +83,7 @@ class MetaDataConfig(object):
         self.directories = []
         self.changelog_limit = None # needs to be an int or None
         self.unique_md_filenames = False
+        self.additional_metadata = {} # dict of 'type':'filename'
 
         
 
@@ -742,10 +743,15 @@ class MetaDataGenerator:
             self.addArbitraryMetadata(self.conf.groupfile, 'group_gz', reporoot)
             self.addArbitraryMetadata(self.conf.groupfile, 'group', reporoot, compress=False)            
         
-        if self.rpmlib_reqs:
-            rpmlib = reporoot.newChild(rpmns, 'lib', None)
-            for r in self.rpmlib_reqs.keys():
-                req  = rpmlib.newChild(rpmns, 'requires', r)
+        if self.conf.additional_metadata:
+            for md_type, mdfile in self.conf.additional_metadata.items():
+                self.addArbitraryMetadata(mdfile, md_type, reporoot)
+
+        # FIXME - disabled until we decide how best to use this
+        #if self.rpmlib_reqs:
+        #    rpmlib = reporoot.newChild(rpmns, 'lib', None)
+        #    for r in self.rpmlib_reqs.keys():
+        #        req  = rpmlib.newChild(rpmns, 'requires', r)
                 
             
         # save it down
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.