summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-21 23:59:45 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-21 23:59:45 +0000
commitaff2bdaf9234c2c00b2c5d30f9c0f5b925f0cafb (patch)
treebfe58f5f46b1050c430b6b7da0312f9f0f00c9d6 /pym
parent9fa47cfc222dc13c9bc023c3a5730733666093cb (diff)
downloadportage-aff2bdaf9234c2c00b2c5d30f9c0f5b925f0cafb.tar.gz
portage-aff2bdaf9234c2c00b2c5d30f9c0f5b925f0cafb.tar.bz2
portage-aff2bdaf9234c2c00b2c5d30f9c0f5b925f0cafb.zip
Some minor fixes for manifest code (trunk r5735)
svn path=/main/branches/2.1.2/; revision=6923
Diffstat (limited to 'pym')
-rw-r--r--pym/portage_manifest.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py
index 761937b39..6645963dd 100644
--- a/pym/portage_manifest.py
+++ b/pym/portage_manifest.py
@@ -120,7 +120,10 @@ class Manifest(object):
self.compat = manifest1_compat
if not from_scratch:
self._read()
- self.fetchlist_dict = fetchlist_dict
+ if fetchlist_dict != None:
+ self.fetchlist_dict = fetchlist_dict
+ else:
+ self.fetchlist_dict = {}
self.distdir = distdir
self.guessType = guessManifestFileType
@@ -384,17 +387,21 @@ class Manifest(object):
""" Validate signature on Manifest """
raise NotImplementedError()
- def addFile(self, ftype, fname, hashdict=None):
+ def addFile(self, ftype, fname, hashdict=None, ignoreMissing=False):
""" Add entry to Manifest optionally using hashdict to avoid recalculation of hashes """
- if not os.path.exists(self.pkgdir+fname):
+ if ftype == "AUX" and not fname.startswith("files/"):
+ fname = os.path.join("files", fname)
+ if not os.path.exists(self.pkgdir+fname) and not ignoreMissing:
raise FileNotFound(fname)
if not ftype in portage_const.MANIFEST2_IDENTIFIERS:
raise InvalidDataType(ftype)
+ if ftype == "AUX" and fname.startswith("files/"):
+ fname = fname[6:]
self.fhashdict[ftype][fname] = {}
if hashdict != None:
self.fhashdict[ftype][fname].update(hashdict)
if not portage_const.MANIFEST2_REQUIRED_HASH in self.fhashdict[ftype][fname]:
- self.updateFileHashes(ftype, fname)
+ self.updateFileHashes(ftype, fname, checkExisting=False, ignoreMissing=ignoreMissing)
def removeFile(self, ftype, fname):
""" Remove given entry from Manifest """
@@ -530,10 +537,9 @@ class Manifest(object):
self.checkTypeHashes("MISC", ignoreMissingFiles=False)
ebuildname = "%s.ebuild" % self._catsplit(cpv)[1]
self.checkFileHashes("EBUILD", ebuildname, ignoreMissing=False)
- if checkDistfiles:
- if onlyDistfiles:
- for f in self._getCpvDistfiles(cpv):
- self.checkFileHashes("DIST", f, ignoreMissing=False)
+ if checkDistfiles or onlyDistfiles:
+ for f in self._getCpvDistfiles(cpv):
+ self.checkFileHashes("DIST", f, ignoreMissing=False)
def _getCpvDistfiles(self, cpv):
""" Get a list of all DIST files associated to the given cpv """