Bug #225285 - Allow digestcheck() to succeed when the Manifest is empty and
authorZac Medico <zmedico@gentoo.org>
Tue, 10 Jun 2008 04:17:52 +0000 (04:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 10 Jun 2008 04:17:52 +0000 (04:17 -0000)
strict mode is disabled. (trunk r10636)

svn path=/main/branches/2.1.2/; revision=10637

pym/portage.py

index 3d65c13417f9f39b129542e3235c7971541d8268..932d6957eefcf3d2e0c4beba8fd0ab85a6763c11 100644 (file)
@@ -4062,6 +4062,18 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0):
                else:
                        return 1
        mf = Manifest(pkgdir, mysettings["DISTDIR"])
+       manifest_empty = True
+       for d in mf.fhashdict.itervalues():
+               if d:
+                       manifest_empty = False
+                       break
+       if manifest_empty:
+               writemsg("!!! Manifest is empty: '%s'\n" % manifest_path,
+                       noiselevel=-1)
+               if strict:
+                       return 0
+               else:
+                       return 1
        eout = output.EOutput()
        eout.quiet = mysettings.get("PORTAGE_QUIET", None) == "1"
        try: