Do the stale env check/warning after the digest/manifest
authorZac Medico <zmedico@gentoo.org>
Thu, 27 Sep 2007 15:35:29 +0000 (15:35 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 27 Sep 2007 15:35:29 +0000 (15:35 -0000)
phase when necessary. (trunk r7846)

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

bin/ebuild

index 5761a0d19c1daee867290f4ca2b0221ef2d5ce85..2a03e196a3c63e4de6fdeb1c506ba0db0ff80ea7 100755 (executable)
@@ -142,23 +142,31 @@ if "test" in pargs and "test" not in tmpsettings.features:
 build_dir_phases = set(["setup", "unpack", "compile",
        "test", "install", "package", "rpm"])
 
-if "clean" not in pargs and \
-       "noauto" not in tmpsettings.features and \
-       tmpsettings.get("PORTAGE_QUIET") != "1" and \
-       build_dir_phases.intersection(pargs):
-       portage.doebuild_environment(ebuild, "setup", portage.root,
-               tmpsettings, debug, 1, portage.portdb)
-       env_filename = os.path.join(tmpsettings["T"], "environment")
-       if os.path.exists(env_filename):
-               msg = ("Existing ${T}/environment for '%s' will be sourced. " + \
-                       "Run 'clean' to start with a fresh environment.") % \
-                       (tmpsettings["PF"], )
-               from textwrap import wrap
-               msg = wrap(msg, 70)
-               for x in msg:
-                       portage.writemsg(">>> %s\n" % x)
+def stale_env_warning():
+       if "clean" not in pargs and \
+               "noauto" not in tmpsettings.features and \
+               tmpsettings.get("PORTAGE_QUIET") != "1" and \
+               build_dir_phases.intersection(pargs):
+               portage.doebuild_environment(ebuild, "setup", portage.root,
+                       tmpsettings, debug, 1, portage.portdb)
+               env_filename = os.path.join(tmpsettings["T"], "environment")
+               if os.path.exists(env_filename):
+                       msg = ("Existing ${T}/environment for '%s' will be sourced. " + \
+                               "Run 'clean' to start with a fresh environment.") % \
+                               (tmpsettings["PF"], )
+                       from textwrap import wrap
+                       msg = wrap(msg, 70)
+                       for x in msg:
+                               portage.writemsg(">>> %s\n" % x)
+
+checked_for_stale_env = False
 
 for arg in pargs:
+       if not checked_for_stale_env and arg not in ("digest","manifest"):
+               # This has to go after manifest generation since otherwise
+               # aux_get() might fail due to invalid ebuild digests.
+               stale_env_warning()
+               checked_for_stale_env = True
        try:
                if arg == "digest" and force:
                        discard_digests(ebuild, tmpsettings, portage.portdb)