1 |
zmedico 13/03/27 16:54:37 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: portage-2.2.0_alpha170.ebuild |
5 |
Log: |
6 |
2.2.0_alpha170 version bump. This includes all of the fixes in 2.1.11.59. |
7 |
Bug #210077 tracks all bugs fixed since portage-2.1.x. |
8 |
|
9 |
(Portage version: 2.2.0_alpha170/cvs/Linux i686, signed Manifest commit with key 0xFDE8EF85AE5719A3) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1239 sys-apps/portage/ChangeLog |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1239&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1239&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.1238&r2=1.1239 |
17 |
|
18 |
Index: ChangeLog |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v |
21 |
retrieving revision 1.1238 |
22 |
retrieving revision 1.1239 |
23 |
diff -u -r1.1238 -r1.1239 |
24 |
--- ChangeLog 27 Mar 2013 16:52:41 -0000 1.1238 |
25 |
+++ ChangeLog 27 Mar 2013 16:54:37 -0000 1.1239 |
26 |
@@ -1,6 +1,12 @@ |
27 |
# ChangeLog for sys-apps/portage |
28 |
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
29 |
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1238 2013/03/27 16:52:41 zmedico Exp $ |
30 |
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1239 2013/03/27 16:54:37 zmedico Exp $ |
31 |
+ |
32 |
+*portage-2.2.0_alpha170 (27 Mar 2013) |
33 |
+ |
34 |
+ 27 Mar 2013; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha170.ebuild: |
35 |
+ 2.2.0_alpha170 version bump. This includes all of the fixes in 2.1.11.59. Bug |
36 |
+ #210077 tracks all bugs fixed since portage-2.1.x. |
37 |
|
38 |
*portage-2.1.11.59 (27 Mar 2013) |
39 |
|
40 |
|
41 |
|
42 |
|
43 |
1.1 sys-apps/portage/portage-2.2.0_alpha170.ebuild |
44 |
|
45 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha170.ebuild?rev=1.1&view=markup |
46 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha170.ebuild?rev=1.1&content-type=text/plain |
47 |
|
48 |
Index: portage-2.2.0_alpha170.ebuild |
49 |
=================================================================== |
50 |
# Copyright 1999-2013 Gentoo Foundation |
51 |
# Distributed under the terms of the GNU General Public License v2 |
52 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha170.ebuild,v 1.1 2013/03/27 16:54:37 zmedico Exp $ |
53 |
|
54 |
# Require EAPI 2 since we now require at least python-2.6 (for python 3 |
55 |
# syntax support) which also requires EAPI 2. |
56 |
EAPI=3 |
57 |
PYTHON_COMPAT=( |
58 |
pypy1_9 pypy2_0 |
59 |
python3_1 python3_2 python3_3 python3_4 |
60 |
python2_6 python2_7 |
61 |
) |
62 |
inherit eutils multilib |
63 |
|
64 |
DESCRIPTION="Portage is the package management and distribution system for Gentoo" |
65 |
HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml" |
66 |
LICENSE="GPL-2" |
67 |
KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd" |
68 |
SLOT="0" |
69 |
IUSE="build doc epydoc +ipc linguas_pl linguas_ru pypy2_0 python2 python3 selinux xattr" |
70 |
|
71 |
for _pyimpl in ${PYTHON_COMPAT[@]} ; do |
72 |
IUSE+=" python_targets_${_pyimpl}" |
73 |
done |
74 |
unset _pyimpl |
75 |
|
76 |
# Import of the io module in python-2.6 raises ImportError for the |
77 |
# thread module if threading is disabled. |
78 |
python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] ) |
79 |
!pypy2_0? ( !python2? ( !python3? ( |
80 |
|| ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] ) |
81 |
) ) ) |
82 |
pypy2_0? ( !python2? ( !python3? ( dev-python/pypy:2.0[bzip2,ssl] ) ) ) |
83 |
python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )" |
84 |
python_dep="${python_dep_ssl//\[ssl\]}" |
85 |
python_dep="${python_dep//,ssl}" |
86 |
python_dep="${python_dep//ssl,}" |
87 |
|
88 |
python_dep="${python_dep} |
89 |
python_targets_pypy1_9? ( dev-python/pypy:1.9 ) |
90 |
python_targets_pypy2_0? ( dev-python/pypy:2.0 ) |
91 |
python_targets_python2_6? ( dev-lang/python:2.6 ) |
92 |
python_targets_python2_7? ( dev-lang/python:2.7 ) |
93 |
python_targets_python3_1? ( dev-lang/python:3.1 ) |
94 |
python_targets_python3_2? ( dev-lang/python:3.2 ) |
95 |
python_targets_python3_3? ( dev-lang/python:3.3 ) |
96 |
python_targets_python3_4? ( dev-lang/python:3.4 ) |
97 |
" |
98 |
|
99 |
# The pysqlite blocker is for bug #282760. |
100 |
# make-3.82 is for bug #455858 |
101 |
DEPEND="${python_dep} |
102 |
>=sys-devel/make-3.82 |
103 |
>=sys-apps/sed-4.0.5 sys-devel/patch |
104 |
doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 ) |
105 |
epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )" |
106 |
# Require sandbox-2.2 for bug #288863. |
107 |
# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's |
108 |
# quite slow, so it's not considered in the dependencies as an alternative to |
109 |
# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so |
110 |
# for now, don't pull in xattr deps for other kernels. |
111 |
# For whirlpool hash, require python[ssl] or python-mhash (bug #425046). |
112 |
# For compgen, require bash[readline] (bug #445576). |
113 |
RDEPEND="${python_dep} |
114 |
!build? ( >=sys-apps/sed-4.0.5 |
115 |
|| ( >=app-shells/bash-4.2_p37[readline] ( <app-shells/bash-4.2_p37 >=app-shells/bash-3.2_p17 ) ) |
116 |
>=app-admin/eselect-1.2 |
117 |
|| ( ${python_dep_ssl} dev-python/python-mhash ) |
118 |
) |
119 |
elibc_FreeBSD? ( sys-freebsd/freebsd-bin ) |
120 |
elibc_glibc? ( >=sys-apps/sandbox-2.2 ) |
121 |
elibc_uclibc? ( >=sys-apps/sandbox-2.2 ) |
122 |
>=app-misc/pax-utils-0.1.17 |
123 |
xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) ) |
124 |
selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) ) |
125 |
!<app-shells/bash-3.2_p17 |
126 |
!<app-admin/logrotate-3.8.0" |
127 |
PDEPEND=" |
128 |
!build? ( |
129 |
>=net-misc/rsync-2.6.4 |
130 |
userland_GNU? ( >=sys-apps/coreutils-6.4 ) |
131 |
)" |
132 |
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532 |
133 |
# NOTE: FEATURES=installsources requires debugedit and rsync |
134 |
|
135 |
SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives" |
136 |
|
137 |
prefix_src_archives() { |
138 |
local x y |
139 |
for x in ${@}; do |
140 |
for y in ${SRC_ARCHIVES}; do |
141 |
echo ${y}/${x} |
142 |
done |
143 |
done |
144 |
} |
145 |
|
146 |
PV_PL="2.1.2" |
147 |
PATCHVER_PL="" |
148 |
TARBALL_PV=2.2.0_alpha170 |
149 |
SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2 |
150 |
$(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2) |
151 |
linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2 |
152 |
$(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )" |
153 |
|
154 |
PATCHVER= |
155 |
[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV |
156 |
if [ -n "${PATCHVER}" ]; then |
157 |
SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2 |
158 |
$(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)" |
159 |
fi |
160 |
|
161 |
S="${WORKDIR}"/${PN}-${TARBALL_PV} |
162 |
S_PL="${WORKDIR}"/${PN}-${PV_PL} |
163 |
|
164 |
compatible_python_is_selected() { |
165 |
[[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]] |
166 |
} |
167 |
|
168 |
current_python_has_xattr() { |
169 |
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' |
170 |
local PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
171 |
[[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \ |
172 |
"${PYTHON}" -c 'import xattr' 2>/dev/null |
173 |
} |
174 |
|
175 |
call_with_python_impl() { |
176 |
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' |
177 |
env EPYTHON=${EPYTHON} "$@" |
178 |
} |
179 |
|
180 |
get_python_interpreter() { |
181 |
[ $# -eq 1 ] || die "expected 1 argument, got $#: $*" |
182 |
local impl=$1 python |
183 |
case "${impl}" in |
184 |
python*) |
185 |
python=${impl/_/.} |
186 |
;; |
187 |
pypy*) |
188 |
python=${impl/_/.} |
189 |
python=${python/pypy/pypy-c} |
190 |
;; |
191 |
*) |
192 |
die "Unrecognized python target: ${impl}" |
193 |
esac |
194 |
echo ${python} |
195 |
} |
196 |
|
197 |
get_python_sitedir() { |
198 |
[ $# -eq 1 ] || die "expected 1 argument, got $#: $*" |
199 |
local impl=$1 |
200 |
local site_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages |
201 |
[[ -d ${EROOT}${site_dir} ]] || \ |
202 |
ewarn "site-packages dir missing for ${impl}: ${EROOT}${site_dir}" |
203 |
echo "${site_dir}" |
204 |
} |
205 |
|
206 |
python_compileall() { |
207 |
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' |
208 |
local d=${EPREFIX}$1 PYTHON=${EPREFIX}/usr/bin/${EPYTHON} |
209 |
local d_image=${D}${d#/} |
210 |
[[ -d ${d_image} ]] || die "directory does not exist: ${d_image}" |
211 |
case "${EPYTHON}" in |
212 |
python*) |
213 |
"${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die |
214 |
# Note: Using -OO breaks emaint, since it requires __doc__, |
215 |
# and __doc__ is None when -OO is used. |
216 |
"${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die |
217 |
;; |
218 |
pypy*) |
219 |
"${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die |
220 |
;; |
221 |
*) |
222 |
die "Unrecognized EPYTHON value: ${EPYTHON}" |
223 |
esac |
224 |
} |
225 |
|
226 |
pkg_setup() { |
227 |
if use python2 && use python3 ; then |
228 |
ewarn "Both python2 and python3 USE flags are enabled, but only one" |
229 |
ewarn "can be in the shebangs. Using python3." |
230 |
fi |
231 |
if use pypy2_0 && use python3 ; then |
232 |
ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one" |
233 |
ewarn "can be in the shebangs. Using python3." |
234 |
fi |
235 |
if use pypy2_0 && use python2 ; then |
236 |
ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one" |
237 |
ewarn "can be in the shebangs. Using python2" |
238 |
fi |
239 |
if ! use pypy2_0 && ! use python2 && ! use python3 && \ |
240 |
! compatible_python_is_selected ; then |
241 |
ewarn "Attempting to select a compatible default python interpreter" |
242 |
local x success=0 |
243 |
for x in "${EPREFIX}"/usr/bin/python2.* ; do |
244 |
x=${x#${EPREFIX}/usr/bin/python2.} |
245 |
if [[ $x -ge 6 ]] 2>/dev/null ; then |
246 |
eselect python set python2.$x |
247 |
if compatible_python_is_selected ; then |
248 |
elog "Default python interpreter is now set to python-2.$x" |
249 |
success=1 |
250 |
break |
251 |
fi |
252 |
fi |
253 |
done |
254 |
if [ $success != 1 ] ; then |
255 |
eerror "Unable to select a compatible default python interpreter!" |
256 |
die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)." |
257 |
fi |
258 |
fi |
259 |
|
260 |
# We use EPYTHON to designate the active python interpreter, |
261 |
# but we only export when needed, via call_with_python_impl. |
262 |
EPYTHON=python |
263 |
export -n EPYTHON |
264 |
if use python3; then |
265 |
EPYTHON=python3 |
266 |
elif use python2; then |
267 |
EPYTHON=python2 |
268 |
elif use pypy2_0; then |
269 |
EPYTHON=pypy-c2.0 |
270 |
fi |
271 |
} |
272 |
|
273 |
src_prepare() { |
274 |
if [ -n "${PATCHVER}" ] ; then |
275 |
if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then |
276 |
rm "$S/bin/ebuild-helpers/portageq" \ |
277 |
|| die "failed to remove portageq helper symlink" |
278 |
fi |
279 |
epatch "${WORKDIR}/${PN}-${PATCHVER}.patch" |
280 |
fi |
281 |
einfo "Setting portage.VERSION to ${PVR} ..." |
282 |
sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \ |
283 |
die "Failed to patch portage.VERSION" |
284 |
sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \ |
285 |
die "Failed to patch VERSION in doc/fragment/version" |
286 |
sed -e "1s/VERSION/${PVR}/" -i $(find man -type f) || \ |
287 |
die "Failed to patch VERSION in man page headers" |
288 |
|
289 |
if ! use ipc ; then |
290 |
einfo "Disabling ipc..." |
291 |
sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \ |
292 |
-i pym/_emerge/AbstractEbuildProcess.py || \ |
293 |
die "failed to patch AbstractEbuildProcess.py" |
294 |
fi |
295 |
|
296 |
if use xattr && use kernel_linux ; then |
297 |
einfo "Adding FEATURES=xattr to make.globals ..." |
298 |
echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \ |
299 |
|| die "failed to append to make.globals" |
300 |
fi |
301 |
|
302 |
local set_shebang= |
303 |
if use python3; then |
304 |
set_shebang=python3 |
305 |
elif use python2; then |
306 |
set_shebang=python2 |
307 |
elif use pypy2_0; then |
308 |
set_shebang=pypy-c2.0 |
309 |
fi |
310 |
if [[ -n ${set_shebang} ]] ; then |
311 |
einfo "Converting shebangs for ${set_shebang}..." |
312 |
while read -r -d $'\0' ; do |
313 |
local shebang=$(head -n1 "$REPLY") |
314 |
if [[ ${shebang} == "#!/usr/bin/python"* ]] ; then |
315 |
sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \ |
316 |
die "sed failed" |
317 |
fi |
318 |
done < <(find . -type f -print0) |
319 |
fi |
320 |
|
321 |
if [[ -n ${EPREFIX} ]] ; then |
322 |
einfo "Setting portage.const.EPREFIX ..." |
323 |
sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \ |
324 |
-e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \ |
325 |
-e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \ |
326 |
-e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \ |
327 |
-e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \ |
328 |
-e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \ |
329 |
-i pym/portage/const.py || \ |
330 |
die "Failed to patch portage.const.EPREFIX" |
331 |
|
332 |
einfo "Prefixing shebangs ..." |
333 |
while read -r -d $'\0' ; do |
334 |
local shebang=$(head -n1 "$REPLY") |
335 |
if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then |
336 |
sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \ |
337 |
die "sed failed" |
338 |
fi |
339 |
done < <(find . -type f -print0) |
340 |
|
341 |
einfo "Adjusting make.globals ..." |
342 |
sed -e 's|^SYNC=.*|SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"|' \ |
343 |
-e "s|^\(PORTDIR=\)\(/usr/portage\)|\\1\"${EPREFIX}\\2\"|" \ |
344 |
-e "s|^\(PORTAGE_TMPDIR=\)\(/var/tmp\)|\\1\"${EPREFIX}\\2\"|" \ |
345 |
-i cnf/make.globals || die "sed failed" |
346 |
|
347 |
einfo "Adding FEATURES=force-prefix to make.globals ..." |
348 |
echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \ |
349 |
|| die "failed to append to make.globals" |
350 |
fi |
351 |
|
352 |
echo -e '\nFEATURES="${FEATURES} preserve-libs"' >> cnf/make.globals \ |
353 |
|| die "failed to append to make.globals" |
354 |
|
355 |
cd "${S}/cnf" || die |
356 |
if [ -f "make.conf.${ARCH}".diff ]; then |
357 |
patch make.conf "make.conf.${ARCH}".diff || \ |
358 |
die "Failed to patch make.conf.example" |
359 |
else |
360 |
eerror "" |
361 |
eerror "Portage does not have an arch-specific configuration for this arch." |
362 |
eerror "Please notify the arch maintainer about this issue. Using generic." |
363 |
eerror "" |
364 |
fi |
365 |
} |
366 |
|
367 |
src_compile() { |
368 |
if use doc; then |
369 |
call_with_python_impl \ |
370 |
emake docbook || die |
371 |
fi |
372 |
|
373 |
if use epydoc; then |
374 |
einfo "Generating api docs" |
375 |
call_with_python_impl \ |
376 |
emake epydoc || die |
377 |
fi |
378 |
} |
379 |
|
380 |
src_test() { |
381 |
# make files executable, in case they were created by patch |
382 |
find bin -type f | xargs chmod +x |
383 |
call_with_python_impl \ |
384 |
emake test || die |
385 |
} |
386 |
|
387 |
src_install() { |
388 |
call_with_python_impl \ |
389 |
emake DESTDIR="${D}" \ |
390 |
sysconfdir="${EPREFIX}/etc" \ |
391 |
prefix="${EPREFIX}/usr" \ |
392 |
install || die |
393 |
|
394 |
# Use dodoc for compression, since the Makefile doesn't do that. |
395 |
dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die |
396 |
|
397 |
if use linguas_pl; then |
398 |
doman -i18n=pl "${S_PL}"/man/pl/*.[0-9] || die |
399 |
doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9] || die |
400 |
fi |
401 |
|
402 |
# Allow external portage API consumers to import portage python modules |
403 |
# (this used to be done with PYTHONPATH setting in /etc/env.d). |
404 |
# For each of PYTHON_TARGETS, install a tree of *.py symlinks in |
405 |
# site-packages, and compile with the corresponding interpreter. |
406 |
local impl files mod_dir dest_mod_dir python relative_path x |
407 |
for impl in "${PYTHON_COMPAT[@]}" ; do |
408 |
use "python_targets_${impl}" || continue |
409 |
while read -r mod_dir ; do |
410 |
cd "${ED}/usr/lib/portage/pym/${mod_dir}" || die |
411 |
files=$(echo *.py) |
412 |
if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then |
413 |
# __pycache__ directories contain no py files |
414 |
continue |
415 |
fi |
416 |
dest_mod_dir=$(get_python_sitedir ${impl})/${mod_dir} |
417 |
dodir "${dest_mod_dir}" || die |
418 |
relative_path=../../../lib/portage/pym/${mod_dir} |
419 |
x=/${mod_dir} |
420 |
while [ -n "${x}" ] ; do |
421 |
relative_path=../${relative_path} |
422 |
x=${x%/*} |
423 |
done |
424 |
for x in ${files} ; do |
425 |
dosym "${relative_path}/${x}" \ |
426 |
"${dest_mod_dir}/${x}" || die |
427 |
done |
428 |
done < <(cd "${ED}"/usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*") |
429 |
cd "${S}" || die |
430 |
EPYTHON=$(get_python_interpreter ${impl}) \ |
431 |
python_compileall "$(get_python_sitedir ${impl})" |
432 |
done |
433 |
|
434 |
# Compile /usr/lib/portage/pym with the active interpreter, since portage |
435 |
# internal commands force this directory to the beginning of sys.path. |
436 |
python_compileall /usr/lib/portage/pym |
437 |
} |
438 |
|
439 |
pkg_preinst() { |
440 |
if [[ $ROOT == / ]] ; then |
441 |
# Run some minimal tests as a sanity check. |
442 |
local test_runner=$(find "$ED" -name runTests) |
443 |
if [[ -n $test_runner && -x $test_runner ]] ; then |
444 |
einfo "Running preinst sanity tests..." |
445 |
"$test_runner" || die "preinst sanity tests failed" |
446 |
fi |
447 |
fi |
448 |
|
449 |
if use xattr && ! current_python_has_xattr ; then |
450 |
ewarn "For optimal performance in xattr handling, install" |
451 |
ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and" |
452 |
ewarn "enable USE=python3 for $CATEGORY/$PN." |
453 |
fi |
454 |
|
455 |
has_version "<=${CATEGORY}/${PN}-2.2_pre5" \ |
456 |
&& WORLD_MIGRATION_UPGRADE=true || WORLD_MIGRATION_UPGRADE=false |
457 |
|
458 |
# If portage-2.1.6 is installed and the preserved_libs_registry exists, |
459 |
# assume that the NEEDED.ELF.2 files have already been generated. |
460 |
has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \ |
461 |
! ( [ -e "${EROOT}"var/lib/portage/preserved_libs_registry ] && \ |
462 |
has_version ">=${CATEGORY}/${PN}-2.1.6_rc" ) \ |
463 |
&& NEEDED_REBUILD_UPGRADE=true || NEEDED_REBUILD_UPGRADE=false |
464 |
} |
465 |
|
466 |
pkg_postinst() { |
467 |
if $WORLD_MIGRATION_UPGRADE && \ |
468 |
grep -q "^@" "${EROOT}/var/lib/portage/world"; then |
469 |
einfo "moving set references from the worldfile into world_sets" |
470 |
cd "${EROOT}/var/lib/portage/" |
471 |
grep "^@" world >> world_sets |
472 |
sed -i -e '/^@/d' world |
473 |
fi |
474 |
|
475 |
if $NEEDED_REBUILD_UPGRADE ; then |
476 |
einfo "rebuilding NEEDED.ELF.2 files" |
477 |
for cpv in "${EROOT}/var/db/pkg"/*/*; do |
478 |
if [ -f "${cpv}/NEEDED" ]; then |
479 |
rm -f "${cpv}/NEEDED.ELF.2" |
480 |
while read line; do |
481 |
filename=${line% *} |
482 |
needed=${line#* } |
483 |
needed=${needed//+/++} |
484 |
needed=${needed//#/##} |
485 |
needed=${needed//%/%%} |
486 |
newline=$(scanelf -BF "%a;%F;%S;%r;${needed}" $filename) |
487 |
newline=${newline// - } |
488 |
echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2" |
489 |
done < "${cpv}/NEEDED" |
490 |
fi |
491 |
done |
492 |
fi |
493 |
} |