[Rpm-metadata] AUTHORS createrepo/__init__.py createrepo.spec docs/createrepo.8 genpkgmetadata.py README

Seth Vidal skvidal at linux.duke.edu
Tue Oct 21 18:22:38 UTC 2008


 AUTHORS                |    4 ++++
 README                 |    3 ++-
 createrepo.spec        |    2 +-
 createrepo/__init__.py |   15 +++++++++++++--
 docs/createrepo.8      |   15 ++++++++++-----
 genpkgmetadata.py      |   17 ++++++++++++++++-
 6 files changed, 46 insertions(+), 10 deletions(-)

New commits:
commit 1020057de0fbaad469bd86927ac7622fce7a19d8
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Oct 21 14:22:12 2008 -0400

    - document --content, --distro and --revision
    - update urls in spec and docs
    - add Authors file

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..d18ef02
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,4 @@
+Seth Vidal
+Luke Macken
+James Antill
+Paul Nasrat
diff --git a/README b/README
index b35c668..99bd0dd 100644
--- a/README
+++ b/README
@@ -4,7 +4,8 @@ other package-repository-related tools.
 
 run createrepo -h for usage syntax
 
-http://linux.duke.edu/createrepo/
+http://createrepo.baseurl.org/
+
 
 
 
diff --git a/createrepo.spec b/createrepo.spec
index ac4573c..fc49870 100644
--- a/createrepo.spec
+++ b/createrepo.spec
@@ -7,7 +7,7 @@ Release: 1
 License: GPL
 Group: System Environment/Base
 Source: %{name}-%{version}.tar.gz
-URL: http://linux.duke.edu/metadata/
+URL: http://createrepo.baseurl.org/
 BuildRoot: %{_tmppath}/%{name}-%{version}root
 BuildArchitectures: noarch
 Requires: python >= 2.1, rpm-python, rpm >= 0:4.1.1, libxml2-python
diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 488abb4..744bb67 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -84,8 +84,9 @@ class MetaDataConfig(object):
         self.changelog_limit = None # needs to be an int or None
         self.unique_md_filenames = False
         self.additional_metadata = {} # dict of 'type':'filename'
-
-        
+        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)]
 
 class SimpleMDCallBack(object):
     def errorlog(self, thing):
@@ -604,6 +605,16 @@ class MetaDataGenerator:
         rpmns = reporoot.newNs("http://linux.duke.edu/metadata/rpm", 'rpm')        
         repopath = os.path.join(self.conf.outputdir, self.conf.tempdir)
         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:
+            tags = reporoot.newChild(None, 'tags', None)
+            for item in self.conf.content_tags:
+                c_tags = tags.newChild(None, 'content', item)
+            for (cpeid,item) in self.conf.distro_tags:
+                d_tags = tags.newChild(None, 'distro', item)
+                if cpeid:
+                    d_tags.newProp('cpeid', cpeid)
 
         sumtype = self.conf.sumtype
         if self.conf.database_only:
diff --git a/docs/createrepo.8 b/docs/createrepo.8
index 719edff..1a31190 100644
--- a/docs/createrepo.8
+++ b/docs/createrepo.8
@@ -73,9 +73,13 @@ Ignore symlinks of packages
 Only import the last N changelog entries, from each rpm, into the metadata
 .IP "\fB\--unique-md-filenames\fP"
 Include the file's checksum in the metadata filename, helps HTTP caching
-
-.IP "\fB\--database-only\fP"
-Generate only the sqlite dbs. Do not create the xml metadata at all.
+.IP "\--distro\fP"
+Specify distro tags. Can be specified more than once. Optional syntax specifying a
+cpeid(http://cpe.mitre.org/) --distro=cpeid,distrotag
+.IP "\--content\fP"
+Specify keyword/tags about the content of the repository. Can be specified more than once.
+.IP "\--revision\fP"
+Arbitrary string for a repository revision.
 
 .SH "EXAMPLES"
 Here is an example of a repository with a groups file. Note that the
@@ -99,11 +103,12 @@ repodata/repomd.xml
 .PP 
 .SH "AUTHORS"
 .nf 
-Seth Vidal <skvidal at phy.duke.edu>
+See the Authors file
 .fi 
 
 .PP 
 .SH "BUGS"
 Any bugs which are found should be emailed to the mailing list:
-rpm-metadata at linux.duke.edu
+rpm-metadata at lists.baseurl.org
+or reported in trac at: http://createrepo.baseurl.org
 .fi
diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index 5fe9a9a..77b4095 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -83,7 +83,13 @@ def parseArgs(args, conf):
                       default=False, action="store_true",
                       help="include the file's checksum in the filename, helps" \
                            "with proxies")
-                           
+    parser.add_option("--distro", default=[], action="append",
+                      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("--revision", default=None,
+                      help="user-specified revision for this repository")
+
     (opts, argsleft) = parser.parse_args(args)
     if len(argsleft) > 1 and not opts.split:
         errorprint(_('Error: Only one directory allowed per run.'))
@@ -115,6 +121,15 @@ def parseArgs(args, conf):
     conf.directory = directory
     conf.directories = directories
 
+    # distro tag parsing
+
+    for spec in opts.distro:
+        if spec.find(',') == -1:
+            conf.distro_tags.append((None,spec))
+        else:
+            splitspec = spec.split(',')
+            conf.distro_tags.append((splitspec[0], splitspec[1]))
+
     lst = []
     if conf.pkglist:
         pfo = open(conf.pkglist, 'r')


More information about the Rpm-metadata mailing list