[Rpm-metadata] createrepo/__init__.py createrepo/yumbased.py

Seth Vidal skvidal at linux.duke.edu
Mon Feb 18 18:13:18 UTC 2008


 createrepo/__init__.py |   15 +++++++++++++++
 createrepo/yumbased.py |    9 +--------
 2 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 94b4626c203948ced80305c2321afa3103c35595
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Feb 18 13:09:39 2008 -0500

    - clean up some garbage spaces and an extra 'return'
    - write some notes on something interesting to do for completely arbitrary
      repositories
    - make sure that under no circumstances will a package that we
      cannot get a pkgid/checksum from will be in the metadata. And it will
      output an error message

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index a2719db..6cbca7d 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -344,6 +344,12 @@ class MetaDataGenerator:
 
     def read_in_package(self, rpmfile, pkgpath=None):
         """rpmfile == relative path to file from self.packge_dir"""
+        # TODO/FIXME
+        # consider adding a routine to download the package from a remote location
+        # to a tempdir, operate on it, then use that location as a the baseurl
+        # for the package. That would make it possible to have repos entirely 
+        # comprised of remote packages.
+
         if not pkgpath:
             pkgpath = self.package_dir
 
@@ -356,6 +362,15 @@ class MetaDataGenerator:
         # you can do it
         po.crp_changelog_limit = self.conf.changelog_limit
         po.crp_cachedir = self.conf.cachedir
+
+        # FIXME if we wanted to put in a baseurl-per-package here is where 
+        # we should do it
+        # it would be easy to have a lookup dict in the MetaDataConfig object
+        # and work down from there for the baseurl
+
+        if po.checksum in (None, ""):
+            raise MDError, "No Package ID found for package %s, not going to add it" % e
+        
         return po
 
     def writeMetadataDocs(self, pkglist=[], pkgpath=None, current=0):
diff --git a/createrepo/yumbased.py b/createrepo/yumbased.py
index 1b4d106..8f424fd 100644
--- a/createrepo/yumbased.py
+++ b/createrepo/yumbased.py
@@ -113,14 +113,7 @@ class CreateRepoPackage(YumLocalPackage):
         self._checksum = checksum
 
         return self._checksum
-       
-        
-           
-
-           
-
-            
-        return self._checksum
+      
     checksum = property(fget=lambda self: self._do_checksum())
     
     def _get_header_byte_range(self):



More information about the Rpm-metadata mailing list