diff options
author | Brian Harring <ferringb@chromium.org> | 2011-09-23 16:43:28 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-09-27 23:31:54 -0700 |
commit | f3101b3adce6731790f80f83fafece54b7bd8a63 (patch) | |
tree | 4bc1d857c88c74386628eed2e84be48c2d3586b3 /pym/portage/manifest.py | |
parent | depgraph: handle unicode exception for bug 384749 (diff) | |
download | portage-f3101b3adce6731790f80f83fafece54b7bd8a63.tar.gz portage-f3101b3adce6731790f80f83fafece54b7bd8a63.tar.bz2 portage-f3101b3adce6731790f80f83fafece54b7bd8a63.zip |
manifest: controllable per repo
This adds three states to layout.conf key use-manifest; false, true, and strict.
false means "don't use manifests at all"
true means "use and generate manifests, but allow them to be missing"
strict means "manifests must be used everywhere in this repo"
BUG=chromium-os:11308
TEST=repoman manifest usage.
Diffstat (limited to 'pym/portage/manifest.py')
-rw-r--r-- | pym/portage/manifest.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 449f9fdf4..7cac09cde 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -100,7 +100,8 @@ class Manifest2Entry(ManifestEntry): class Manifest(object): parsers = (parseManifest2,) def __init__(self, pkgdir, distdir, fetchlist_dict=None, - manifest1_compat=DeprecationWarning, from_scratch=False, thin=False): + manifest1_compat=DeprecationWarning, from_scratch=False, thin=False, + allow_missing=False, allow_create=True): """ Create new Manifest instance for package in pkgdir. Do not parse Manifest file if from_scratch == True (only for internal use) The fetchlist_dict parameter is required only for generation of @@ -135,6 +136,8 @@ class Manifest(object): self.guessType = guessThinManifestFileType else: self.guessType = guessManifestFileType + self.allow_missing = allow_missing + self.allow_create = allow_create def getFullname(self): """ Returns the absolute path to the Manifest file for this instance """ @@ -237,6 +240,8 @@ class Manifest(object): def write(self, sign=False, force=False): """ Write Manifest instance to disk, optionally signing it """ + if not self.allow_create: + return self.checkIntegrity() try: myentries = list(self._createManifestEntries()) @@ -265,7 +270,7 @@ class Manifest(object): if myentries: write_atomic(self.getFullname(), "".join("%s\n" % str(myentry) for myentry in myentries)) - else: + elif self.thin: # With thin manifest, there's no need to have # a Manifest file if there are no DIST entries. try: @@ -330,6 +335,8 @@ class Manifest(object): distfiles to raise a FileNotFound exception for (if no file or existing checksums are available), and defaults to all distfiles when not specified.""" + if not self.allow_create: + return if checkExisting: self.checkAllHashes() if assumeDistHashesSometimes or assumeDistHashesAlways: |