Verify all ebuild manifests before building anything now so that the user is notified...
authorZac Medico <zmedico@gentoo.org>
Sat, 24 Mar 2007 22:45:14 +0000 (22:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 24 Mar 2007 22:45:14 +0000 (22:45 -0000)
svn path=/main/branches/2.1.2/; revision=6278

bin/emerge

index 794d785d95fc927eae996c9aac66985d2f9d095b..0671251c36d622263199d49ccdadbd5638d41009 100755 (executable)
@@ -2905,6 +2905,35 @@ class MergeTask(object):
                                                show_blocker_docs_link()
                                        return 1
 
+               # Verify all the manifests now so that the user is notified of failure
+               # as soon as possible.
+               if "--fetchonly" not in self.myopts and \
+                       "--fetch-all-uri" not in self.myopts and \
+                       len(mylist) > 1 and \
+                       "strict" in self.settings.features:
+                       shown_verifying_msg = False
+                       quiet_settings = {}
+                       for myroot, pkgsettings in self.pkgsettings.iteritems():
+                               quiet_config = portage.config(clone=pkgsettings)
+                               quiet_config["PORTAGE_QUIET"] = "1"
+                               quiet_config.backup_changes("PORTAGE_QUIET")
+                               quiet_settings[myroot] = quiet_config
+                               del quiet_config
+                       for x in mylist:
+                               if x[0] != "ebuild" or x[-1] == "nomerge":
+                                       continue
+                               if not shown_verifying_msg:
+                                       shown_verifying_msg = True
+                                       print ">>> Verifying ebuild Manifests..."
+                               mytype, myroot, mycpv, mystatus = x
+                               portdb = self.trees[myroot]["porttree"].dbapi
+                               quiet_config = quiet_settings[myroot]
+                               quiet_config["O"] = os.path.dirname(portdb.findname(mycpv))
+                               if not portage.digestcheck([], quiet_config, strict=True):
+                                       return 1
+                               del x, mytype, myroot, mycpv, mystatus, quiet_config
+                       del shown_verifying_msg, quiet_settings
+
                #buildsyspkg: I need mysysdict also on resume (moved from the else block)
                mysysdict = genericdict(getlist(self.settings, "system"))
                if "--resume" in self.myopts: