diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-09-27 23:48:59 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-09-27 23:48:59 -0700 |
commit | 6d35053a55470f9e8d5c359215f18d75acbcf043 (patch) | |
tree | d1a7c1253d2b82a305819083b132497df2aaea34 | |
parent | f3101b3adce6731790f80f83fafece54b7bd8a63 (diff) | |
download | portage-6d35053a55470f9e8d5c359215f18d75acbcf043.tar.gz portage-6d35053a55470f9e8d5c359215f18d75acbcf043.tar.bz2 portage-6d35053a55470f9e8d5c359215f18d75acbcf043.zip |
Manifest.write(): tweak unlink logic
This narrows the range of possible behaviors, such that the manifest
will always be either written or unlinked, eliminating the possiblity
that a stale manifest will ever be allowed to slip through without
being overwritten or unlinked.
-rw-r--r-- | pym/portage/manifest.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 7cac09cde..49c05bd48 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -267,10 +267,14 @@ class Manifest(object): raise if update_manifest: - if myentries: + if myentries or not (self.thin or self.allow_missing): + # If myentries is empty, don't write an empty manifest + # when thin or allow_missing is enabled. Except for + # thin manifests with no DIST entries, myentries is + # non-empty for all currently known use cases. write_atomic(self.getFullname(), "".join("%s\n" % str(myentry) for myentry in myentries)) - elif self.thin: + else: # With thin manifest, there's no need to have # a Manifest file if there are no DIST entries. try: |