1 |
commit: 6d35053a55470f9e8d5c359215f18d75acbcf043 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 28 06:48:59 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 28 06:48:59 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6d35053a |
7 |
|
8 |
Manifest.write(): tweak unlink logic |
9 |
|
10 |
This narrows the range of possible behaviors, such that the manifest |
11 |
will always be either written or unlinked, eliminating the possiblity |
12 |
that a stale manifest will ever be allowed to slip through without |
13 |
being overwritten or unlinked. |
14 |
|
15 |
--- |
16 |
pym/portage/manifest.py | 8 ++++++-- |
17 |
1 files changed, 6 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py |
20 |
index 7cac09c..49c05bd 100644 |
21 |
--- a/pym/portage/manifest.py |
22 |
+++ b/pym/portage/manifest.py |
23 |
@@ -267,10 +267,14 @@ class Manifest(object): |
24 |
raise |
25 |
|
26 |
if update_manifest: |
27 |
- if myentries: |
28 |
+ if myentries or not (self.thin or self.allow_missing): |
29 |
+ # If myentries is empty, don't write an empty manifest |
30 |
+ # when thin or allow_missing is enabled. Except for |
31 |
+ # thin manifests with no DIST entries, myentries is |
32 |
+ # non-empty for all currently known use cases. |
33 |
write_atomic(self.getFullname(), "".join("%s\n" % |
34 |
str(myentry) for myentry in myentries)) |
35 |
- elif self.thin: |
36 |
+ else: |
37 |
# With thin manifest, there's no need to have |
38 |
# a Manifest file if there are no DIST entries. |
39 |
try: |