- document --content, --distro and --revision
authorSeth Vidal <skvidal@fedoraproject.org>
Tue, 21 Oct 2008 18:22:12 +0000 (14:22 -0400)
committerSeth Vidal <skvidal@fedoraproject.org>
Tue, 21 Oct 2008 18:22:12 +0000 (14:22 -0400)
- update urls in spec and docs
- add Authors file

AUTHORS [new file with mode: 0644]
README
createrepo.spec
createrepo/__init__.py
docs/createrepo.8
genpkgmetadata.py

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
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 b35c6681f1b584a7ce2e2ba28e89070e69160849..99bd0dd59d4b427bdda094cba6fb61f300d84f87 100644 (file)
--- 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/
+
 
 
 
index ac4573c50cbe6f34be45a6bffbf607ff774486cf..fc498706b0e580a7c426fdb97fe225be3d09bcad 100644 (file)
@@ -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
index 488abb48c426e1d336a84206d45a0d1dcaeb419c..744bb6737cb014f39740e0b865df4da764feba66 100644 (file)
@@ -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:
index 719edffe42d453da06108ae0f624a414c0f3845d..1a311909b5e1463a9128c389868086dd2c2ac419 100644 (file)
@@ -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@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@linux.duke.edu
+rpm-metadata@lists.baseurl.org
+or reported in trac at: http://createrepo.baseurl.org
 .fi
index 5fe9a9a9f5a3ec1e052ceceebe0cfbdb47f2847b..77b4095474c1936c4e0dfc4179d196b72b51ed81 100755 (executable)
@@ -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')