From 94b4626c203948ced80305c2321afa3103c35595 Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Mon, 18 Feb 2008 13:09:39 -0500 Subject: [PATCH] - 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 --- createrepo/__init__.py | 15 +++++++++++++++ createrepo/yumbased.py | 9 +-------- 2 files changed, 16 insertions(+), 8 deletions(-) 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): -- 2.34.1