summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-09-27 06:52:05 +0000
committerZac Medico <zmedico@gentoo.org>2007-09-27 06:52:05 +0000
commitd26cfcec8ecf33f86b2d1952bdf897be125b1666 (patch)
treea921661a1b93aec347b58bf67dfcd84d17106e74 /bin
parentd15521239665a8d78c37664175b9eacd7d5bcf42 (diff)
downloadportage-d26cfcec8ecf33f86b2d1952bdf897be125b1666.tar.gz
portage-d26cfcec8ecf33f86b2d1952bdf897be125b1666.tar.bz2
portage-d26cfcec8ecf33f86b2d1952bdf897be125b1666.zip
Display a short notification when an existing ${T}/environment
sourced since it is easy to ignore and ignorance of it often leads to mysterious problems and general confusion. This message should not show in cases where it is obviously irrelevant, FEATURES=noauto, or PORTAGE_QUIET=1. (trunk r7844) svn path=/main/branches/2.1.2/; revision=7845
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/ebuild b/bin/ebuild
index 8afba3afe..5761a0d19 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -139,6 +139,25 @@ if "test" in pargs and "test" not in tmpsettings.features:
tmpsettings["FEATURES"] = " ".join(tmpsettings.features)
tmpsettings.backup_changes("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)
+
for arg in pargs:
try:
if arg == "digest" and force: