diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-03-27 01:49:11 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-03-27 01:49:11 +0000 |
commit | 19a107d29e4d6cfe05b8bc47fb9e6264606ee3f9 (patch) | |
tree | 4ddd5e70be5f2b7c07048475c108fce53b1c7349 | |
parent | 8394acac6e57d501ff4a9121d79dabb6d7deeaed (diff) | |
download | portage-19a107d29e4d6cfe05b8bc47fb9e6264606ee3f9.tar.gz portage-19a107d29e4d6cfe05b8bc47fb9e6264606ee3f9.tar.bz2 portage-19a107d29e4d6cfe05b8bc47fb9e6264606ee3f9.zip |
Split out a reusable Manifest._createDigestLines1() method.
svn path=/main/trunk/; revision=3019
-rw-r--r-- | pym/portage_manifest.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py index 8e57346f3..075be9380 100644 --- a/pym/portage_manifest.py +++ b/pym/portage_manifest.py @@ -119,21 +119,25 @@ class Manifest(object): rval = [] for cpv in cpvlist: dname = os.path.join(self.pkgdir, "files", "digest-"+portage.catsplit(cpv)[1]) - mylines = [] distlist = self._getCpvDistfiles(cpv) - for f in self.fhashdict["DIST"].keys(): - if f in distlist: - for h in self.fhashdict["DIST"][f].keys(): - if h not in portage_const.MANIFEST1_HASH_FUNCTIONS: - continue - myline = " ".join([h, str(self.fhashdict["DIST"][f][h]), f, str(self.fhashdict["DIST"][f]["size"])]) - mylines.append(myline) fd = open(dname, "w") - fd.write("\n".join(mylines)) + fd.write("\n".join(self._createDigestLines1(distlist, self.fhashdict))) fd.write("\n") fd.close() rval.append(dname) return rval + + def _createDigestLines1(self, distlist, myhashdict): + """ Create an old style digest file.""" + mylines = [] + for f in myhashdict["DIST"].keys(): + if f in distlist: + for h in myhashdict["DIST"][f].keys(): + if h not in portage_const.MANIFEST1_HASH_FUNCTIONS: + continue + myline = " ".join([h, str(myhashdict["DIST"][f][h]), f, str(myhashdict["DIST"][f]["size"])]) + mylines.append(myline) + return mylines def _addDigestsToManifest(self, digests, fd): """ Add entries for old style digest files to Manifest file """ |