1 |
Author: grobian |
2 |
Date: 2008-12-05 21:22:55 +0000 (Fri, 05 Dec 2008) |
3 |
New Revision: 12163 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/ebuild.sh |
7 |
main/branches/prefix/bin/isolated-functions.sh |
8 |
main/branches/prefix/bin/misc-functions.sh |
9 |
main/branches/prefix/bin/repoman |
10 |
main/branches/prefix/pym/_emerge/__init__.py |
11 |
Log: |
12 |
Merged from trunk -r12133:12146 |
13 |
|
14 |
| 12134 | Source bashrc files as late as possible, giving them the | |
15 |
| zmedico | opportunity to override as much as possible. Thanks to Ned | |
16 |
| | Ludd <solar@g.o> for the suggestion. | |
17 |
|
18 |
| 12136 | Skip sourcinf of profile.bashrc during the depend phase. | |
19 |
| zmedico | | |
20 |
|
21 |
| 12138 | Fix depgraph._dep_check_composite_db._visible() to reject | |
22 |
| zmedico | installed packages that are masked. This is necessary for | |
23 |
| | correct choices in || deps when we want to ensure that | |
24 |
| | installed masked packages are not preferred over other | |
25 |
| | available choices that are not masked. Thanks to Jan | |
26 |
| | Kundr?\195?\161t <jkt@g.o> for reporting this issue and testing the | |
27 |
| | patch. | |
28 |
|
29 |
| 12140 | When calling `git ls-files -m` to list modified files, use | |
30 |
| zmedico | --with-tree=HEAD so that differences from the most recent | |
31 |
| | commit are given instead of differences from the index which | |
32 |
| | is used for commit staging purposes. This is required since | |
33 |
| | otherwise files that have been added via `git add` (such as | |
34 |
| | echangelog does with the ChangeLog) won't show up in the | |
35 |
| | list of modified files due to being unmodified relative to | |
36 |
| | the index. Thanks to Christian Ruppert (idl0r) for | |
37 |
| | reporting. | |
38 |
|
39 |
| 12142 | It's not safe to use the git commit -a option since there | |
40 |
| zmedico | might be some modified files elsewhere in the working tree | |
41 |
| | that the user doesn't want to commit. Therefore, call git | |
42 |
| | update-index in order to ensure that the index is updated | |
43 |
| | with the latest versions of all new and modified files in | |
44 |
| | the relevant portion of the working tree. | |
45 |
|
46 |
| 12144 | When --keep-going drops packages due to unsatisfied | |
47 |
| zmedico | dependencies, include them in the list of packgaes that | |
48 |
| | "failed to build or install" that's displayed at the end. | |
49 |
|
50 |
| 12146 | Break references between the depgraph and the dropped tasks | |
51 |
| zmedico | inside Scheduler._calc_resume_list(), since the tasks are | |
52 |
| | now saved for display at the end. | |
53 |
|
54 |
|
55 |
Modified: main/branches/prefix/bin/ebuild.sh |
56 |
=================================================================== |
57 |
--- main/branches/prefix/bin/ebuild.sh 2008-12-05 01:13:12 UTC (rev 12162) |
58 |
+++ main/branches/prefix/bin/ebuild.sh 2008-12-05 21:22:55 UTC (rev 12163) |
59 |
@@ -1502,6 +1502,8 @@ |
60 |
esac |
61 |
} |
62 |
|
63 |
+PORTAGE_BASHRCS_SOURCED=0 |
64 |
+ |
65 |
# @FUNCTION: source_all_bashrcs |
66 |
# @DESCRIPTION: |
67 |
# Source a relevant bashrc files and perform other miscellaneous |
68 |
@@ -1514,6 +1516,8 @@ |
69 |
# function for the current phase. |
70 |
# |
71 |
source_all_bashrcs() { |
72 |
+ [[ $PORTAGE_BASHRCS_SOURCED = 1 ]] && return 0 |
73 |
+ PORTAGE_BASHRCS_SOURCED=1 |
74 |
local x |
75 |
|
76 |
if [[ -n $EBUILD_PHASE && -n ${EAPI/prefix/} ]] ; then |
77 |
@@ -1525,15 +1529,18 @@ |
78 |
fi |
79 |
|
80 |
local OCC="${CC}" OCXX="${CXX}" |
81 |
- # source the existing profile.bashrc's. |
82 |
- save_IFS |
83 |
- IFS=$'\n' |
84 |
- local path_array=($PROFILE_PATHS) |
85 |
- restore_IFS |
86 |
- for x in "${path_array[@]}" ; do |
87 |
- [ -f "${x}/profile.bashrc" ] && qa_source "${x}/profile.bashrc" |
88 |
- done |
89 |
|
90 |
+ if [[ $EBUILD_PHASE != depend ]] ; then |
91 |
+ # source the existing profile.bashrcs. |
92 |
+ save_IFS |
93 |
+ IFS=$'\n' |
94 |
+ local path_array=($PROFILE_PATHS) |
95 |
+ restore_IFS |
96 |
+ for x in "${path_array[@]}" ; do |
97 |
+ [ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc" |
98 |
+ done |
99 |
+ fi |
100 |
+ |
101 |
# We assume if people are changing shopts in their bashrc they do so at their |
102 |
# own peril. This is the ONLY non-portage bit of code that can change shopts |
103 |
# without a QA violation. |
104 |
@@ -1853,7 +1860,6 @@ |
105 |
;; |
106 |
esac |
107 |
|
108 |
- source_all_bashrcs |
109 |
fi |
110 |
|
111 |
if ! hasq "$EBUILD_PHASE" clean cleanrm && \ |
112 |
@@ -1902,9 +1908,6 @@ |
113 |
# PREFIX HACK: ignore prefix, and then respect it again |
114 |
[[ -n ${EAPI/prefix/} ]] || EAPI="${EAPI}${EAPI:+ }0" |
115 |
|
116 |
-# enable bashrc support for the clean phase |
117 |
-hasq "$EBUILD_PHASE" clean cleanrm && source_all_bashrcs |
118 |
- |
119 |
# unset USE_EXPAND variables that contain only the special "*" token |
120 |
for x in ${USE_EXPAND} ; do |
121 |
[ "${!x}" == "*" ] && unset ${x} |
122 |
@@ -1932,6 +1935,7 @@ |
123 |
fi |
124 |
|
125 |
ebuild_main() { |
126 |
+ source_all_bashrcs |
127 |
local f x |
128 |
local export_vars="ASFLAGS CCACHE_DIR CCACHE_SIZE |
129 |
CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS" |
130 |
|
131 |
Modified: main/branches/prefix/bin/isolated-functions.sh |
132 |
=================================================================== |
133 |
--- main/branches/prefix/bin/isolated-functions.sh 2008-12-05 01:13:12 UTC (rev 12162) |
134 |
+++ main/branches/prefix/bin/isolated-functions.sh 2008-12-05 21:22:55 UTC (rev 12163) |
135 |
@@ -516,7 +516,8 @@ |
136 |
GOOD HILITE HOME IMAGE \ |
137 |
LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \ |
138 |
NORMAL PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \ |
139 |
- PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC \ |
140 |
+ PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST \ |
141 |
+ PORTAGE_BASHRC PORTAGE_BASHRCS_SOURCED \ |
142 |
PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE PORTAGE_BUILDDIR \ |
143 |
PORTAGE_COLORMAP PORTAGE_CONFIGROOT PORTAGE_DEBUG \ |
144 |
PORTAGE_DEPCACHEDIR PORTAGE_GID PORTAGE_INST_GID \ |
145 |
|
146 |
Modified: main/branches/prefix/bin/misc-functions.sh |
147 |
=================================================================== |
148 |
--- main/branches/prefix/bin/misc-functions.sh 2008-12-05 01:13:12 UTC (rev 12162) |
149 |
+++ main/branches/prefix/bin/misc-functions.sh 2008-12-05 21:22:55 UTC (rev 12163) |
150 |
@@ -820,6 +820,7 @@ |
151 |
} |
152 |
|
153 |
if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then |
154 |
+ source_all_bashrcs |
155 |
[ "$PORTAGE_DEBUG" == "1" ] && set -x |
156 |
for x in ${MISC_FUNCTIONS_ARGS}; do |
157 |
${x} |
158 |
|
159 |
Modified: main/branches/prefix/bin/repoman |
160 |
=================================================================== |
161 |
--- main/branches/prefix/bin/repoman 2008-12-05 01:13:12 UTC (rev 12162) |
162 |
+++ main/branches/prefix/bin/repoman 2008-12-05 21:22:55 UTC (rev 12163) |
163 |
@@ -737,7 +737,7 @@ |
164 |
mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ] |
165 |
mynew = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ] |
166 |
elif vcs == "git": |
167 |
- mychanged = os.popen("git ls-files -m").readlines() |
168 |
+ mychanged = os.popen("git ls-files -m --with-tree=HEAD").readlines() |
169 |
mychanged = [ "./" + elem[:-1] for elem in mychanged ] |
170 |
mynew = os.popen("git diff --cached --name-only --diff-filter=A").readlines() |
171 |
strip_levels = repolevel - 1 |
172 |
@@ -1733,7 +1733,7 @@ |
173 |
for prop in props if " - " in prop) |
174 |
|
175 |
elif vcs == "git": |
176 |
- mychanged = os.popen("git ls-files -m").readlines() |
177 |
+ mychanged = os.popen("git ls-files -m --with-tree=HEAD").readlines() |
178 |
mychanged = [ "./" + elem[:-1] for elem in mychanged ] |
179 |
mynew = os.popen("git diff --cached --name-only --diff-filter=A").readlines() |
180 |
strip_levels = repolevel - 1 |
181 |
@@ -1764,6 +1764,8 @@ |
182 |
mymanifests.add(f) |
183 |
else: |
184 |
myupdates.add(f) |
185 |
+ if vcs == 'git': |
186 |
+ myupdates.difference_update(myremoved) |
187 |
myupdates = list(myupdates) |
188 |
mymanifests = list(mymanifests) |
189 |
myheaders = [] |
190 |
@@ -2058,6 +2060,27 @@ |
191 |
portage.writemsg("!!! Disabled FEATURES='sign'\n") |
192 |
signed = False |
193 |
|
194 |
+ if vcs == 'git': |
195 |
+ # It's not safe to use the git commit -a option since there might |
196 |
+ # be some modified files elsewhere in the working tree that the |
197 |
+ # user doesn't want to commit. Therefore, call git update-index |
198 |
+ # in order to ensure that the index is updated with the latest |
199 |
+ # versions of all new and modified files in the relevant portion |
200 |
+ # of the working tree. |
201 |
+ myfiles = mymanifests + myupdates |
202 |
+ myfiles.sort() |
203 |
+ update_index_cmd = ["git", "update-index"] |
204 |
+ update_index_cmd.extend(f.lstrip("./") for f in myfiles) |
205 |
+ if options.pretend: |
206 |
+ print "(%s)" % (" ".join(update_index_cmd),) |
207 |
+ else: |
208 |
+ retval = spawn(update_index_cmd, env=os.environ) |
209 |
+ if retval != os.EX_OK: |
210 |
+ writemsg_level(("!!! Exiting on %s (shell) " + \ |
211 |
+ "error code: %s\n") % (vcs, retval), |
212 |
+ level=logging.ERROR, noiselevel=-1) |
213 |
+ sys.exit(retval) |
214 |
+ |
215 |
if vcs == 'git' or manifest_commit_required or signed: |
216 |
|
217 |
myfiles = mymanifests[:] |
218 |
|
219 |
Modified: main/branches/prefix/pym/_emerge/__init__.py |
220 |
=================================================================== |
221 |
--- main/branches/prefix/pym/_emerge/__init__.py 2008-12-05 01:13:12 UTC (rev 12162) |
222 |
+++ main/branches/prefix/pym/_emerge/__init__.py 2008-12-05 21:22:55 UTC (rev 12163) |
223 |
@@ -8253,13 +8253,13 @@ |
224 |
arg = None |
225 |
if arg: |
226 |
return False |
227 |
- if pkg.installed: |
228 |
- try: |
229 |
- if not visible( |
230 |
- self._depgraph.pkgsettings[pkg.root], pkg): |
231 |
- return False |
232 |
- except portage.exception.InvalidDependString: |
233 |
- pass |
234 |
+ if pkg.installed: |
235 |
+ try: |
236 |
+ if not visible( |
237 |
+ self._depgraph.pkgsettings[pkg.root], pkg): |
238 |
+ return False |
239 |
+ except portage.exception.InvalidDependString: |
240 |
+ pass |
241 |
return True |
242 |
|
243 |
def _dep_expand(self, atom): |
244 |
@@ -10488,6 +10488,7 @@ |
245 |
|
246 |
mylist = mydepgraph.altlist() |
247 |
mydepgraph.break_refs(mylist) |
248 |
+ mydepgraph.break_refs(dropped_tasks) |
249 |
self._mergelist = mylist |
250 |
self._set_digraph(mydepgraph.schedulerGraph()) |
251 |
|
252 |
@@ -10509,6 +10510,7 @@ |
253 |
# not valid here. |
254 |
settings.pop("T", None) |
255 |
portage.elog.elog_process(pkg.cpv, settings) |
256 |
+ self._failed_pkgs_all.append(self._failed_pkg(pkg=pkg)) |
257 |
|
258 |
return True |