digestcheck: support allow-missing-manifests
authorZac Medico <zmedico@gentoo.org>
Thu, 7 Jul 2011 04:35:45 +0000 (21:35 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 7 Jul 2011 04:35:45 +0000 (21:35 -0700)
Also, update the man page.

man/make.conf.5
pym/portage/package/ebuild/digestcheck.py

index 92a29d7c8afe156a1bf20f84b3debe69837c68e5..5206f2e88a2fb563e42441d06ce90d6ca5ca2523 100644 (file)
@@ -198,6 +198,10 @@ non-developers as well. The \fBsandbox\fR feature is very important and
 should not be disabled by default.
 .RS
 .TP
+.B allow\-missing\-manifests
+Allow missing manifest entries. This primarily useful for temporary
+trees or instances where manifests aren't used.
+.TP
 .B assume\-digests
 When commiting work to cvs with \fBrepoman\fR(1), assume that all existing 
 SRC_URI digests are correct.  This feature also affects digest generation via
index 68ce1f5657ae80bcf51d2b0693c5c1b798a6ef76..e4432f186f365359b44790bb4817cd16444530e1 100644 (file)
@@ -28,6 +28,7 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None):
 
        if mysettings.get("EBUILD_SKIP_MANIFEST") == "1":
                return 1
+       allow_missing = "allow-missing-manifests" in mysettings.features
        pkgdir = mysettings["O"]
        manifest_path = os.path.join(pkgdir, "Manifest")
        if not os.path.exists(manifest_path):
@@ -86,6 +87,10 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None):
                writemsg(_("!!! Got: %s\n") % e.value[2], noiselevel=-1)
                writemsg(_("!!! Expected: %s\n") % e.value[3], noiselevel=-1)
                return 0
+       if allow_missing:
+               # In this case we ignore any missing digests that
+               # would otherwise be detected below.
+               return 1
        # Make sure that all of the ebuilds are actually listed in the Manifest.
        for f in os.listdir(pkgdir):
                pf = None
@@ -96,8 +101,8 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None):
                                os.path.join(pkgdir, f), noiselevel=-1)
                        if strict:
                                return 0
-       """ epatch will just grab all the patches out of a directory, so we have to
-       make sure there aren't any foreign files that it might grab."""
+       # epatch will just grab all the patches out of a directory, so we have to
+       # make sure there aren't any foreign files that it might grab.
        filesdir = os.path.join(pkgdir, "files")
 
        for parent, dirs, files in os.walk(filesdir):