summaryrefslogtreecommitdiffstats
path: root/bin/ebuild
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-23 00:44:23 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-23 00:44:23 +0000
commit82290f6d95c42c5b5d76b3256c55b67edccf99e3 (patch)
tree7119387da6230f4baf37fa925a4f3937da3f919c /bin/ebuild
parent4c6962aca5b7ecbaaf8ff6e16fe91326d3e01c03 (diff)
downloadportage-82290f6d95c42c5b5d76b3256c55b67edccf99e3.tar.gz
portage-82290f6d95c42c5b5d76b3256c55b67edccf99e3.tar.bz2
portage-82290f6d95c42c5b5d76b3256c55b67edccf99e3.zip
Make ebuild(1) detect ebuild/eclass changes and automatically source the
ebuild atain in this case (even though $T/environment may already exist). This should help avoid confusion by ensuring that the latest changes to the ebuild/eclasses are reflected in the environment. svn path=/main/trunk/; revision=13148
Diffstat (limited to 'bin/ebuild')
-rwxr-xr-xbin/ebuild13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/ebuild b/bin/ebuild
index a03f0ec6e..bdf6b9503 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -195,13 +195,20 @@ if opts.skip_manifest:
tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
portage._doebuild_manifest_exempt_depend += 1
+# If the current metadata is invalid then force the ebuild to be
+# sourced again even if $T/environment already exists.
+ebuild_changed = False
+metadata, st, emtime = \
+ portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)
+if metadata is None:
+ ebuild_changed = True
+
build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
"test", "install", "package", "rpm"])
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)
@@ -215,6 +222,10 @@ def stale_env_warning():
for x in msg:
portage.writemsg(">>> %s\n" % x)
+ if ebuild_changed:
+ open(os.path.join(tmpsettings['PORTAGE_BUILDDIR'],
+ '.ebuild_changed'), 'w')
+
from portage.exception import PermissionDenied, \
PortagePackageException, UnsupportedAPIException
checked_for_stale_env = False