1 |
commit: 6a851bcab5cab34dba3a1d89ce603480989e02a1 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 2 17:38:24 2011 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 2 17:38:24 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6a851bca |
7 |
|
8 |
Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix |
9 |
|
10 |
Conflicts: |
11 |
bin/misc-functions.sh |
12 |
pym/portage/package/ebuild/doebuild.py |
13 |
runtests.sh |
14 |
|
15 |
|
16 |
bin/ebuild.sh | 35 ++ |
17 |
bin/isolated-functions.sh | 4 +- |
18 |
bin/misc-functions.sh | 86 ++-- |
19 |
bin/repoman | 48 +-- |
20 |
man/emerge.1 | 29 ++- |
21 |
man/portage.5 | 20 +- |
22 |
man/repoman.1 | 12 +- |
23 |
pym/_emerge/DepPriority.py | 10 +- |
24 |
pym/_emerge/DepPriorityNormalRange.py | 4 +- |
25 |
pym/_emerge/DepPrioritySatisfiedRange.py | 3 +- |
26 |
pym/_emerge/Dependency.py | 9 +- |
27 |
pym/_emerge/EbuildPhase.py | 7 +- |
28 |
pym/_emerge/Package.py | 3 +- |
29 |
pym/_emerge/Scheduler.py | 65 --- |
30 |
pym/_emerge/UnmergeDepPriority.py | 6 +- |
31 |
pym/_emerge/actions.py | 145 +++++-- |
32 |
pym/_emerge/create_depgraph_params.py | 6 +- |
33 |
pym/_emerge/depgraph.py | 482 ++++++++++++++++++---- |
34 |
pym/_emerge/emergelog.py | 10 +- |
35 |
pym/_emerge/help.py | 44 ++- |
36 |
pym/_emerge/main.py | 117 +++++- |
37 |
pym/_emerge/resolver/backtracking.py | 15 +- |
38 |
pym/portage/dbapi/bintree.py | 8 +- |
39 |
pym/portage/package/ebuild/doebuild.py | 35 +- |
40 |
pym/portage/tests/resolver/ResolverPlayground.py | 4 +- |
41 |
pym/portage/tests/resolver/test_autounmask.py | 33 ++- |
42 |
pym/portage/tests/resolver/test_rebuild.py | 69 +++ |
43 |
runtests.sh | 4 +- |
44 |
28 files changed, 978 insertions(+), 335 deletions(-) |
45 |
|
46 |
diff --cc bin/misc-functions.sh |
47 |
index 3bf5060,b28b73f..dce730a |
48 |
mode 100644,100755..100644 |
49 |
--- a/bin/misc-functions.sh |
50 |
+++ b/bin/misc-functions.sh |
51 |
@@@ -1249,220 -741,6 +1267,204 @@@ install_mask() |
52 |
set -${shopts} |
53 |
} |
54 |
|
55 |
- preinst_bsdflags() { |
56 |
- hasq chflags $FEATURES || return |
57 |
- # Save all the file flags for restoration after installation. |
58 |
- mtree -c -p "${D}" -k flags > "${T}/bsdflags.mtree" |
59 |
- # Remove all the file flags so that the merge phase can do anything |
60 |
- # necessary. |
61 |
- chflags -R noschg,nouchg,nosappnd,nouappnd "${D}" |
62 |
- chflags -R nosunlnk,nouunlnk "${D}" 2>/dev/null |
63 |
- } |
64 |
- |
65 |
- postinst_bsdflags() { |
66 |
- hasq chflags $FEATURES || return |
67 |
- # Restore all the file flags that were saved before installation. |
68 |
- mtree -e -p "${ROOT}" -U -k flags < "${T}/bsdflags.mtree" &> /dev/null |
69 |
- } |
70 |
- |
71 |
+preinst_aix() { |
72 |
+ if [[ ${CHOST} != *-aix* ]] || hasq binchecks ${RESTRICT}; then |
73 |
+ return 0 |
74 |
+ fi |
75 |
+ local ar strip |
76 |
+ if type ${CHOST}-ar >/dev/null 2>&1 && type ${CHOST}-strip >/dev/null 2>&1; then |
77 |
+ ar=${CHOST}-ar |
78 |
+ strip=${CHOST}-strip |
79 |
+ elif [[ ${CBUILD} == "${CHOST}" ]] && type ar >/dev/null 2>&1 && type strip >/dev/null 2>&1; then |
80 |
+ ar=ar |
81 |
+ strip=strip |
82 |
+ elif [[ -x /usr/ccs/bin/ar && -x /usr/ccs/bin/strip ]]; then |
83 |
+ ar=/usr/ccs/bin/ar |
84 |
+ strip=/usr/ccs/bin/strip |
85 |
+ else |
86 |
+ die "cannot find where to use 'ar' and 'strip' from" |
87 |
+ fi |
88 |
+ local archives_members= archives=() chmod400files=() |
89 |
+ local archive_member soname runpath needed archive contentmember |
90 |
+ while read archive_member; do |
91 |
+ archive_member=${archive_member#*;${EPREFIX}/} # drop "^type;EPREFIX/" |
92 |
+ soname=${archive_member#*;} |
93 |
+ runpath=${soname#*;} |
94 |
+ needed=${runpath#*;} |
95 |
+ soname=${soname%%;*} |
96 |
+ runpath=${runpath%%;*} |
97 |
+ archive_member=${archive_member%%;*} # drop ";soname;runpath;needed$" |
98 |
+ archive=${archive_member%[*} |
99 |
+ if [[ ${archive_member} != *'['*']' ]]; then |
100 |
+ if [[ "${soname};${runpath};${needed}" == "${archive##*/};;" && -e ${EROOT}${archive} ]]; then |
101 |
+ # most likely is an archive stub that already exists, |
102 |
+ # may have to preserve members being a shared object. |
103 |
+ archives[${#archives[@]}]=${archive} |
104 |
+ fi |
105 |
+ continue |
106 |
+ fi |
107 |
+ archives_members="${archives_members}:(${archive_member}):" |
108 |
+ contentmember="${archive%/*}/.${archive##*/}${archive_member#${archive}}" |
109 |
+ # portage does os.lstat() on merged files every now |
110 |
+ # and then, so keep stamp-files for archive members |
111 |
+ # around to get the preserve-libs feature working. |
112 |
+ { echo "Please leave this file alone, it is an important helper" |
113 |
+ echo "for portage to implement the 'preserve-libs' feature on AIX." |
114 |
+ } > "${ED}${contentmember}" || die "cannot create ${contentmember}" |
115 |
+ chmod400files[${#chmod400files[@]}]=${ED}${contentmember} |
116 |
+ done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1 |
117 |
+ [[ ${#chmod400files[@]} == 0 ]] || |
118 |
+ chmod 0400 "${chmod400files[@]}" || die "cannot chmod ${chmod400files[@]}" |
119 |
+ |
120 |
+ local preservemembers libmetadir prunedirs=() |
121 |
+ local FILE MEMBER FLAGS |
122 |
+ for archive in "${archives[@]}"; do |
123 |
+ preservemembers= |
124 |
+ while read line; do |
125 |
+ [[ -n ${line} ]] || continue |
126 |
+ FILE= MEMBER= FLAGS= |
127 |
+ eval ${line} |
128 |
+ [[ ${FILE} == ${EROOT}${archive} ]] || |
129 |
+ die "invalid result of aixdll-query for ${EROOT}${archive}" |
130 |
+ [[ -n ${MEMBER} && " ${FLAGS} " == *" SHROBJ "* ]] || continue |
131 |
+ [[ ${archives_members} == *":(${archive}[${MEMBER}]):"* ]] && continue |
132 |
+ preservemembers="${preservemembers} ${MEMBER}" |
133 |
+ done <<-EOF |
134 |
+ $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS) |
135 |
+ EOF |
136 |
+ [[ -n ${preservemembers} ]] || continue |
137 |
+ einfo "preserving (on spec) ${archive}[${preservemembers# }]" |
138 |
+ libmetadir=${ED}${archive%/*}/.${archive##*/} |
139 |
+ mkdir "${libmetadir}" || die "cannot create ${libmetadir}" |
140 |
+ pushd "${libmetadir}" >/dev/null || die "cannot cd to ${libmetadir}" |
141 |
+ ${ar} -X32_64 -x "${EROOT}${archive}" ${preservemembers} || die "cannot unpack ${EROOT}${archive}" |
142 |
+ chmod u+w ${preservemembers} || die "cannot chmod${preservemembers}" |
143 |
+ ${strip} -X32_64 -e ${preservemembers} || die "cannot strip${preservemembers}" |
144 |
+ ${ar} -X32_64 -q "${ED}${archive}" ${preservemembers} || die "cannot update ${archive}" |
145 |
+ eend $? |
146 |
+ popd >/dev/null || die "cannot leave ${libmetadir}" |
147 |
+ prunedirs[${#prunedirs[@]}]=${libmetadir} |
148 |
+ done |
149 |
+ [[ ${#prunedirs[@]} == 0 ]] || |
150 |
+ rm -rf "${prunedirs[@]}" || die "cannot prune ${prunedirs[@]}" |
151 |
+ return 0 |
152 |
+} |
153 |
+ |
154 |
+postinst_aix() { |
155 |
+ if [[ ${CHOST} != *-aix* ]] || hasq binchecks ${RESTRICT}; then |
156 |
+ return 0 |
157 |
+ fi |
158 |
+ local MY_PR=${PR%r0} |
159 |
+ local ar strip |
160 |
+ if type ${CHOST}-ar >/dev/null 2>&1 && type ${CHOST}-strip >/dev/null 2>&1; then |
161 |
+ ar=${CHOST}-ar |
162 |
+ strip=${CHOST}-strip |
163 |
+ elif [[ ${CBUILD} == "${CHOST}" ]] && type ar >/dev/null 2>&1 && type strip >/dev/null 2>&1; then |
164 |
+ ar=ar |
165 |
+ strip=strip |
166 |
+ elif [[ -x /usr/ccs/bin/ar && -x /usr/ccs/bin/strip ]]; then |
167 |
+ ar=/usr/ccs/bin/ar |
168 |
+ strip=/usr/ccs/bin/strip |
169 |
+ else |
170 |
+ die "cannot find where to use 'ar' and 'strip' from" |
171 |
+ fi |
172 |
+ local archives_members= archives=() activearchives= |
173 |
+ local archive_member soname runpath needed |
174 |
+ while read archive_member; do |
175 |
+ archive_member=${archive_member#*;${EPREFIX}/} # drop "^type;EPREFIX/" |
176 |
+ soname=${archive_member#*;} |
177 |
+ runpath=${soname#*;} |
178 |
+ needed=${runpath#*;} |
179 |
+ soname=${soname%%;*} |
180 |
+ runpath=${runpath%%;*} |
181 |
+ archive_member=${archive_member%%;*} # drop ";soname;runpath;needed$" |
182 |
+ [[ ${archive_member} == *'['*']' ]] && continue |
183 |
+ [[ "${soname};${runpath};${needed}" == "${archive_member##*/};;" ]] || continue |
184 |
+ # most likely is an archive stub, we might have to |
185 |
+ # drop members being preserved shared objects. |
186 |
+ archives[${#archives[@]}]=${archive_member} |
187 |
+ activearchives="${activearchives}:(${archive_member}):" |
188 |
+ done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1 |
189 |
+ |
190 |
+ local type allcontentmembers= oldarchives=() |
191 |
+ local contentmember |
192 |
+ while read type contentmember; do |
193 |
+ [[ ${type} == 'obj' ]] || continue |
194 |
+ contentmember=${contentmember% *} # drop " timestamp$" |
195 |
+ contentmember=${contentmember% *} # drop " hash$" |
196 |
+ [[ ${contentmember##*/} == *'['*']' ]] || continue |
197 |
+ contentmember=${contentmember#${EPREFIX}/} |
198 |
+ allcontentmembers="${allcontentmembers}:(${contentmember}):" |
199 |
+ contentmember=${contentmember%[*} |
200 |
+ contentmember=${contentmember%/.*}/${contentmember##*/.} |
201 |
+ [[ ${activearchives} == *":(${contentmember}):"* ]] && continue |
202 |
+ oldarchives[${#oldarchives[@]}]=${contentmember} |
203 |
+ done < "${EPREFIX}/var/db/pkg/${CATEGORY}/${P}${MY_PR:+-}${MY_PR}/CONTENTS" |
204 |
+ |
205 |
+ local archive line delmembers |
206 |
+ local FILE MEMBER FLAGS |
207 |
+ for archive in "${archives[@]}"; do |
208 |
+ [[ -r ${EROOT}${archive} && -w ${EROOT}${archive} ]] || |
209 |
+ chmod a+r,u+w "${EROOT}${archive}" || die "cannot chmod ${EROOT}${archive}" |
210 |
+ delmembers= |
211 |
+ while read line; do |
212 |
+ [[ -n ${line} ]] || continue |
213 |
+ FILE= MEMBER= FLAGS= |
214 |
+ eval ${line} |
215 |
+ [[ ${FILE} == "${EROOT}${archive}" ]] || |
216 |
+ die "invalid result '${FILE}' of aixdll-query, expected '${EROOT}${archive}'" |
217 |
+ [[ -n ${MEMBER} && " ${FLAGS} " == *" SHROBJ "* ]] || continue |
218 |
+ [[ ${allcontentmembers} == *":(${archive%/*}/.${archive##*/}[${MEMBER}]):"* ]] && continue |
219 |
+ delmembers="${delmembers} ${MEMBER}" |
220 |
+ done <<-EOF |
221 |
+ $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS) |
222 |
+ EOF |
223 |
+ [[ -n ${delmembers} ]] || continue |
224 |
+ einfo "dropping ${archive}[${delmembers# }]" |
225 |
+ rm -f "${EROOT}${archive}".new || die "cannot prune ${EROOT}${archive}.new" |
226 |
+ cp "${EROOT}${archive}" "${EROOT}${archive}".new || die "cannot backup ${archive}" |
227 |
+ ${ar} -X32_64 -z -o -d "${EROOT}${archive}".new ${delmembers} || die "cannot remove${delmembers} from ${archive}.new" |
228 |
+ mv -f "${EROOT}${archive}".new "${EROOT}${archive}" || die "cannot put ${EROOT}${archive} in place" |
229 |
+ eend $? |
230 |
+ done |
231 |
+ local libmetadir keepmembers prunedirs=() |
232 |
+ for archive in "${oldarchives[@]}"; do |
233 |
+ [[ -r ${EROOT}${archive} && -w ${EROOT}${archive} ]] || |
234 |
+ chmod a+r,u+w "${EROOT}${archive}" || die "cannot chmod ${EROOT}${archive}" |
235 |
+ keepmembers= |
236 |
+ while read line; do |
237 |
+ FILE= MEMBER= FLAGS= |
238 |
+ eval ${line} |
239 |
+ [[ ${FILE} == "${EROOT}${archive}" ]] || |
240 |
+ die "invalid result of aixdll-query for ${EROOT}${archive}" |
241 |
+ [[ -n ${MEMBER} && " ${FLAGS} " == *" SHROBJ "* ]] || continue |
242 |
+ [[ ${allcontentmembers} == *":(${archive%/*}/.${archive##*/}[${MEMBER}]):"* ]] || continue |
243 |
+ keepmembers="${keepmembers} ${MEMBER}" |
244 |
+ done <<-EOF |
245 |
+ $(aixdll-query "${EROOT}${archive}" FILE MEMBER FLAGS) |
246 |
+ EOF |
247 |
+ |
248 |
+ if [[ -n ${keepmembers} ]]; then |
249 |
+ einfo "preserving (extra)${keepmembers}" |
250 |
+ libmetadir=${EROOT}${archive%/*}/.${archive##*/} |
251 |
+ [[ ! -e ${libmetadir} ]] || rm -rf "${libmetadir}" || die "cannot prune ${libmetadir}" |
252 |
+ mkdir "${libmetadir}" || die "cannot create ${libmetadir}" |
253 |
+ pushd "${libmetadir}" >/dev/null || die "cannot cd to ${libmetadir}" |
254 |
+ ${ar} -X32_64 -x "${EROOT}${archive}" ${keepmembers} || die "cannot unpack ${archive}" |
255 |
+ ${strip} -X32_64 -e ${keepmembers} || die "cannot strip ${keepmembers}" |
256 |
+ rm -f "${EROOT}${archive}.new" || die "cannot prune ${EROOT}${archive}.new" |
257 |
+ ${ar} -X32_64 -q "${EROOT}${archive}.new" ${keepmembers} || die "cannot create ${EROOT}${archive}.new" |
258 |
+ mv -f "${EROOT}${archive}.new" "${EROOT}${archive}" || die "cannot put ${EROOT}${archive} in place" |
259 |
+ popd > /dev/null || die "cannot leave ${libmetadir}" |
260 |
+ prunedirs[${#prunedirs[@]}]=${libmetadir} |
261 |
+ eend $? |
262 |
+ fi |
263 |
+ done |
264 |
+ [[ ${#prunedirs[@]} == 0 ]] || |
265 |
+ rm -rf "${prunedirs[@]}" || die "cannot prune ${prunedirs[@]}" |
266 |
+ return 0 |
267 |
+} |
268 |
+ |
269 |
preinst_mask() { |
270 |
if [ -z "${D}" ]; then |
271 |
eerror "${FUNCNAME}: D is unset" |
272 |
diff --cc pym/_emerge/actions.py |
273 |
index a15f5e4,6379b36..1672d47 |
274 |
--- a/pym/_emerge/actions.py |
275 |
+++ b/pym/_emerge/actions.py |
276 |
@@@ -28,10 -28,10 +28,10 @@@ from portage import o |
277 |
from portage import digraph |
278 |
from portage import _unicode_decode |
279 |
from portage.cache.cache_errors import CacheError |
280 |
-from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH |
281 |
+from portage.const import GLOBAL_CONFIG_PATH, NEWS_LIB_PATH, EPREFIX |
282 |
from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG |
283 |
from portage.dbapi.dep_expand import dep_expand |
284 |
- from portage.dep import Atom, extended_cp_match |
285 |
+ from portage.dep import Atom, extended_cp_match, _get_useflag_re |
286 |
from portage.exception import InvalidAtom |
287 |
from portage.output import blue, bold, colorize, create_color_func, darkgreen, \ |
288 |
red, yellow |
289 |
diff --cc pym/portage/package/ebuild/doebuild.py |
290 |
index 94c0961,1c04822..ad48398 |
291 |
--- a/pym/portage/package/ebuild/doebuild.py |
292 |
+++ b/pym/portage/package/ebuild/doebuild.py |
293 |
@@@ -1274,16 -1233,10 +1274,14 @@@ _post_phase_cmds = |
294 |
"install_symlink_html_docs"], |
295 |
|
296 |
"preinst" : [ |
297 |
+ "preinst_aix", |
298 |
"preinst_sfperms", |
299 |
"preinst_selinux_labels", |
300 |
"preinst_suid_scan", |
301 |
- "preinst_mask"] |
302 |
+ "preinst_mask"], |
303 |
+ |
304 |
+ "postinst" : [ |
305 |
- "postinst_aix", |
306 |
- "postinst_bsdflags"] |
307 |
++ "postinst_aix"] |
308 |
} |
309 |
|
310 |
def _post_phase_userpriv_perms(mysettings): |
311 |
diff --cc runtests.sh |
312 |
index 0ae4931,11aec60..dadd32d |
313 |
--- a/runtests.sh |
314 |
+++ b/runtests.sh |
315 |
@@@ -1,4 -1,6 +1,6 @@@ |
316 |
-#!/bin/bash |
317 |
+#!@PORTAGE_BASH@ |
318 |
+ # Copyright 2010-2011 Gentoo Foundation |
319 |
+ # Distributed under the terms of the GNU General Public License v2 |
320 |
|
321 |
PYTHON_VERSIONS="2.6 2.7 3.1 3.2 3.3" |
322 |
|
323 |
@@@ -24,9 -26,9 +26,9 @@@ trap interrupted SIGIN |
324 |
|
325 |
exit_status="0" |
326 |
for version in ${PYTHON_VERSIONS}; do |
327 |
- if [[ -x /usr/bin/python${version} ]]; then |
328 |
+ if [[ -x @PREFIX_PORTAGE_PYTHON@${version} ]]; then |
329 |
echo -e "${GOOD}Testing with Python ${version}...${NORMAL}" |
330 |
- if ! @PREFIX_PORTAGE_PYTHON@${version} pym/portage/tests/runTests; then |
331 |
- if ! /usr/bin/python${version} pym/portage/tests/runTests "$@" ; then |
332 |
++ if ! @PREFIX_PORTAGE_PYTHON@${version} pym/portage/tests/runTests "$@" ; then |
333 |
echo -e "${BAD}Testing with Python ${version} failed${NORMAL}" |
334 |
exit_status="1" |
335 |
fi |