summaryrefslogtreecommitdiffstats
path: root/pym/portage_manifest.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-09 09:00:39 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-09 09:00:39 +0000
commitbbbf1d91708fd4b350c2abe62958b71790464049 (patch)
tree77d0aa2c0e2ce7a5b3b717766521ad9f418193d6 /pym/portage_manifest.py
parent1463b4a1d511bfa0cc03f7cc618c1a964a55b98f (diff)
downloadportage-bbbf1d91708fd4b350c2abe62958b71790464049.tar.gz
portage-bbbf1d91708fd4b350c2abe62958b71790464049.tar.bz2
portage-bbbf1d91708fd4b350c2abe62958b71790464049.zip
Encapsulate type guessing logic in a new Manifest method.
svn path=/main/trunk/; revision=3106
Diffstat (limited to 'pym/portage_manifest.py')
-rw-r--r--pym/portage_manifest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py
index 8cfb43a82..073f7de56 100644
--- a/pym/portage_manifest.py
+++ b/pym/portage_manifest.py
@@ -389,6 +389,19 @@ class Manifest(object):
for f in self._getCpvDistfiles(cpv):
self.updateFileHashes("DIST", f, ignoreMissingFiles=ignoreMissingFiles)
+ def updateHashesGuessType(self, fname, *args, **kwargs):
+ """ Regenerate hashes for the given file (guesses the type and then
+ calls updateFileHashes)."""
+ mytype = self.guessType(fname)
+ if mytype == "AUX":
+ fname = fname[len("files" + os.sep):]
+ elif mytype is None:
+ return
+ myrealtype = self.findFile(fname)
+ if myrealtype is not None:
+ mytype = myrealtype
+ return self.updateFileHashes(mytype, fname, *args, **kwargs)
+
def getFileData(self, ftype, fname, key):
""" Return the value of a specific (type,filename,key) triple, mainly useful
to get the size for distfiles."""