add repo tags and --repo option to describe the repo itself.
authorSeth Vidal <skvidal@fedoraproject.org>
Fri, 5 Mar 2010 18:11:56 +0000 (13:11 -0500)
committerSeth Vidal <skvidal@fedoraproject.org>
Fri, 5 Mar 2010 18:11:56 +0000 (13:11 -0500)
request from suse.

createrepo/__init__.py
genpkgmetadata.py

index 0c0c7d83081014356d4ced71b6853bd855feffe9..cb8ba16f1adfa4fafd8cd857591efd799e132601 100644 (file)
@@ -100,6 +100,7 @@ class MetaDataConfig(object):
         self.revision = str(int(time.time()))
         self.content_tags = [] # flat list of strings (like web 2.0 tags)
         self.distro_tags = []# [(cpeid(None allowed), human-readable-string)]
+        self.repo_tags = []# strings, forwhatever they are worth
         self.read_pkgs_list = None # filepath/name to write out list of pkgs
                                    # read in this run of createrepo
         
@@ -807,10 +808,12 @@ class MetaDataGenerator:
         repofilepath = os.path.join(repopath, self.conf.repomdfile)
         
         revision = reporoot.newChild(None, 'revision', self.conf.revision)
-        if self.conf.content_tags or self.conf.distro_tags:
+        if self.conf.content_tags or self.conf.distro_tags or self.conf.repo_tags:
             tags = reporoot.newChild(None, 'tags', None)
             for item in self.conf.content_tags:
                 c_tags = tags.newChild(None, 'content', item)
+            for item in self.conf.repo_tags:
+                c_tags = tags.newChild(None, 'repo', item)
             for (cpeid, item) in self.conf.distro_tags:
                 d_tags = tags.newChild(None, 'distro', item)
                 if cpeid:
index 7877ba940f5a353397cfca835b906844da5886a1..81e86c2694239c8682995ce7a63ef18890c14efa 100755 (executable)
@@ -102,6 +102,8 @@ def parse_args(args, conf):
         help="distro tag and optional cpeid: --distro" "'cpeid,textname'")
     parser.add_option("--content", default=[], dest='content_tags', 
         action="append", help="tags for the content in the repository")
+    parser.add_option("--repo", default=[], dest='repo_tags', 
+        action="append", help="tags to describe the repository itself")
     parser.add_option("--revision", default=None,
         help="user-specified revision for this repository")
     parser.add_option("--deltas", default=False, action="store_true",