1 |
Author: zmedico |
2 |
Date: 2009-03-23 02:22:06 +0000 (Mon, 23 Mar 2009) |
3 |
New Revision: 13165 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/bin/ebuild |
7 |
main/branches/2.1.6/bin/ebuild.sh |
8 |
Log: |
9 |
Make ebuild(1) detect ebuild/eclass changes and automatically source the |
10 |
ebuild atain in this case (even though $T/environment may already exist). |
11 |
This should help avoid confusion by ensuring that the latest changes to |
12 |
the ebuild/eclasses are reflected in the environment. (trunk r13148) |
13 |
|
14 |
Modified: main/branches/2.1.6/bin/ebuild |
15 |
=================================================================== |
16 |
--- main/branches/2.1.6/bin/ebuild 2009-03-23 02:21:42 UTC (rev 13164) |
17 |
+++ main/branches/2.1.6/bin/ebuild 2009-03-23 02:22:06 UTC (rev 13165) |
18 |
@@ -195,13 +195,20 @@ |
19 |
tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST") |
20 |
portage._doebuild_manifest_exempt_depend += 1 |
21 |
|
22 |
+# If the current metadata is invalid then force the ebuild to be |
23 |
+# sourced again even if $T/environment already exists. |
24 |
+ebuild_changed = False |
25 |
+metadata, st, emtime = \ |
26 |
+ portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir) |
27 |
+if metadata is None: |
28 |
+ ebuild_changed = True |
29 |
+ |
30 |
build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile", |
31 |
"test", "install", "package", "rpm"]) |
32 |
|
33 |
def stale_env_warning(): |
34 |
if "clean" not in pargs and \ |
35 |
"noauto" not in tmpsettings.features and \ |
36 |
- tmpsettings.get("PORTAGE_QUIET") != "1" and \ |
37 |
build_dir_phases.intersection(pargs): |
38 |
portage.doebuild_environment(ebuild, "setup", portage.root, |
39 |
tmpsettings, debug, 1, portage.portdb) |
40 |
@@ -215,6 +222,10 @@ |
41 |
for x in msg: |
42 |
portage.writemsg(">>> %s\n" % x) |
43 |
|
44 |
+ if ebuild_changed: |
45 |
+ open(os.path.join(tmpsettings['PORTAGE_BUILDDIR'], |
46 |
+ '.ebuild_changed'), 'w') |
47 |
+ |
48 |
from portage.exception import PermissionDenied, \ |
49 |
PortagePackageException, UnsupportedAPIException |
50 |
checked_for_stale_env = False |
51 |
|
52 |
Modified: main/branches/2.1.6/bin/ebuild.sh |
53 |
=================================================================== |
54 |
--- main/branches/2.1.6/bin/ebuild.sh 2009-03-23 02:21:42 UTC (rev 13164) |
55 |
+++ main/branches/2.1.6/bin/ebuild.sh 2009-03-23 02:22:06 UTC (rev 13165) |
56 |
@@ -714,7 +714,7 @@ |
57 |
fi |
58 |
|
59 |
if [[ $EMERGE_FROM = binary ]] || ! hasq keepwork $FEATURES; then |
60 |
- rm -f "$PORTAGE_BUILDDIR"/.{exit_status,logid,unpacked,prepared} \ |
61 |
+ rm -f "$PORTAGE_BUILDDIR"/.{ebuild_changed,exit_status,logid,unpacked,prepared} \ |
62 |
"$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} |
63 |
|
64 |
rm -rf "${PORTAGE_BUILDDIR}/build-info" |
65 |
@@ -1865,7 +1865,7 @@ |
66 |
if ! hasq "$EBUILD_PHASE" clean cleanrm && \ |
67 |
( |
68 |
hasq ${EBUILD_PHASE} depend || \ |
69 |
- [ ! -f "${T}"/environment ] || \ |
70 |
+ [[ ! -f $T/environment || -f $PORTAGE_BUILDDIR/.ebuild_changed ]] || \ |
71 |
hasq noauto ${FEATURES} |
72 |
) ; then |
73 |
# The bashrcs get an opportunity here to set aliases that will be expanded |
74 |
@@ -1881,6 +1881,8 @@ |
75 |
|
76 |
if [ "${EBUILD_PHASE}" != "depend" ] ; then |
77 |
RESTRICT=${PORTAGE_RESTRICT} |
78 |
+ [[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \ |
79 |
+ rm "$PORTAGE_BUILDDIR/.ebuild_changed" |
80 |
fi |
81 |
|
82 |
# This next line is not the same as export RDEPEND=${RDEPEND:-${DEPEND}} |