1 |
Signed-off-by: Aaron Bauman <bman@g.o> |
2 |
--- |
3 |
lib/portage/manifest.py | 30 +++++++++++++++--------------- |
4 |
1 file changed, 15 insertions(+), 15 deletions(-) |
5 |
|
6 |
diff --git a/lib/portage/manifest.py b/lib/portage/manifest.py |
7 |
index 79c756f04..d43f7d836 100644 |
8 |
--- a/lib/portage/manifest.py |
9 |
+++ b/lib/portage/manifest.py |
10 |
@@ -166,14 +166,14 @@ class Manifest: |
11 |
def getFullname(self): |
12 |
""" Returns the absolute path to the Manifest file for this instance """ |
13 |
return os.path.join(self.pkgdir, "Manifest") |
14 |
- |
15 |
+ |
16 |
def getDigests(self): |
17 |
""" Compability function for old digest/manifest code, returns dict of filename:{hashfunction:hashvalue} """ |
18 |
rval = {} |
19 |
for t in MANIFEST2_IDENTIFIERS: |
20 |
rval.update(self.fhashdict[t]) |
21 |
return rval |
22 |
- |
23 |
+ |
24 |
def getTypeDigests(self, ftype): |
25 |
""" Similar to getDigests(), but restricted to files of the given type. """ |
26 |
return self.fhashdict[ftype] |
27 |
@@ -394,11 +394,11 @@ class Manifest: |
28 |
def sign(self): |
29 |
""" Sign the Manifest """ |
30 |
raise NotImplementedError() |
31 |
- |
32 |
+ |
33 |
def validateSignature(self): |
34 |
""" Validate signature on Manifest """ |
35 |
raise NotImplementedError() |
36 |
- |
37 |
+ |
38 |
def addFile(self, ftype, fname, hashdict=None, ignoreMissing=False): |
39 |
""" Add entry to Manifest optionally using hashdict to avoid recalculation of hashes """ |
40 |
if ftype == "AUX" and not fname.startswith("files/"): |
41 |
@@ -414,22 +414,22 @@ class Manifest: |
42 |
self.fhashdict[ftype][fname].update(hashdict) |
43 |
if self.required_hashes.difference(set(self.fhashdict[ftype][fname])): |
44 |
self.updateFileHashes(ftype, fname, checkExisting=False, ignoreMissing=ignoreMissing) |
45 |
- |
46 |
+ |
47 |
def removeFile(self, ftype, fname): |
48 |
""" Remove given entry from Manifest """ |
49 |
del self.fhashdict[ftype][fname] |
50 |
- |
51 |
+ |
52 |
def hasFile(self, ftype, fname): |
53 |
""" Return whether the Manifest contains an entry for the given type,filename pair """ |
54 |
return (fname in self.fhashdict[ftype]) |
55 |
- |
56 |
+ |
57 |
def findFile(self, fname): |
58 |
""" Return entrytype of the given file if present in Manifest or None if not present """ |
59 |
for t in MANIFEST2_IDENTIFIERS: |
60 |
if fname in self.fhashdict[t]: |
61 |
return t |
62 |
return None |
63 |
- |
64 |
+ |
65 |
def create(self, checkExisting=False, assumeDistHashesSometimes=False, |
66 |
assumeDistHashesAlways=False, requiredDistfiles=[]): |
67 |
""" Recreate this Manifest from scratch. This will not use any |
68 |
@@ -586,17 +586,17 @@ class Manifest: |
69 |
absname = os.path.join(self.pkgdir, "files", fname) |
70 |
else: |
71 |
absname = os.path.join(self.pkgdir, fname) |
72 |
- return absname |
73 |
- |
74 |
+ return absname |
75 |
+ |
76 |
def checkAllHashes(self, ignoreMissingFiles=False): |
77 |
for t in MANIFEST2_IDENTIFIERS: |
78 |
self.checkTypeHashes(t, ignoreMissingFiles=ignoreMissingFiles) |
79 |
- |
80 |
+ |
81 |
def checkTypeHashes(self, idtype, ignoreMissingFiles=False, hash_filter=None): |
82 |
for f in self.fhashdict[idtype]: |
83 |
self.checkFileHashes(idtype, f, ignoreMissing=ignoreMissingFiles, |
84 |
hash_filter=hash_filter) |
85 |
- |
86 |
+ |
87 |
def checkFileHashes(self, ftype, fname, ignoreMissing=False, hash_filter=None): |
88 |
digests = _filter_unaccelarated_hashes(self.fhashdict[ftype][fname]) |
89 |
if hash_filter is not None: |
90 |
@@ -623,7 +623,7 @@ class Manifest: |
91 |
if checkDistfiles or onlyDistfiles: |
92 |
for f in self._getCpvDistfiles(cpv): |
93 |
self.checkFileHashes("DIST", f, ignoreMissing=False) |
94 |
- |
95 |
+ |
96 |
def _getCpvDistfiles(self, cpv): |
97 |
""" Get a list of all DIST files associated to the given cpv """ |
98 |
return self.fetchlist_dict[cpv] |
99 |
@@ -648,12 +648,12 @@ class Manifest: |
100 |
myhashkeys.remove(k) |
101 |
myhashes = perform_multiple_checksums(self._getAbsname(ftype, fname), myhashkeys) |
102 |
self.fhashdict[ftype][fname].update(myhashes) |
103 |
- |
104 |
+ |
105 |
def updateTypeHashes(self, idtype, checkExisting=False, ignoreMissingFiles=True): |
106 |
""" Regenerate all hashes for all files of the given type """ |
107 |
for fname in self.fhashdict[idtype]: |
108 |
self.updateFileHashes(idtype, fname, checkExisting) |
109 |
- |
110 |
+ |
111 |
def updateAllHashes(self, checkExisting=False, ignoreMissingFiles=True): |
112 |
""" Regenerate all hashes for all files in this Manifest. """ |
113 |
for idtype in MANIFEST2_IDENTIFIERS: |
114 |
-- |
115 |
2.28.0 |