- clean up some garbage spaces and an extra 'return'
authorSeth Vidal <skvidal@fedoraproject.org>
Mon, 18 Feb 2008 18:09:39 +0000 (13:09 -0500)
committerSeth Vidal <skvidal@fedoraproject.org>
Mon, 18 Feb 2008 18:09:39 +0000 (13:09 -0500)
- 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

createrepo/__init__.py
createrepo/yumbased.py

index a2719db9ff440d2904a21bc7e6bd207331dc3048..6cbca7db155e7f3f2cccc65a640a7985b2d15a1d 100644 (file)
@@ -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):
index 1b4d1061dd5c7ecbdc6743bbf5b6e9d8f2eca82f..8f424fd7c07c8e06be973025b0adae5171192faa 100644 (file)
@@ -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):