Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-apps/portage/
Date: Sun, 21 Feb 2016 09:10:24
Message-Id: 1456045805.e88a4cfdbc8bcebbfd0e6052d09612cac5b69815.grobian@gentoo
1 commit: e88a4cfdbc8bcebbfd0e6052d09612cac5b69815
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 21 09:10:05 2016 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 21 09:10:05 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e88a4cfd
7
8 sys-apps/portage: version bump, ebuild now uses python-based install (non-autotools)
9
10 Package-Manager: portage-2.2.27
11 RepoMan-Options: --force
12
13 sys-apps/portage/Manifest | 3 +-
14 sys-apps/portage/portage-2.2.10.1-r1.ebuild | 592 ----------------------------
15 sys-apps/portage/portage-2.2.10.1.ebuild | 586 ---------------------------
16 sys-apps/portage/portage-2.2.14.ebuild | 582 ---------------------------
17 sys-apps/portage/portage-2.2.27.ebuild | 247 ++++++++++++
18 5 files changed, 248 insertions(+), 1762 deletions(-)
19
20 diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
21 index 6ec2906..96d1ec6 100644
22 --- a/sys-apps/portage/Manifest
23 +++ b/sys-apps/portage/Manifest
24 @@ -1,3 +1,2 @@
25 -DIST prefix-portage-2.2.10.1.tar.bz2 1116228 SHA256 c0b3960b466098dc1913890e6aacc6b64e0f1bb97fbf18c96ab2f648a6daa1e9 SHA512 4d824119707936b6c73ec90a4dff8916a59d0d339e94dddbb9d0b241b550e1a982b475ca8708badf413aaca0aceab2b37f7dfeb62fa90eef7e27c91e41a61cec WHIRLPOOL 9910b2486c513d5b61a8985acf7318d6801d2b425bb3e79759c1d7e692762b02f8489275bb9d361fe5be01e8847cbc540d9dd157afa7a27bbfa9aec9f5834bc5
26 -DIST prefix-portage-2.2.14.tar.bz2 1133962 SHA256 5e7aa542f99fbad1bd371d9e6b5ba5ebaeb8b613a8730dd8966a1be5c9dabf72 SHA512 a107f603139c484caef11eade196876679a79c3800cce1aac58e958aff62a28df734e30d0e66b2f14f4622c6111106610e7527d59ed7677ced2c475f17768ea1 WHIRLPOOL bb857797d0db06e7dead010346887be36ed066979298efba3598361aca06df3cb19a5da924fae65a0ace7a6ad25b9d59d757e058d0c97036a10fb43ac2698b33
27 DIST prefix-portage-2.2.20.tar.bz2 1205876 SHA256 8c32e08af042384e7793a4580cbde892a66ec9ea2ad3bae739b2a9e476ac10cc SHA512 e219ca4b0dcfc6f6a4d221ebfb7e951f6676b739609e8f2d6651ac120d250797eb6fa8bde16ee0fd373403d09a7fd1c59b7e9de7b001da83300492d953ccd1a2 WHIRLPOOL 4ec1fca787e587097088009950165a1117e425365583e6f6952cabc2587bea8c7d8bb88ed8a038be41ffb33cba1a374e99d2e01707a5749449d4a246a43be1b4
28 +DIST prefix-portage-2.2.27.tar.bz2 1230727 SHA256 51bf3f427b23dfd1d050a2071895b5134cf7f515eb00612e0f57adf645a38299 SHA512 bb528ee059c7fc06702882eaa9aad33962ad2eff7e468aa51a8b185e8b3e4ba3eaf88b2ee0f61df9c38493f0f37028e471ba2cc766fa53086ad6b975ead9b332 WHIRLPOOL b0601462462d6dd322ffd9e806c92fd425483fc769a8c6b36c5874a4a28e21e250386ce16479e238577754ab4b194ce700bca7a0407dca919d59fd6ada87970c
29
30 diff --git a/sys-apps/portage/portage-2.2.10.1-r1.ebuild b/sys-apps/portage/portage-2.2.10.1-r1.ebuild
31 deleted file mode 100644
32 index 570635f..0000000
33 --- a/sys-apps/portage/portage-2.2.10.1-r1.ebuild
34 +++ /dev/null
35 @@ -1,592 +0,0 @@
36 -# Copyright 1999-2014 Gentoo Foundation
37 -# Distributed under the terms of the GNU General Public License v2
38 -# $Id: portage-2.2.01.16270.ebuild 58665 2010-09-05 19:54:38Z grobian $
39 -
40 -# Require EAPI 2 since we now require at least python-2.6 (for python 3
41 -# syntax support) which also requires EAPI 2.
42 -EAPI=3
43 -PYTHON_COMPAT=(
44 - pypy1_9 pypy2_0
45 - python3_1 python3_2 python3_3 python3_4
46 - python2_6 python2_7
47 -)
48 -inherit eutils multilib
49 -
50 -DESCRIPTION="Prefix branch of the Portage Package Manager, used in Gentoo Prefix"
51 -HOMEPAGE="http://www.gentoo.org/proj/en/gentoo-alt/prefix/"
52 -LICENSE="GPL-2"
53 -KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
54 -SLOT="0"
55 -IUSE="build doc epydoc +ipc linguas_ru pypy2_0 python2 python3 selinux xattr prefix-chaining"
56 -
57 -for _pyimpl in ${PYTHON_COMPAT[@]} ; do
58 - IUSE+=" python_targets_${_pyimpl}"
59 -done
60 -unset _pyimpl
61 -
62 -# Import of the io module in python-2.6 raises ImportError for the
63 -# thread module if threading is disabled.
64 -python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
65 - !pypy2_0? ( !python2? ( !python3? (
66 - || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
67 - ) ) )
68 - pypy2_0? ( !python2? ( !python3? ( dev-python/pypy:2.0[bzip2,ssl] ) ) )
69 - python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
70 -python_dep="${python_dep_ssl//\[ssl\]}"
71 -python_dep="${python_dep//,ssl}"
72 -python_dep="${python_dep//ssl,}"
73 -
74 -python_dep="${python_dep}
75 - python_targets_pypy1_9? ( dev-python/pypy:1.9 )
76 - python_targets_pypy2_0? ( dev-python/pypy:2.0 )
77 - python_targets_python2_6? ( dev-lang/python:2.6 )
78 - python_targets_python2_7? ( dev-lang/python:2.7 )
79 - python_targets_python3_1? ( dev-lang/python:3.1 )
80 - python_targets_python3_2? ( dev-lang/python:3.2 )
81 - python_targets_python3_3? ( dev-lang/python:3.3 )
82 - python_targets_python3_4? ( dev-lang/python:3.4 )
83 -"
84 -
85 -# The pysqlite blocker is for bug #282760.
86 -# make-3.82 is for bug #455858
87 -DEPEND="${python_dep}
88 - >=sys-devel/make-3.82
89 - >=sys-apps/sed-4.0.5 sys-devel/patch
90 - doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
91 - epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
92 -# Require sandbox-2.2 for bug #288863.
93 -# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
94 -# quite slow, so it's not considered in the dependencies as an alternative to
95 -# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
96 -# for now, don't pull in xattr deps for other kernels.
97 -# For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
98 -# For compgen, require bash[readline] (bug #445576).
99 -# bash-4.1 necessary for redirect_alloc_fd, which fails on non-Linux if bash
100 -# doesn't have a builtin for finding a random filedescriptor
101 -RDEPEND="${python_dep}
102 - !build? ( >=sys-apps/sed-4.0.5
103 - || ( >=app-shells/bash-4.2_p37[readline] ( <app-shells/bash-4.2_p37 >=app-shells/bash-4.1 ) )
104 - >=app-admin/eselect-1.2
105 - || ( ${python_dep_ssl} dev-python/python-mhash )
106 - )
107 - elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
108 - elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
109 - elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
110 - kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
111 - kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
112 - kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
113 - kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
114 - kernel_HPUX? ( !hppa-hpux? ( >=app-misc/pax-utils-0.1.19 ) )
115 - kernel_AIX? ( >=sys-apps/aix-miscutils-0.1.1634 )
116 - xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) )
117 - selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
118 - !<app-shells/bash-3.2_p17
119 - !prefix? ( !<app-admin/logrotate-3.8.0 )"
120 -PDEPEND="
121 - !build? (
122 - >=net-misc/rsync-2.6.4
123 - userland_GNU? ( >=sys-apps/coreutils-6.4 )
124 - )"
125 -# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
126 -# NOTE: FEATURES=installsources requires debugedit and rsync
127 -
128 -SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives http://dev.gentoo.org/~grobian/distfiles"
129 -
130 -prefix_src_archives() {
131 - local x y
132 - for x in ${@}; do
133 - for y in ${SRC_ARCHIVES}; do
134 - echo ${y}/${x}
135 - done
136 - done
137 -}
138 -
139 -PV_PL="2.1.2"
140 -PATCHVER_PL=""
141 -TARBALL_PV="${PV}"
142 -SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
143 - $(prefix_src_archives prefix-${PN}-${TARBALL_PV}.tar.bz2)"
144 -
145 -PATCHVER=
146 -[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
147 -if [ -n "${PATCHVER}" ]; then
148 - SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
149 - $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
150 -fi
151 -
152 -S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
153 -S_PL="${WORKDIR}"/${PN}-${PV_PL}
154 -
155 -compatible_python_is_selected() {
156 - [[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
157 -}
158 -
159 -current_python_has_xattr() {
160 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
161 - local PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
162 - [[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
163 - "${PYTHON}" -c 'import xattr' 2>/dev/null
164 -}
165 -
166 -call_with_python_impl() {
167 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
168 - env EPYTHON=${EPYTHON} "$@"
169 -}
170 -
171 -get_python_interpreter() {
172 - [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
173 - local impl=$1 python
174 - case "${impl}" in
175 - python*)
176 - python=${impl/_/.}
177 - ;;
178 - pypy*)
179 - python=${impl/_/.}
180 - python=${python/pypy/pypy-c}
181 - ;;
182 - *)
183 - die "Unrecognized python target: ${impl}"
184 - esac
185 - echo ${python}
186 -}
187 -
188 -get_python_sitedir() {
189 - [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
190 - local impl=$1
191 - local site_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages
192 - [[ -d ${EROOT}${site_dir} ]] || \
193 - ewarn "site-packages dir missing for ${impl}: ${EROOT}${site_dir}"
194 - echo "${site_dir}"
195 -}
196 -
197 -python_compileall() {
198 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
199 - local d=${EPREFIX}$1 PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
200 - local d_image=${D}${d#/}
201 - [[ -d ${d_image} ]] || die "directory does not exist: ${d_image}"
202 - case "${EPYTHON}" in
203 - python*)
204 - "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
205 - # Note: Using -OO breaks emaint, since it requires __doc__,
206 - # and __doc__ is None when -OO is used.
207 - "${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die
208 - ;;
209 - pypy*)
210 - "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
211 - ;;
212 - *)
213 - die "Unrecognized EPYTHON value: ${EPYTHON}"
214 - esac
215 -}
216 -
217 -pkg_setup() {
218 - if use python2 && use python3 ; then
219 - ewarn "Both python2 and python3 USE flags are enabled, but only one"
220 - ewarn "can be in the shebangs. Using python3."
221 - fi
222 - if use pypy2_0 && use python3 ; then
223 - ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one"
224 - ewarn "can be in the shebangs. Using python3."
225 - fi
226 - if use pypy2_0 && use python2 ; then
227 - ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one"
228 - ewarn "can be in the shebangs. Using python2"
229 - fi
230 - if ! use pypy2_0 && ! use python2 && ! use python3 && \
231 - ! compatible_python_is_selected ; then
232 - ewarn "Attempting to select a compatible default python interpreter"
233 - local x success=0
234 - for x in "${EPREFIX}"/usr/bin/python2.* ; do
235 - x=${x#${EPREFIX}/usr/bin/python2.}
236 - if [[ $x -ge 6 ]] 2>/dev/null ; then
237 - eselect python set python2.$x
238 - if compatible_python_is_selected ; then
239 - elog "Default python interpreter is now set to python-2.$x"
240 - success=1
241 - break
242 - fi
243 - fi
244 - done
245 - if [ $success != 1 ] ; then
246 - eerror "Unable to select a compatible default python interpreter!"
247 - die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
248 - fi
249 - fi
250 -
251 - # We use EPYTHON to designate the active python interpreter,
252 - # but we only export when needed, via call_with_python_impl.
253 - EPYTHON=python
254 - export -n EPYTHON
255 - if use python3; then
256 - EPYTHON=python3
257 - elif use python2; then
258 - EPYTHON=python2
259 - elif use pypy2_0; then
260 - EPYTHON=pypy-c2.0
261 - fi
262 -}
263 -
264 -src_prepare() {
265 - if [ -n "${PATCHVER}" ] ; then
266 - if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
267 - rm "$S/bin/ebuild-helpers/portageq" \
268 - || die "failed to remove portageq helper symlink"
269 - fi
270 - epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
271 - fi
272 -
273 - use prefix-chaining && epatch "${FILESDIR}"/${PN}-2.2.00.15801-prefix-chaining.patch
274 - epatch "${FILESDIR}"/${PN}-2.2.8-ebuildshell.patch # 155161
275 - # use pool of servers
276 - sed -i \
277 - -e 's/prefix.gentooexperimental.org/rsync.prefix.bitzolder.nl/' \
278 - bin/emerge-webrsync cnf/make.conf.example cnf/repos.conf
279 -
280 - # temp workaround to be able to upgrade to 2.2.14
281 - epatch "${FILESDIR}"/${P}-case-insensitive-fs.patch # 524236
282 - sed -i \
283 - -e 's/force-prefix/force-prefix case-insensitive-fs/' \
284 - cnf/make.globals
285 -
286 - if ! use ipc ; then
287 - einfo "Disabling ipc..."
288 - sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
289 - -i pym/_emerge/AbstractEbuildProcess.py || \
290 - die "failed to patch AbstractEbuildProcess.py"
291 - fi
292 -
293 - if use xattr && use kernel_linux ; then
294 - einfo "Adding FEATURES=xattr to make.globals ..."
295 - echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
296 - || die "failed to append to make.globals"
297 - fi
298 -
299 - local set_shebang=
300 - if use python3; then
301 - set_shebang=python3
302 - elif use python2; then
303 - set_shebang=python2
304 - elif use pypy2_0; then
305 - set_shebang=pypy-c2.0
306 - fi
307 - if [[ -n ${set_shebang} ]] ; then
308 - einfo "Converting shebangs for ${set_shebang}..."
309 - while read -r -d $'\0' ; do
310 - local shebang=$(head -n1 "$REPLY")
311 - if [[ ${shebang} == "#!${EPREFIX}/usr/bin/python"* ]] ; then
312 - sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \
313 - die "sed failed"
314 - fi
315 - done < <(find . -type f -print0)
316 - fi
317 -
318 - # "native" Prefix still uses configure
319 - if use !prefix && [[ -n ${EPREFIX} ]] ; then
320 - einfo "Setting portage.const.EPREFIX ..."
321 - sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
322 - -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
323 - -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
324 - -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
325 - -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
326 - -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
327 - -i pym/portage/const.py || \
328 - die "Failed to patch portage.const.EPREFIX"
329 -
330 - einfo "Prefixing shebangs ..."
331 - while read -r -d $'\0' ; do
332 - local shebang=$(head -n1 "$REPLY")
333 - if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
334 - sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
335 - die "sed failed"
336 - fi
337 - done < <(find . -type f -print0)
338 -
339 - einfo "Adding FEATURES=force-prefix to make.globals ..."
340 - echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
341 - || die "failed to append to make.globals"
342 - fi
343 -
344 - if use !prefix ; then
345 - cd "${S}/cnf" || die
346 - if [ -f "make.conf.${ARCH}".diff ]; then
347 - patch make.conf "make.conf.${ARCH}".diff || \
348 - die "Failed to patch make.conf.example"
349 - else
350 - eerror ""
351 - eerror "Portage does not have an arch-specific configuration for this arch."
352 - eerror "Please notify the arch maintainer about this issue. Using generic."
353 - eerror ""
354 - fi
355 - fi
356 -}
357 -
358 -src_configure() {
359 - if use prefix ; then
360 - local extrapath="/usr/bin:/bin"
361 - # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as people
362 - # tend not to update that often, as long as we are a separate ebuild
363 - # we can assume when unset, it's time for some older trick
364 - if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
365 - PORTAGE_ROOT_USER=$(python -c 'from portage.const import rootuser; print rootuser')
366 - fi
367 - # lazy check, but works for now
368 - if [[ ${PORTAGE_ROOT_USER} == "root" ]] ; then
369 - # we need this for e.g. mtree on FreeBSD (and Darwin) which is in
370 - # /usr/sbin
371 - extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
372 - fi
373 -
374 - econf \
375 - --with-portage-user="${PORTAGE_USER:-portage}" \
376 - --with-portage-group="${PORTAGE_GROUP:-portage}" \
377 - --with-root-user="${PORTAGE_ROOT_USER}" \
378 - --with-offset-prefix="${EPREFIX}" \
379 - --with-extra-path="${extrapath}" \
380 - || die "econf failed"
381 - else
382 - default
383 - fi
384 -}
385 -
386 -src_compile() {
387 - if use prefix ; then
388 - emake || die "emake failed"
389 - fi
390 -
391 - if use doc; then
392 - call_with_python_impl \
393 - emake docbook || die
394 - fi
395 -
396 - if use epydoc; then
397 - einfo "Generating api docs"
398 - call_with_python_impl \
399 - emake epydoc || die
400 - fi
401 -}
402 -
403 -src_test() {
404 - # make files executable, in case they were created by patch
405 - find bin -type f | xargs chmod +x
406 - call_with_python_impl \
407 - emake test || die
408 -}
409 -
410 -src_install() {
411 - local portage_base="/usr/lib/portage"
412 -
413 - emake DESTDIR="${D}" install || die "make install failed."
414 - dodir /usr/lib/portage/bin
415 -
416 - if use userland_GNU; then
417 - rm "${ED}"${portage_base}/bin/ebuild-helpers/bsd/sed || die "Failed to remove sed wrapper"
418 - fi
419 -
420 - use doc && dohtml -r "${S}"/doc/*
421 - use epydoc && dohtml -r "${WORKDIR}"/api
422 - dodir /etc/portage
423 - keepdir /etc/portage
424 -
425 - # Use dodoc for compression, since the Makefile doesn't do that.
426 - dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
427 -
428 - # Allow external portage API consumers to import portage python modules
429 - # (this used to be done with PYTHONPATH setting in /etc/env.d).
430 - # For each of PYTHON_TARGETS, install a tree of *.py symlinks in
431 - # site-packages, and compile with the corresponding interpreter.
432 - local impl files mod_dir dest_mod_dir python relative_path x
433 - for impl in "${PYTHON_COMPAT[@]}" ; do
434 - use "python_targets_${impl}" || continue
435 - if use build && [[ ${ROOT} == / &&
436 - ! -x ${EPREFIX}/usr/bin/$(get_python_interpreter ${impl}) ]] ; then
437 - # Tolerate --nodeps at beginning of stage1 for catalyst
438 - ewarn "skipping python_targets_${impl}, interpreter not found"
439 - continue
440 - fi
441 - while read -r mod_dir ; do
442 - cd "${ED}/usr/lib/portage/pym/${mod_dir}" || die
443 - files=$(echo *.py)
444 - if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then
445 - # __pycache__ directories contain no py files
446 - continue
447 - fi
448 - dest_mod_dir=$(get_python_sitedir ${impl})/${mod_dir}
449 - dodir "${dest_mod_dir}" || die
450 - relative_path=../../../lib/portage/pym/${mod_dir}
451 - x=/${mod_dir}
452 - while [ -n "${x}" ] ; do
453 - relative_path=../${relative_path}
454 - x=${x%/*}
455 - done
456 - for x in ${files} ; do
457 - dosym "${relative_path}/${x}" \
458 - "${dest_mod_dir}/${x}" || die
459 - done
460 - done < <(cd "${ED}"/usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*")
461 - cd "${S}" || die
462 - EPYTHON=$(get_python_interpreter ${impl}) \
463 - python_compileall "$(get_python_sitedir ${impl})"
464 - done
465 -
466 - # Compile /usr/lib/portage/pym with the active interpreter, since portage
467 - # internal commands force this directory to the beginning of sys.path.
468 - python_compileall /usr/lib/portage/pym
469 -}
470 -
471 -pkg_preinst() {
472 - if [[ $ROOT == / ]] ; then
473 - # Run some minimal tests as a sanity check.
474 - local test_runner=$(find "$ED" -name runTests)
475 - if [[ -n $test_runner && -x $test_runner ]] ; then
476 - einfo "Running preinst sanity tests..."
477 - "$test_runner" || die "preinst sanity tests failed"
478 - fi
479 - fi
480 -
481 - if use xattr && ! current_python_has_xattr ; then
482 - ewarn "For optimal performance in xattr handling, install"
483 - ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
484 - ewarn "enable USE=python3 for $CATEGORY/$PN."
485 - fi
486 -
487 - has_version "<=${CATEGORY}/${PN}-2.2.00.13346"
488 - EAPIPREFIX_UPGRADE=$?
489 -
490 - if has_version "<${CATEGORY}/${PN}-2.2.7-r1" ; then
491 - REPOS_CONF_UPGRADE=true
492 - REPOS_CONF_SYNC=
493 - type -P portageq >/dev/null 2>&1 && \
494 - REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
495 - fi
496 -}
497 -
498 -new_config_protect() {
499 - # Generate a ._cfg file even if the target file
500 - # does not exist, ensuring that the user will
501 - # notice the config change.
502 - local basename=${1##*/}
503 - local dirname=${1%/*}
504 - local i=0
505 - while true ; do
506 - local filename=$(
507 - echo -n "${dirname}/._cfg"
508 - printf "%04d" ${i}
509 - echo -n "_${basename}"
510 - )
511 - [[ -e ${filename} ]] || break
512 - (( i++ ))
513 - done
514 - echo "${filename}"
515 -}
516 -
517 -pkg_postinst() {
518 -
519 - if [[ -n ${REPOS_CONF_UPGRADE} ]] ; then
520 - einfo "Generating repos.conf"
521 - local repo_name=
522 - [[ -f ${PORTDIR}/profiles/repo_name ]] && \
523 - repo_name=$(< "${PORTDIR}/profiles/repo_name")
524 - if [[ -z ${REPOS_CONF_SYNC} ]] ; then
525 - REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
526 - REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
527 - fi
528 - local sync_type=
529 - [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
530 -
531 - if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
532 - sync_type=cvs
533 - REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
534 - fi
535 -
536 - cat <<-EOF > "${T}/repos.conf"
537 - [DEFAULT]
538 - main-repo = ${repo_name:-gentoo}
539 -
540 - [${repo_name:-gentoo}]
541 - location = ${PORTDIR:-${EPREFIX}/usr/portage}
542 - sync-type = ${sync_type:-rsync}
543 - sync-uri = ${REPOS_CONF_SYNC}
544 - EOF
545 -
546 - [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
547 -
548 - local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
549 - if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
550 - dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
551 - fi
552 - # Don't install the config update if the desired repos.conf directory
553 - # and config file exist, since users may accept it blindly and break
554 - # their config (bug #478726).
555 - [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
556 - mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
557 -
558 - if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
559 - einfo "Generating make.conf PORTDIR setting for backward compatibility"
560 - for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
561 - [[ -e ${dest} ]] && break
562 - done
563 - [[ -d ${dest} ]] && dest=${dest}/portdir.conf
564 - rm -rf "${T}/make.conf"
565 - [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
566 - cat <<-EOF >> "${T}/make.conf"
567 -
568 - # Set PORTDIR for backward compatibility with various tools:
569 - # gentoo-bashcomp - bug #478444
570 - # euse - bug #474574
571 - # euses and ufed - bug #478318
572 - PORTDIR="${EPREFIX}/usr/portage"
573 - EOF
574 - mkdir -p "${dest%/*}"
575 - mv "${T}/make.conf" "$(new_config_protect "${dest}")"
576 - fi
577 - fi
578 -
579 - pushd "${EROOT}var/db/pkg" > /dev/null
580 - local didwork=
581 - [[ ! -e "${EROOT}"var/lib/portage/preserved_libs_registry ]] && for cpv in */*/NEEDED ; do
582 - if [[ ${CHOST} == *-darwin* && ! -f ${cpv}.MACHO.3 ]] ; then
583 - while read line; do
584 - scanmacho -BF "%a;%F;%S;%n" ${line% *} >> "${cpv}".MACHO.3
585 - done < "${cpv}"
586 - [[ -z ${didwork} ]] \
587 - && didwork=yes \
588 - || didwork=already
589 - elif [[ ${CHOST} != *-darwin* && ${CHOST} != *-interix* && ! -f ${cpv}.ELF.2 ]] ; then
590 - while read line; do
591 - filename=${line% *}
592 - needed=${line#* }
593 - newline=$(scanelf -BF "%a;%F;%S;$needed;%r" $filename)
594 - echo "${newline:3}" >> "${cpv}".ELF.2
595 - done < "${cpv}"
596 - [[ -z ${didwork} ]] \
597 - && didwork=yes \
598 - || didwork=already
599 - fi
600 - [[ ${didwork} == yes ]] && \
601 - einfo "converting NEEDED files to new syntax, please wait"
602 - done
603 - popd > /dev/null
604 -
605 - if [[ ${EAPIPREFIX_UPGRADE} == 0 ]] ; then
606 - local eapi
607 - einfo 'removing EAPI="prefix" legacy from your vdb, please wait'
608 - pushd "${EROOT}var/db/pkg" > /dev/null
609 - for cpv in */* ; do
610 - [[ ${cpv##*/} == "-MERGING-"* ]] && continue
611 - # remove "prefix" from EAPI file
612 - eapi=$(<"${cpv}"/EAPI)
613 - eapi=${eapi/prefix/}
614 - eapi=${eapi# }
615 - eapi=${eapi:-0}
616 - echo ${eapi} > "${cpv}"/EAPI
617 - # remove "prefix" from EAPI in stored environment
618 - bzcat "${cpv}"/environment.bz2 \
619 - | sed -e "s/EAPI=\([\"']\)prefix [0-9][\"']/EAPI=\1${eapi}\1/" \
620 - | bzip2 -9 > "${cpv}"/environment2.bz2 \
621 - && mv -f "${cpv}"/environment{2,}.bz2
622 - # remove "prefix" from the stored ebuild
623 - sed -i -e "s/^EAPI=.*$/EAPI=${eapi}/" "${cpv}/${cpv##*/}.ebuild"
624 - done
625 - popd > /dev/null
626 - fi
627 -}
628
629 diff --git a/sys-apps/portage/portage-2.2.10.1.ebuild b/sys-apps/portage/portage-2.2.10.1.ebuild
630 deleted file mode 100644
631 index 8431971..0000000
632 --- a/sys-apps/portage/portage-2.2.10.1.ebuild
633 +++ /dev/null
634 @@ -1,586 +0,0 @@
635 -# Copyright 1999-2014 Gentoo Foundation
636 -# Distributed under the terms of the GNU General Public License v2
637 -# $Id: portage-2.2.01.16270.ebuild 58665 2010-09-05 19:54:38Z grobian $
638 -
639 -# Require EAPI 2 since we now require at least python-2.6 (for python 3
640 -# syntax support) which also requires EAPI 2.
641 -EAPI=3
642 -PYTHON_COMPAT=(
643 - pypy1_9 pypy2_0
644 - python3_1 python3_2 python3_3 python3_4
645 - python2_6 python2_7
646 -)
647 -inherit eutils multilib
648 -
649 -DESCRIPTION="Prefix branch of the Portage Package Manager, used in Gentoo Prefix"
650 -HOMEPAGE="http://www.gentoo.org/proj/en/gentoo-alt/prefix/"
651 -LICENSE="GPL-2"
652 -KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
653 -SLOT="0"
654 -IUSE="build doc epydoc +ipc linguas_ru pypy2_0 python2 python3 selinux xattr prefix-chaining"
655 -
656 -for _pyimpl in ${PYTHON_COMPAT[@]} ; do
657 - IUSE+=" python_targets_${_pyimpl}"
658 -done
659 -unset _pyimpl
660 -
661 -# Import of the io module in python-2.6 raises ImportError for the
662 -# thread module if threading is disabled.
663 -python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
664 - !pypy2_0? ( !python2? ( !python3? (
665 - || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
666 - ) ) )
667 - pypy2_0? ( !python2? ( !python3? ( dev-python/pypy:2.0[bzip2,ssl] ) ) )
668 - python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
669 -python_dep="${python_dep_ssl//\[ssl\]}"
670 -python_dep="${python_dep//,ssl}"
671 -python_dep="${python_dep//ssl,}"
672 -
673 -python_dep="${python_dep}
674 - python_targets_pypy1_9? ( dev-python/pypy:1.9 )
675 - python_targets_pypy2_0? ( dev-python/pypy:2.0 )
676 - python_targets_python2_6? ( dev-lang/python:2.6 )
677 - python_targets_python2_7? ( dev-lang/python:2.7 )
678 - python_targets_python3_1? ( dev-lang/python:3.1 )
679 - python_targets_python3_2? ( dev-lang/python:3.2 )
680 - python_targets_python3_3? ( dev-lang/python:3.3 )
681 - python_targets_python3_4? ( dev-lang/python:3.4 )
682 -"
683 -
684 -# The pysqlite blocker is for bug #282760.
685 -# make-3.82 is for bug #455858
686 -DEPEND="${python_dep}
687 - >=sys-devel/make-3.82
688 - >=sys-apps/sed-4.0.5 sys-devel/patch
689 - doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
690 - epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
691 -# Require sandbox-2.2 for bug #288863.
692 -# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
693 -# quite slow, so it's not considered in the dependencies as an alternative to
694 -# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
695 -# for now, don't pull in xattr deps for other kernels.
696 -# For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
697 -# For compgen, require bash[readline] (bug #445576).
698 -# bash-4.1 necessary for redirect_alloc_fd, which fails on non-Linux if bash
699 -# doesn't have a builtin for finding a random filedescriptor
700 -RDEPEND="${python_dep}
701 - !build? ( >=sys-apps/sed-4.0.5
702 - || ( >=app-shells/bash-4.2_p37[readline] ( <app-shells/bash-4.2_p37 >=app-shells/bash-4.1 ) )
703 - >=app-admin/eselect-1.2
704 - || ( ${python_dep_ssl} dev-python/python-mhash )
705 - )
706 - elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
707 - elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
708 - elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
709 - kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
710 - kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
711 - kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
712 - kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
713 - kernel_HPUX? ( !hppa-hpux? ( >=app-misc/pax-utils-0.1.19 ) )
714 - kernel_AIX? ( >=sys-apps/aix-miscutils-0.1.1634 )
715 - xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) )
716 - selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
717 - !<app-shells/bash-3.2_p17
718 - !prefix? ( !<app-admin/logrotate-3.8.0 )"
719 -PDEPEND="
720 - !build? (
721 - >=net-misc/rsync-2.6.4
722 - userland_GNU? ( >=sys-apps/coreutils-6.4 )
723 - )"
724 -# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
725 -# NOTE: FEATURES=installsources requires debugedit and rsync
726 -
727 -SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives http://dev.gentoo.org/~grobian/distfiles"
728 -
729 -prefix_src_archives() {
730 - local x y
731 - for x in ${@}; do
732 - for y in ${SRC_ARCHIVES}; do
733 - echo ${y}/${x}
734 - done
735 - done
736 -}
737 -
738 -PV_PL="2.1.2"
739 -PATCHVER_PL=""
740 -TARBALL_PV="${PV}"
741 -SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
742 - $(prefix_src_archives prefix-${PN}-${TARBALL_PV}.tar.bz2)"
743 -
744 -PATCHVER=
745 -[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
746 -if [ -n "${PATCHVER}" ]; then
747 - SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
748 - $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
749 -fi
750 -
751 -S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
752 -S_PL="${WORKDIR}"/${PN}-${PV_PL}
753 -
754 -compatible_python_is_selected() {
755 - [[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
756 -}
757 -
758 -current_python_has_xattr() {
759 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
760 - local PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
761 - [[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
762 - "${PYTHON}" -c 'import xattr' 2>/dev/null
763 -}
764 -
765 -call_with_python_impl() {
766 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
767 - env EPYTHON=${EPYTHON} "$@"
768 -}
769 -
770 -get_python_interpreter() {
771 - [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
772 - local impl=$1 python
773 - case "${impl}" in
774 - python*)
775 - python=${impl/_/.}
776 - ;;
777 - pypy*)
778 - python=${impl/_/.}
779 - python=${python/pypy/pypy-c}
780 - ;;
781 - *)
782 - die "Unrecognized python target: ${impl}"
783 - esac
784 - echo ${python}
785 -}
786 -
787 -get_python_sitedir() {
788 - [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
789 - local impl=$1
790 - local site_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages
791 - [[ -d ${EROOT}${site_dir} ]] || \
792 - ewarn "site-packages dir missing for ${impl}: ${EROOT}${site_dir}"
793 - echo "${site_dir}"
794 -}
795 -
796 -python_compileall() {
797 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
798 - local d=${EPREFIX}$1 PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
799 - local d_image=${D}${d#/}
800 - [[ -d ${d_image} ]] || die "directory does not exist: ${d_image}"
801 - case "${EPYTHON}" in
802 - python*)
803 - "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
804 - # Note: Using -OO breaks emaint, since it requires __doc__,
805 - # and __doc__ is None when -OO is used.
806 - "${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die
807 - ;;
808 - pypy*)
809 - "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
810 - ;;
811 - *)
812 - die "Unrecognized EPYTHON value: ${EPYTHON}"
813 - esac
814 -}
815 -
816 -pkg_setup() {
817 - if use python2 && use python3 ; then
818 - ewarn "Both python2 and python3 USE flags are enabled, but only one"
819 - ewarn "can be in the shebangs. Using python3."
820 - fi
821 - if use pypy2_0 && use python3 ; then
822 - ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one"
823 - ewarn "can be in the shebangs. Using python3."
824 - fi
825 - if use pypy2_0 && use python2 ; then
826 - ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one"
827 - ewarn "can be in the shebangs. Using python2"
828 - fi
829 - if ! use pypy2_0 && ! use python2 && ! use python3 && \
830 - ! compatible_python_is_selected ; then
831 - ewarn "Attempting to select a compatible default python interpreter"
832 - local x success=0
833 - for x in "${EPREFIX}"/usr/bin/python2.* ; do
834 - x=${x#${EPREFIX}/usr/bin/python2.}
835 - if [[ $x -ge 6 ]] 2>/dev/null ; then
836 - eselect python set python2.$x
837 - if compatible_python_is_selected ; then
838 - elog "Default python interpreter is now set to python-2.$x"
839 - success=1
840 - break
841 - fi
842 - fi
843 - done
844 - if [ $success != 1 ] ; then
845 - eerror "Unable to select a compatible default python interpreter!"
846 - die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
847 - fi
848 - fi
849 -
850 - # We use EPYTHON to designate the active python interpreter,
851 - # but we only export when needed, via call_with_python_impl.
852 - EPYTHON=python
853 - export -n EPYTHON
854 - if use python3; then
855 - EPYTHON=python3
856 - elif use python2; then
857 - EPYTHON=python2
858 - elif use pypy2_0; then
859 - EPYTHON=pypy-c2.0
860 - fi
861 -}
862 -
863 -src_prepare() {
864 - if [ -n "${PATCHVER}" ] ; then
865 - if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
866 - rm "$S/bin/ebuild-helpers/portageq" \
867 - || die "failed to remove portageq helper symlink"
868 - fi
869 - epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
870 - fi
871 -
872 - use prefix-chaining && epatch "${FILESDIR}"/${PN}-2.2.00.15801-prefix-chaining.patch
873 - epatch "${FILESDIR}"/${PN}-2.2.8-ebuildshell.patch # 155161
874 - # use pool of servers
875 - sed -i \
876 - -e 's/prefix.gentooexperimental.org/rsync.prefix.bitzolder.nl/' \
877 - bin/emerge-webrsync cnf/make.conf.example cnf/repos.conf
878 -
879 - if ! use ipc ; then
880 - einfo "Disabling ipc..."
881 - sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
882 - -i pym/_emerge/AbstractEbuildProcess.py || \
883 - die "failed to patch AbstractEbuildProcess.py"
884 - fi
885 -
886 - if use xattr && use kernel_linux ; then
887 - einfo "Adding FEATURES=xattr to make.globals ..."
888 - echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
889 - || die "failed to append to make.globals"
890 - fi
891 -
892 - local set_shebang=
893 - if use python3; then
894 - set_shebang=python3
895 - elif use python2; then
896 - set_shebang=python2
897 - elif use pypy2_0; then
898 - set_shebang=pypy-c2.0
899 - fi
900 - if [[ -n ${set_shebang} ]] ; then
901 - einfo "Converting shebangs for ${set_shebang}..."
902 - while read -r -d $'\0' ; do
903 - local shebang=$(head -n1 "$REPLY")
904 - if [[ ${shebang} == "#!${EPREFIX}/usr/bin/python"* ]] ; then
905 - sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \
906 - die "sed failed"
907 - fi
908 - done < <(find . -type f -print0)
909 - fi
910 -
911 - # "native" Prefix still uses configure
912 - if use !prefix && [[ -n ${EPREFIX} ]] ; then
913 - einfo "Setting portage.const.EPREFIX ..."
914 - sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
915 - -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
916 - -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
917 - -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
918 - -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
919 - -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
920 - -i pym/portage/const.py || \
921 - die "Failed to patch portage.const.EPREFIX"
922 -
923 - einfo "Prefixing shebangs ..."
924 - while read -r -d $'\0' ; do
925 - local shebang=$(head -n1 "$REPLY")
926 - if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
927 - sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
928 - die "sed failed"
929 - fi
930 - done < <(find . -type f -print0)
931 -
932 - einfo "Adding FEATURES=force-prefix to make.globals ..."
933 - echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
934 - || die "failed to append to make.globals"
935 - fi
936 -
937 - if use !prefix ; then
938 - cd "${S}/cnf" || die
939 - if [ -f "make.conf.${ARCH}".diff ]; then
940 - patch make.conf "make.conf.${ARCH}".diff || \
941 - die "Failed to patch make.conf.example"
942 - else
943 - eerror ""
944 - eerror "Portage does not have an arch-specific configuration for this arch."
945 - eerror "Please notify the arch maintainer about this issue. Using generic."
946 - eerror ""
947 - fi
948 - fi
949 -}
950 -
951 -src_configure() {
952 - if use prefix ; then
953 - local extrapath="/usr/bin:/bin"
954 - # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as people
955 - # tend not to update that often, as long as we are a separate ebuild
956 - # we can assume when unset, it's time for some older trick
957 - if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
958 - PORTAGE_ROOT_USER=$(python -c 'from portage.const import rootuser; print rootuser')
959 - fi
960 - # lazy check, but works for now
961 - if [[ ${PORTAGE_ROOT_USER} == "root" ]] ; then
962 - # we need this for e.g. mtree on FreeBSD (and Darwin) which is in
963 - # /usr/sbin
964 - extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
965 - fi
966 -
967 - econf \
968 - --with-portage-user="${PORTAGE_USER:-portage}" \
969 - --with-portage-group="${PORTAGE_GROUP:-portage}" \
970 - --with-root-user="${PORTAGE_ROOT_USER}" \
971 - --with-offset-prefix="${EPREFIX}" \
972 - --with-extra-path="${extrapath}" \
973 - || die "econf failed"
974 - else
975 - default
976 - fi
977 -}
978 -
979 -src_compile() {
980 - if use prefix ; then
981 - emake || die "emake failed"
982 - fi
983 -
984 - if use doc; then
985 - call_with_python_impl \
986 - emake docbook || die
987 - fi
988 -
989 - if use epydoc; then
990 - einfo "Generating api docs"
991 - call_with_python_impl \
992 - emake epydoc || die
993 - fi
994 -}
995 -
996 -src_test() {
997 - # make files executable, in case they were created by patch
998 - find bin -type f | xargs chmod +x
999 - call_with_python_impl \
1000 - emake test || die
1001 -}
1002 -
1003 -src_install() {
1004 - local portage_base="/usr/lib/portage"
1005 -
1006 - emake DESTDIR="${D}" install || die "make install failed."
1007 - dodir /usr/lib/portage/bin
1008 -
1009 - if use userland_GNU; then
1010 - rm "${ED}"${portage_base}/bin/ebuild-helpers/bsd/sed || die "Failed to remove sed wrapper"
1011 - fi
1012 -
1013 - use doc && dohtml -r "${S}"/doc/*
1014 - use epydoc && dohtml -r "${WORKDIR}"/api
1015 - dodir /etc/portage
1016 - keepdir /etc/portage
1017 -
1018 - # Use dodoc for compression, since the Makefile doesn't do that.
1019 - dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
1020 -
1021 - # Allow external portage API consumers to import portage python modules
1022 - # (this used to be done with PYTHONPATH setting in /etc/env.d).
1023 - # For each of PYTHON_TARGETS, install a tree of *.py symlinks in
1024 - # site-packages, and compile with the corresponding interpreter.
1025 - local impl files mod_dir dest_mod_dir python relative_path x
1026 - for impl in "${PYTHON_COMPAT[@]}" ; do
1027 - use "python_targets_${impl}" || continue
1028 - if use build && [[ ${ROOT} == / &&
1029 - ! -x ${EPREFIX}/usr/bin/$(get_python_interpreter ${impl}) ]] ; then
1030 - # Tolerate --nodeps at beginning of stage1 for catalyst
1031 - ewarn "skipping python_targets_${impl}, interpreter not found"
1032 - continue
1033 - fi
1034 - while read -r mod_dir ; do
1035 - cd "${ED}/usr/lib/portage/pym/${mod_dir}" || die
1036 - files=$(echo *.py)
1037 - if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then
1038 - # __pycache__ directories contain no py files
1039 - continue
1040 - fi
1041 - dest_mod_dir=$(get_python_sitedir ${impl})/${mod_dir}
1042 - dodir "${dest_mod_dir}" || die
1043 - relative_path=../../../lib/portage/pym/${mod_dir}
1044 - x=/${mod_dir}
1045 - while [ -n "${x}" ] ; do
1046 - relative_path=../${relative_path}
1047 - x=${x%/*}
1048 - done
1049 - for x in ${files} ; do
1050 - dosym "${relative_path}/${x}" \
1051 - "${dest_mod_dir}/${x}" || die
1052 - done
1053 - done < <(cd "${ED}"/usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*")
1054 - cd "${S}" || die
1055 - EPYTHON=$(get_python_interpreter ${impl}) \
1056 - python_compileall "$(get_python_sitedir ${impl})"
1057 - done
1058 -
1059 - # Compile /usr/lib/portage/pym with the active interpreter, since portage
1060 - # internal commands force this directory to the beginning of sys.path.
1061 - python_compileall /usr/lib/portage/pym
1062 -}
1063 -
1064 -pkg_preinst() {
1065 - if [[ $ROOT == / ]] ; then
1066 - # Run some minimal tests as a sanity check.
1067 - local test_runner=$(find "$ED" -name runTests)
1068 - if [[ -n $test_runner && -x $test_runner ]] ; then
1069 - einfo "Running preinst sanity tests..."
1070 - "$test_runner" || die "preinst sanity tests failed"
1071 - fi
1072 - fi
1073 -
1074 - if use xattr && ! current_python_has_xattr ; then
1075 - ewarn "For optimal performance in xattr handling, install"
1076 - ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
1077 - ewarn "enable USE=python3 for $CATEGORY/$PN."
1078 - fi
1079 -
1080 - has_version "<=${CATEGORY}/${PN}-2.2.00.13346"
1081 - EAPIPREFIX_UPGRADE=$?
1082 -
1083 - if has_version "<${CATEGORY}/${PN}-2.2.7-r1" ; then
1084 - REPOS_CONF_UPGRADE=true
1085 - REPOS_CONF_SYNC=
1086 - type -P portageq >/dev/null 2>&1 && \
1087 - REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
1088 - fi
1089 -}
1090 -
1091 -new_config_protect() {
1092 - # Generate a ._cfg file even if the target file
1093 - # does not exist, ensuring that the user will
1094 - # notice the config change.
1095 - local basename=${1##*/}
1096 - local dirname=${1%/*}
1097 - local i=0
1098 - while true ; do
1099 - local filename=$(
1100 - echo -n "${dirname}/._cfg"
1101 - printf "%04d" ${i}
1102 - echo -n "_${basename}"
1103 - )
1104 - [[ -e ${filename} ]] || break
1105 - (( i++ ))
1106 - done
1107 - echo "${filename}"
1108 -}
1109 -
1110 -pkg_postinst() {
1111 -
1112 - if [[ -n ${REPOS_CONF_UPGRADE} ]] ; then
1113 - einfo "Generating repos.conf"
1114 - local repo_name=
1115 - [[ -f ${PORTDIR}/profiles/repo_name ]] && \
1116 - repo_name=$(< "${PORTDIR}/profiles/repo_name")
1117 - if [[ -z ${REPOS_CONF_SYNC} ]] ; then
1118 - REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
1119 - REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
1120 - fi
1121 - local sync_type=
1122 - [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
1123 -
1124 - if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
1125 - sync_type=cvs
1126 - REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
1127 - fi
1128 -
1129 - cat <<-EOF > "${T}/repos.conf"
1130 - [DEFAULT]
1131 - main-repo = ${repo_name:-gentoo}
1132 -
1133 - [${repo_name:-gentoo}]
1134 - location = ${PORTDIR:-${EPREFIX}/usr/portage}
1135 - sync-type = ${sync_type:-rsync}
1136 - sync-uri = ${REPOS_CONF_SYNC}
1137 - EOF
1138 -
1139 - [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
1140 -
1141 - local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
1142 - if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
1143 - dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
1144 - fi
1145 - # Don't install the config update if the desired repos.conf directory
1146 - # and config file exist, since users may accept it blindly and break
1147 - # their config (bug #478726).
1148 - [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
1149 - mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
1150 -
1151 - if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
1152 - einfo "Generating make.conf PORTDIR setting for backward compatibility"
1153 - for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
1154 - [[ -e ${dest} ]] && break
1155 - done
1156 - [[ -d ${dest} ]] && dest=${dest}/portdir.conf
1157 - rm -rf "${T}/make.conf"
1158 - [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
1159 - cat <<-EOF >> "${T}/make.conf"
1160 -
1161 - # Set PORTDIR for backward compatibility with various tools:
1162 - # gentoo-bashcomp - bug #478444
1163 - # euse - bug #474574
1164 - # euses and ufed - bug #478318
1165 - PORTDIR="${EPREFIX}/usr/portage"
1166 - EOF
1167 - mkdir -p "${dest%/*}"
1168 - mv "${T}/make.conf" "$(new_config_protect "${dest}")"
1169 - fi
1170 - fi
1171 -
1172 - pushd "${EROOT}var/db/pkg" > /dev/null
1173 - local didwork=
1174 - [[ ! -e "${EROOT}"var/lib/portage/preserved_libs_registry ]] && for cpv in */*/NEEDED ; do
1175 - if [[ ${CHOST} == *-darwin* && ! -f ${cpv}.MACHO.3 ]] ; then
1176 - while read line; do
1177 - scanmacho -BF "%a;%F;%S;%n" ${line% *} >> "${cpv}".MACHO.3
1178 - done < "${cpv}"
1179 - [[ -z ${didwork} ]] \
1180 - && didwork=yes \
1181 - || didwork=already
1182 - elif [[ ${CHOST} != *-darwin* && ${CHOST} != *-interix* && ! -f ${cpv}.ELF.2 ]] ; then
1183 - while read line; do
1184 - filename=${line% *}
1185 - needed=${line#* }
1186 - newline=$(scanelf -BF "%a;%F;%S;$needed;%r" $filename)
1187 - echo "${newline:3}" >> "${cpv}".ELF.2
1188 - done < "${cpv}"
1189 - [[ -z ${didwork} ]] \
1190 - && didwork=yes \
1191 - || didwork=already
1192 - fi
1193 - [[ ${didwork} == yes ]] && \
1194 - einfo "converting NEEDED files to new syntax, please wait"
1195 - done
1196 - popd > /dev/null
1197 -
1198 - if [[ ${EAPIPREFIX_UPGRADE} == 0 ]] ; then
1199 - local eapi
1200 - einfo 'removing EAPI="prefix" legacy from your vdb, please wait'
1201 - pushd "${EROOT}var/db/pkg" > /dev/null
1202 - for cpv in */* ; do
1203 - [[ ${cpv##*/} == "-MERGING-"* ]] && continue
1204 - # remove "prefix" from EAPI file
1205 - eapi=$(<"${cpv}"/EAPI)
1206 - eapi=${eapi/prefix/}
1207 - eapi=${eapi# }
1208 - eapi=${eapi:-0}
1209 - echo ${eapi} > "${cpv}"/EAPI
1210 - # remove "prefix" from EAPI in stored environment
1211 - bzcat "${cpv}"/environment.bz2 \
1212 - | sed -e "s/EAPI=\([\"']\)prefix [0-9][\"']/EAPI=\1${eapi}\1/" \
1213 - | bzip2 -9 > "${cpv}"/environment2.bz2 \
1214 - && mv -f "${cpv}"/environment{2,}.bz2
1215 - # remove "prefix" from the stored ebuild
1216 - sed -i -e "s/^EAPI=.*$/EAPI=${eapi}/" "${cpv}/${cpv##*/}.ebuild"
1217 - done
1218 - popd > /dev/null
1219 - fi
1220 -}
1221
1222 diff --git a/sys-apps/portage/portage-2.2.14.ebuild b/sys-apps/portage/portage-2.2.14.ebuild
1223 deleted file mode 100644
1224 index bad816d..0000000
1225 --- a/sys-apps/portage/portage-2.2.14.ebuild
1226 +++ /dev/null
1227 @@ -1,582 +0,0 @@
1228 -# Copyright 1999-2014 Gentoo Foundation
1229 -# Distributed under the terms of the GNU General Public License v2
1230 -# $Id: portage-2.2.01.16270.ebuild 58665 2010-09-05 19:54:38Z grobian $
1231 -
1232 -# Require EAPI 2 since we now require at least python-2.6 (for python 3
1233 -# syntax support) which also requires EAPI 2.
1234 -EAPI=3
1235 -PYTHON_COMPAT=(
1236 - pypy1_9 pypy2_0
1237 - python3_1 python3_2 python3_3 python3_4
1238 - python2_6 python2_7
1239 -)
1240 -inherit eutils multilib
1241 -
1242 -DESCRIPTION="Prefix branch of the Portage Package Manager, used in Gentoo Prefix"
1243 -HOMEPAGE="http://www.gentoo.org/proj/en/gentoo-alt/prefix/"
1244 -LICENSE="GPL-2"
1245 -KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1246 -SLOT="0"
1247 -IUSE="build doc epydoc +ipc linguas_ru pypy2_0 python2 python3 selinux xattr prefix-chaining"
1248 -
1249 -for _pyimpl in ${PYTHON_COMPAT[@]} ; do
1250 - IUSE+=" python_targets_${_pyimpl}"
1251 -done
1252 -unset _pyimpl
1253 -
1254 -# Import of the io module in python-2.6 raises ImportError for the
1255 -# thread module if threading is disabled.
1256 -python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
1257 - !pypy2_0? ( !python2? ( !python3? (
1258 - || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
1259 - ) ) )
1260 - pypy2_0? ( !python2? ( !python3? ( dev-python/pypy:2.0[bzip2,ssl] ) ) )
1261 - python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
1262 -python_dep="${python_dep_ssl//\[ssl\]}"
1263 -python_dep="${python_dep//,ssl}"
1264 -python_dep="${python_dep//ssl,}"
1265 -
1266 -python_dep="${python_dep}
1267 - python_targets_pypy1_9? ( dev-python/pypy:1.9 )
1268 - python_targets_pypy2_0? ( dev-python/pypy:2.0 )
1269 - python_targets_python2_6? ( dev-lang/python:2.6 )
1270 - python_targets_python2_7? ( dev-lang/python:2.7 )
1271 - python_targets_python3_1? ( dev-lang/python:3.1 )
1272 - python_targets_python3_2? ( dev-lang/python:3.2 )
1273 - python_targets_python3_3? ( dev-lang/python:3.3 )
1274 - python_targets_python3_4? ( dev-lang/python:3.4 )
1275 -"
1276 -
1277 -# The pysqlite blocker is for bug #282760.
1278 -# make-3.82 is for bug #455858
1279 -DEPEND="${python_dep}
1280 - >=sys-devel/make-3.82
1281 - >=sys-apps/sed-4.0.5 sys-devel/patch
1282 - doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
1283 - epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
1284 -# Require sandbox-2.2 for bug #288863.
1285 -# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
1286 -# quite slow, so it's not considered in the dependencies as an alternative to
1287 -# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
1288 -# for now, don't pull in xattr deps for other kernels.
1289 -# For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
1290 -# For compgen, require bash[readline] (bug #445576).
1291 -# bash-4.1 necessary for redirect_alloc_fd, which fails on non-Linux if bash
1292 -# doesn't have a builtin for finding a random filedescriptor
1293 -RDEPEND="${python_dep}
1294 - !build? ( >=sys-apps/sed-4.0.5
1295 - || ( >=app-shells/bash-4.2_p37[readline] ( <app-shells/bash-4.2_p37 >=app-shells/bash-4.1 ) )
1296 - >=app-admin/eselect-1.2
1297 - || ( ${python_dep_ssl} dev-python/python-mhash )
1298 - )
1299 - elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
1300 - elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1301 - elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1302 - kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
1303 - kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
1304 - kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
1305 - kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
1306 - kernel_HPUX? ( !hppa-hpux? ( >=app-misc/pax-utils-0.1.19 ) )
1307 - kernel_AIX? ( >=sys-apps/aix-miscutils-0.1.1634 )
1308 - xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) )
1309 - selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
1310 - !<app-shells/bash-3.2_p17
1311 - !prefix? ( !<app-admin/logrotate-3.8.0 )"
1312 -PDEPEND="
1313 - !build? (
1314 - >=net-misc/rsync-2.6.4
1315 - userland_GNU? ( >=sys-apps/coreutils-6.4 )
1316 - )"
1317 -# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
1318 -# NOTE: FEATURES=installsources requires debugedit and rsync
1319 -
1320 -SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives http://dev.gentoo.org/~grobian/distfiles"
1321 -
1322 -prefix_src_archives() {
1323 - local x y
1324 - for x in ${@}; do
1325 - for y in ${SRC_ARCHIVES}; do
1326 - echo ${y}/${x}
1327 - done
1328 - done
1329 -}
1330 -
1331 -PV_PL="2.1.2"
1332 -PATCHVER_PL=""
1333 -TARBALL_PV="${PV}"
1334 -SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
1335 - $(prefix_src_archives prefix-${PN}-${TARBALL_PV}.tar.bz2)"
1336 -
1337 -PATCHVER=
1338 -[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
1339 -if [ -n "${PATCHVER}" ]; then
1340 - SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
1341 - $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
1342 -fi
1343 -
1344 -S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
1345 -S_PL="${WORKDIR}"/${PN}-${PV_PL}
1346 -
1347 -compatible_python_is_selected() {
1348 - [[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
1349 -}
1350 -
1351 -current_python_has_xattr() {
1352 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
1353 - local PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
1354 - [[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
1355 - "${PYTHON}" -c 'import xattr' 2>/dev/null
1356 -}
1357 -
1358 -call_with_python_impl() {
1359 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
1360 - env EPYTHON=${EPYTHON} "$@"
1361 -}
1362 -
1363 -get_python_interpreter() {
1364 - [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
1365 - local impl=$1 python
1366 - case "${impl}" in
1367 - python*)
1368 - python=${impl/_/.}
1369 - ;;
1370 - pypy*)
1371 - python=${impl/_/.}
1372 - python=${python/pypy/pypy-c}
1373 - ;;
1374 - *)
1375 - die "Unrecognized python target: ${impl}"
1376 - esac
1377 - echo ${python}
1378 -}
1379 -
1380 -get_python_sitedir() {
1381 - [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
1382 - local impl=$1
1383 - local site_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages
1384 - [[ -d ${EROOT}${site_dir} ]] || \
1385 - ewarn "site-packages dir missing for ${impl}: ${EROOT}${site_dir}"
1386 - echo "${site_dir}"
1387 -}
1388 -
1389 -python_compileall() {
1390 - [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
1391 - local d=${EPREFIX}$1 PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
1392 - local d_image=${D}${d#/}
1393 - [[ -d ${d_image} ]] || die "directory does not exist: ${d_image}"
1394 - case "${EPYTHON}" in
1395 - python*)
1396 - "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
1397 - # Note: Using -OO breaks emaint, since it requires __doc__,
1398 - # and __doc__ is None when -OO is used.
1399 - "${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die
1400 - ;;
1401 - pypy*)
1402 - "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
1403 - ;;
1404 - *)
1405 - die "Unrecognized EPYTHON value: ${EPYTHON}"
1406 - esac
1407 -}
1408 -
1409 -pkg_setup() {
1410 - if use python2 && use python3 ; then
1411 - ewarn "Both python2 and python3 USE flags are enabled, but only one"
1412 - ewarn "can be in the shebangs. Using python3."
1413 - fi
1414 - if use pypy2_0 && use python3 ; then
1415 - ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one"
1416 - ewarn "can be in the shebangs. Using python3."
1417 - fi
1418 - if use pypy2_0 && use python2 ; then
1419 - ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one"
1420 - ewarn "can be in the shebangs. Using python2"
1421 - fi
1422 - if ! use pypy2_0 && ! use python2 && ! use python3 && \
1423 - ! compatible_python_is_selected ; then
1424 - ewarn "Attempting to select a compatible default python interpreter"
1425 - local x success=0
1426 - for x in "${EPREFIX}"/usr/bin/python2.* ; do
1427 - x=${x#${EPREFIX}/usr/bin/python2.}
1428 - if [[ $x -ge 6 ]] 2>/dev/null ; then
1429 - eselect python set python2.$x
1430 - if compatible_python_is_selected ; then
1431 - elog "Default python interpreter is now set to python-2.$x"
1432 - success=1
1433 - break
1434 - fi
1435 - fi
1436 - done
1437 - if [ $success != 1 ] ; then
1438 - eerror "Unable to select a compatible default python interpreter!"
1439 - die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
1440 - fi
1441 - fi
1442 -
1443 - # We use EPYTHON to designate the active python interpreter,
1444 - # but we only export when needed, via call_with_python_impl.
1445 - EPYTHON=python
1446 - export -n EPYTHON
1447 - if use python3; then
1448 - EPYTHON=python3
1449 - elif use python2; then
1450 - EPYTHON=python2
1451 - elif use pypy2_0; then
1452 - EPYTHON=pypy-c2.0
1453 - fi
1454 -}
1455 -
1456 -src_prepare() {
1457 - if [ -n "${PATCHVER}" ] ; then
1458 - if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
1459 - rm "$S/bin/ebuild-helpers/portageq" \
1460 - || die "failed to remove portageq helper symlink"
1461 - fi
1462 - epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
1463 - fi
1464 -
1465 - use prefix-chaining && epatch "${FILESDIR}"/${PN}-2.2.00.15801-prefix-chaining.patch
1466 - epatch "${FILESDIR}"/${PN}-2.2.8-ebuildshell.patch # 155161
1467 -
1468 - if ! use ipc ; then
1469 - einfo "Disabling ipc..."
1470 - sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
1471 - -i pym/_emerge/AbstractEbuildProcess.py || \
1472 - die "failed to patch AbstractEbuildProcess.py"
1473 - fi
1474 -
1475 - if use xattr && use kernel_linux ; then
1476 - einfo "Adding FEATURES=xattr to make.globals ..."
1477 - echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
1478 - || die "failed to append to make.globals"
1479 - fi
1480 -
1481 - local set_shebang=
1482 - if use python3; then
1483 - set_shebang=python3
1484 - elif use python2; then
1485 - set_shebang=python2
1486 - elif use pypy2_0; then
1487 - set_shebang=pypy-c2.0
1488 - fi
1489 - if [[ -n ${set_shebang} ]] ; then
1490 - einfo "Converting shebangs for ${set_shebang}..."
1491 - while read -r -d $'\0' ; do
1492 - local shebang=$(head -n1 "$REPLY")
1493 - if [[ ${shebang} == "#!${EPREFIX}/usr/bin/python"* ]] ; then
1494 - sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \
1495 - die "sed failed"
1496 - fi
1497 - done < <(find . -type f -print0)
1498 - fi
1499 -
1500 - # "native" Prefix still uses configure
1501 - if use !prefix && [[ -n ${EPREFIX} ]] ; then
1502 - einfo "Setting portage.const.EPREFIX ..."
1503 - sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
1504 - -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
1505 - -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
1506 - -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
1507 - -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
1508 - -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
1509 - -i pym/portage/const.py || \
1510 - die "Failed to patch portage.const.EPREFIX"
1511 -
1512 - einfo "Prefixing shebangs ..."
1513 - while read -r -d $'\0' ; do
1514 - local shebang=$(head -n1 "$REPLY")
1515 - if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
1516 - sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
1517 - die "sed failed"
1518 - fi
1519 - done < <(find . -type f -print0)
1520 -
1521 - einfo "Adding FEATURES=force-prefix to make.globals ..."
1522 - echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
1523 - || die "failed to append to make.globals"
1524 - fi
1525 -
1526 - if use !prefix ; then
1527 - cd "${S}/cnf" || die
1528 - if [ -f "make.conf.${ARCH}".diff ]; then
1529 - patch make.conf "make.conf.${ARCH}".diff || \
1530 - die "Failed to patch make.conf.example"
1531 - else
1532 - eerror ""
1533 - eerror "Portage does not have an arch-specific configuration for this arch."
1534 - eerror "Please notify the arch maintainer about this issue. Using generic."
1535 - eerror ""
1536 - fi
1537 - fi
1538 -}
1539 -
1540 -src_configure() {
1541 - if use prefix ; then
1542 - local extrapath="/usr/bin:/bin"
1543 - # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as people
1544 - # tend not to update that often, as long as we are a separate ebuild
1545 - # we can assume when unset, it's time for some older trick
1546 - if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
1547 - PORTAGE_ROOT_USER=$(python -c 'from portage.const import rootuser; print rootuser')
1548 - fi
1549 - # lazy check, but works for now
1550 - if [[ ${PORTAGE_ROOT_USER} == "root" ]] ; then
1551 - # we need this for e.g. mtree on FreeBSD (and Darwin) which is in
1552 - # /usr/sbin
1553 - extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
1554 - fi
1555 -
1556 - econf \
1557 - --with-portage-user="${PORTAGE_USER:-portage}" \
1558 - --with-portage-group="${PORTAGE_GROUP:-portage}" \
1559 - --with-root-user="${PORTAGE_ROOT_USER}" \
1560 - --with-offset-prefix="${EPREFIX}" \
1561 - --with-extra-path="${extrapath}" \
1562 - || die "econf failed"
1563 - else
1564 - default
1565 - fi
1566 -}
1567 -
1568 -src_compile() {
1569 - if use prefix ; then
1570 - emake || die "emake failed"
1571 - fi
1572 -
1573 - if use doc; then
1574 - call_with_python_impl \
1575 - emake docbook || die
1576 - fi
1577 -
1578 - if use epydoc; then
1579 - einfo "Generating api docs"
1580 - call_with_python_impl \
1581 - emake epydoc || die
1582 - fi
1583 -}
1584 -
1585 -src_test() {
1586 - # make files executable, in case they were created by patch
1587 - find bin -type f | xargs chmod +x
1588 - call_with_python_impl \
1589 - emake test || die
1590 -}
1591 -
1592 -src_install() {
1593 - local portage_base="/usr/lib/portage"
1594 -
1595 - emake DESTDIR="${D}" install || die "make install failed."
1596 - dodir /usr/lib/portage/bin
1597 -
1598 - if use userland_GNU; then
1599 - rm "${ED}"${portage_base}/bin/ebuild-helpers/bsd/sed || die "Failed to remove sed wrapper"
1600 - fi
1601 -
1602 - use doc && dohtml -r "${S}"/doc/*
1603 - use epydoc && dohtml -r "${WORKDIR}"/api
1604 - dodir /etc/portage
1605 - keepdir /etc/portage
1606 -
1607 - # Use dodoc for compression, since the Makefile doesn't do that.
1608 - dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
1609 -
1610 - # Allow external portage API consumers to import portage python modules
1611 - # (this used to be done with PYTHONPATH setting in /etc/env.d).
1612 - # For each of PYTHON_TARGETS, install a tree of *.py symlinks in
1613 - # site-packages, and compile with the corresponding interpreter.
1614 - local impl files mod_dir dest_mod_dir python relative_path x
1615 - for impl in "${PYTHON_COMPAT[@]}" ; do
1616 - use "python_targets_${impl}" || continue
1617 - if use build && [[ ${ROOT} == / &&
1618 - ! -x ${EPREFIX}/usr/bin/$(get_python_interpreter ${impl}) ]] ; then
1619 - # Tolerate --nodeps at beginning of stage1 for catalyst
1620 - ewarn "skipping python_targets_${impl}, interpreter not found"
1621 - continue
1622 - fi
1623 - while read -r mod_dir ; do
1624 - cd "${ED}/usr/lib/portage/pym/${mod_dir}" || die
1625 - files=$(echo *.py)
1626 - if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then
1627 - # __pycache__ directories contain no py files
1628 - continue
1629 - fi
1630 - dest_mod_dir=$(get_python_sitedir ${impl})/${mod_dir}
1631 - dodir "${dest_mod_dir}" || die
1632 - relative_path=../../../lib/portage/pym/${mod_dir}
1633 - x=/${mod_dir}
1634 - while [ -n "${x}" ] ; do
1635 - relative_path=../${relative_path}
1636 - x=${x%/*}
1637 - done
1638 - for x in ${files} ; do
1639 - dosym "${relative_path}/${x}" \
1640 - "${dest_mod_dir}/${x}" || die
1641 - done
1642 - done < <(cd "${ED}"/usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*")
1643 - cd "${S}" || die
1644 - EPYTHON=$(get_python_interpreter ${impl}) \
1645 - python_compileall "$(get_python_sitedir ${impl})"
1646 - done
1647 -
1648 - # Compile /usr/lib/portage/pym with the active interpreter, since portage
1649 - # internal commands force this directory to the beginning of sys.path.
1650 - python_compileall /usr/lib/portage/pym
1651 -}
1652 -
1653 -pkg_preinst() {
1654 - if [[ $ROOT == / ]] ; then
1655 - # Run some minimal tests as a sanity check.
1656 - local test_runner=$(find "$ED" -name runTests)
1657 - if [[ -n $test_runner && -x $test_runner ]] ; then
1658 - einfo "Running preinst sanity tests..."
1659 - "$test_runner" || die "preinst sanity tests failed"
1660 - fi
1661 - fi
1662 -
1663 - if use xattr && ! current_python_has_xattr ; then
1664 - ewarn "For optimal performance in xattr handling, install"
1665 - ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
1666 - ewarn "enable USE=python3 for $CATEGORY/$PN."
1667 - fi
1668 -
1669 - has_version "<=${CATEGORY}/${PN}-2.2.00.13346"
1670 - EAPIPREFIX_UPGRADE=$?
1671 -
1672 - if has_version "<${CATEGORY}/${PN}-2.2.7-r1" ; then
1673 - REPOS_CONF_UPGRADE=true
1674 - REPOS_CONF_SYNC=
1675 - type -P portageq >/dev/null 2>&1 && \
1676 - REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
1677 - fi
1678 -}
1679 -
1680 -new_config_protect() {
1681 - # Generate a ._cfg file even if the target file
1682 - # does not exist, ensuring that the user will
1683 - # notice the config change.
1684 - local basename=${1##*/}
1685 - local dirname=${1%/*}
1686 - local i=0
1687 - while true ; do
1688 - local filename=$(
1689 - echo -n "${dirname}/._cfg"
1690 - printf "%04d" ${i}
1691 - echo -n "_${basename}"
1692 - )
1693 - [[ -e ${filename} ]] || break
1694 - (( i++ ))
1695 - done
1696 - echo "${filename}"
1697 -}
1698 -
1699 -pkg_postinst() {
1700 -
1701 - if [[ -n ${REPOS_CONF_UPGRADE} ]] ; then
1702 - einfo "Generating repos.conf"
1703 - local repo_name=
1704 - [[ -f ${PORTDIR}/profiles/repo_name ]] && \
1705 - repo_name=$(< "${PORTDIR}/profiles/repo_name")
1706 - if [[ -z ${REPOS_CONF_SYNC} ]] ; then
1707 - REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
1708 - REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
1709 - fi
1710 - local sync_type=
1711 - [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
1712 -
1713 - if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
1714 - sync_type=cvs
1715 - REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
1716 - fi
1717 -
1718 - cat <<-EOF > "${T}/repos.conf"
1719 - [DEFAULT]
1720 - main-repo = ${repo_name:-gentoo}
1721 -
1722 - [${repo_name:-gentoo}]
1723 - location = ${PORTDIR:-${EPREFIX}/usr/portage}
1724 - sync-type = ${sync_type:-rsync}
1725 - sync-uri = ${REPOS_CONF_SYNC}
1726 - EOF
1727 -
1728 - [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
1729 -
1730 - local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
1731 - if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
1732 - dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
1733 - fi
1734 - # Don't install the config update if the desired repos.conf directory
1735 - # and config file exist, since users may accept it blindly and break
1736 - # their config (bug #478726).
1737 - [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
1738 - mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
1739 -
1740 - if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
1741 - einfo "Generating make.conf PORTDIR setting for backward compatibility"
1742 - for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
1743 - [[ -e ${dest} ]] && break
1744 - done
1745 - [[ -d ${dest} ]] && dest=${dest}/portdir.conf
1746 - rm -rf "${T}/make.conf"
1747 - [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
1748 - cat <<-EOF >> "${T}/make.conf"
1749 -
1750 - # Set PORTDIR for backward compatibility with various tools:
1751 - # gentoo-bashcomp - bug #478444
1752 - # euse - bug #474574
1753 - # euses and ufed - bug #478318
1754 - PORTDIR="${EPREFIX}/usr/portage"
1755 - EOF
1756 - mkdir -p "${dest%/*}"
1757 - mv "${T}/make.conf" "$(new_config_protect "${dest}")"
1758 - fi
1759 - fi
1760 -
1761 - pushd "${EROOT}var/db/pkg" > /dev/null
1762 - local didwork=
1763 - [[ ! -e "${EROOT}"var/lib/portage/preserved_libs_registry ]] && for cpv in */*/NEEDED ; do
1764 - if [[ ${CHOST} == *-darwin* && ! -f ${cpv}.MACHO.3 ]] ; then
1765 - while read line; do
1766 - scanmacho -BF "%a;%F;%S;%n" ${line% *} >> "${cpv}".MACHO.3
1767 - done < "${cpv}"
1768 - [[ -z ${didwork} ]] \
1769 - && didwork=yes \
1770 - || didwork=already
1771 - elif [[ ${CHOST} != *-darwin* && ${CHOST} != *-interix* && ! -f ${cpv}.ELF.2 ]] ; then
1772 - while read line; do
1773 - filename=${line% *}
1774 - needed=${line#* }
1775 - newline=$(scanelf -BF "%a;%F;%S;$needed;%r" $filename)
1776 - echo "${newline:3}" >> "${cpv}".ELF.2
1777 - done < "${cpv}"
1778 - [[ -z ${didwork} ]] \
1779 - && didwork=yes \
1780 - || didwork=already
1781 - fi
1782 - [[ ${didwork} == yes ]] && \
1783 - einfo "converting NEEDED files to new syntax, please wait"
1784 - done
1785 - popd > /dev/null
1786 -
1787 - if [[ ${EAPIPREFIX_UPGRADE} == 0 ]] ; then
1788 - local eapi
1789 - einfo 'removing EAPI="prefix" legacy from your vdb, please wait'
1790 - pushd "${EROOT}var/db/pkg" > /dev/null
1791 - for cpv in */* ; do
1792 - [[ ${cpv##*/} == "-MERGING-"* ]] && continue
1793 - # remove "prefix" from EAPI file
1794 - eapi=$(<"${cpv}"/EAPI)
1795 - eapi=${eapi/prefix/}
1796 - eapi=${eapi# }
1797 - eapi=${eapi:-0}
1798 - echo ${eapi} > "${cpv}"/EAPI
1799 - # remove "prefix" from EAPI in stored environment
1800 - bzcat "${cpv}"/environment.bz2 \
1801 - | sed -e "s/EAPI=\([\"']\)prefix [0-9][\"']/EAPI=\1${eapi}\1/" \
1802 - | bzip2 -9 > "${cpv}"/environment2.bz2 \
1803 - && mv -f "${cpv}"/environment{2,}.bz2
1804 - # remove "prefix" from the stored ebuild
1805 - sed -i -e "s/^EAPI=.*$/EAPI=${eapi}/" "${cpv}/${cpv##*/}.ebuild"
1806 - done
1807 - popd > /dev/null
1808 - fi
1809 -}
1810
1811 diff --git a/sys-apps/portage/portage-2.2.27.ebuild b/sys-apps/portage/portage-2.2.27.ebuild
1812 new file mode 100644
1813 index 0000000..50bb724
1814 --- /dev/null
1815 +++ b/sys-apps/portage/portage-2.2.27.ebuild
1816 @@ -0,0 +1,247 @@
1817 +# Copyright 1999-2016 Gentoo Foundation
1818 +# Distributed under the terms of the GNU General Public License v2
1819 +# $Id$
1820 +
1821 +EAPI=5
1822 +
1823 +PYTHON_COMPAT=(
1824 + pypy
1825 + python3_3 python3_4 python3_5
1826 + python2_7
1827 +)
1828 +PYTHON_REQ_USE='bzip2(+)'
1829 +
1830 +inherit eutils distutils-r1 multilib
1831 +
1832 +DESCRIPTION="Portage package manager used in Gentoo Prefix"
1833 +HOMEPAGE="http://prefix.gentoo.org/"
1834 +LICENSE="GPL-2"
1835 +KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1836 +SLOT="0"
1837 +IUSE="build doc epydoc +ipc linguas_ru selinux xattr prefix-chaining"
1838 +
1839 +DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
1840 + >=sys-devel/make-3.82
1841 + >=app-arch/tar-1.27
1842 + dev-lang/python-exec:2
1843 + >=sys-apps/sed-4.0.5 sys-devel/patch
1844 + doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
1845 + epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
1846 +# Require sandbox-2.2 for bug #288863.
1847 +# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
1848 +# quite slow, so it's not considered in the dependencies as an alternative to
1849 +# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
1850 +# for now, don't pull in xattr deps for other kernels.
1851 +# For whirlpool hash, require python[ssl] (bug #425046).
1852 +# For compgen, require bash[readline] (bug #445576).
1853 +RDEPEND="
1854 + >=app-arch/tar-1.27
1855 + dev-lang/python-exec:2
1856 + !build? (
1857 + >=sys-apps/sed-4.0.5
1858 + app-shells/bash:0[readline]
1859 + >=app-admin/eselect-1.2
1860 + )
1861 + elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
1862 + elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1863 + elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1864 + kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
1865 + kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
1866 + kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
1867 + kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
1868 + kernel_HPUX? ( !hppa-hpux? ( >=app-misc/pax-utils-0.1.19 ) )
1869 + kernel_AIX? ( >=sys-apps/aix-miscutils-0.1.1634 )
1870 + selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
1871 + xattr? ( kernel_linux? (
1872 + >=sys-apps/install-xattr-0.3
1873 + $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
1874 + python2_7 pypy)
1875 + ) )
1876 + !prefix? ( !<app-admin/logrotate-3.8.0 )"
1877 +PDEPEND="
1878 + !build? (
1879 + >=net-misc/rsync-2.6.4
1880 + userland_GNU? ( >=sys-apps/coreutils-6.4 )
1881 + )"
1882 +# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
1883 +# NOTE: FEATURES=installsources requires debugedit and rsync
1884 +
1885 +REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
1886 +
1887 +SRC_ARCHIVES="https://dev.gentoo.org/~dolsen/releases/portage http://dev.gentoo.org/~grobian/distfiles"
1888 +
1889 +SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives http://dev.gentoo.org/~grobian/distfiles"
1890 +
1891 +prefix_src_archives() {
1892 + local x y
1893 + for x in ${@}; do
1894 + for y in ${SRC_ARCHIVES}; do
1895 + echo ${y}/${x}
1896 + done
1897 + done
1898 +}
1899 +
1900 +TARBALL_PV=${PV}
1901 +SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
1902 + $(prefix_src_archives prefix-${PN}-${TARBALL_PV}.tar.bz2)"
1903 +
1904 +S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
1905 +
1906 +pkg_setup() {
1907 + use epydoc && DISTUTILS_ALL_SUBPHASE_IMPLS=( python2.7 )
1908 +}
1909 +
1910 +python_prepare() {
1911 + distutils-r1_python_prepare_all
1912 +
1913 + epatch "${FILESDIR}"/${PN}-2.2.8-ebuildshell.patch # 155161
1914 +
1915 + if ! use ipc ; then
1916 + einfo "Disabling ipc..."
1917 + sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
1918 + -i pym/_emerge/AbstractEbuildProcess.py || \
1919 + die "failed to patch AbstractEbuildProcess.py"
1920 + fi
1921 +
1922 + if use xattr && use kernel_linux ; then
1923 + einfo "Adding FEATURES=xattr to make.globals ..."
1924 + echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
1925 + || die "failed to append to make.globals"
1926 + fi
1927 +
1928 + if [[ -n ${EPREFIX} ]] ; then
1929 + # PREFIX LOCAL: only hack const_autotool
1930 + local extrapath="/usr/bin:/bin"
1931 + # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as people
1932 + # tend not to update that often, as long as we are a separate ebuild
1933 + # we can assume when unset, it's time for some older trick
1934 + if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
1935 + PORTAGE_ROOT_USER=$(python -c 'from portage.const import rootuser; print rootuser')
1936 + fi
1937 + # lazy check, but works for now
1938 + if [[ ${PORTAGE_ROOT_USER} == "root" ]] ; then
1939 + # we need this for e.g. mtree on FreeBSD (and Darwin) which is in
1940 + # /usr/sbin
1941 + extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
1942 + fi
1943 + local defaultpath="${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin"
1944 +
1945 + einfo "Adjusting sources for ${EPREFIX}"
1946 + find . -type f -exec \
1947 + sed -e "s|@PORTAGE_EPREFIX@|${EPREFIX}|" \
1948 + -e "s|@PORTAGE_BASE@|${EPREFIX}/usr/lib/portage/${EPYTHON}|" \
1949 + -e "s|@PORTAGE_MV@|$(type -P mv)|" \
1950 + -e "s|@PORTAGE_BASH@|${BASH}|" \
1951 + -e "s|@PREFIX_PORTAGE_PYTHON@|$(type -P python)|" \
1952 + -e "s|@DEFAULT_PATH@|${defaultpath}|" \
1953 + -e "s|@EXTRA_PATH@|${extrapath}|" \
1954 + -e "s|@portagegroup@|${PORTAGE_GROUP:-portage}|" \
1955 + -e "s|@portageuser@|${PORTAGE_USER:-portage}|" \
1956 + -e "s|@rootuser@|${PORTAGE_ROOT_USER:-root}|" \
1957 + -e "s|@rootuid@|$(id -u ${PORTAGE_ROOT_USER:-root})|" \
1958 + -e "s|@rootgid@|$(id -g ${PORTAGE_ROOT_USER:-root})|" \
1959 + -e "s|@sysconfdir@|${EPREFIX}/etc|" \
1960 + -i '{}' + || \
1961 + die "Failed to patch sources"
1962 +
1963 + # remove Makefiles, or else they will get installed
1964 + find . -name "Makefile.*" -delete
1965 +
1966 + einfo "Prefixing shebangs ..."
1967 + while read -r -d $'\0' ; do
1968 + local shebang=$(head -n1 "$REPLY")
1969 + if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
1970 + sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
1971 + die "sed failed"
1972 + fi
1973 + done < <(find . -type f -print0)
1974 + # END PREFIX LOCAL
1975 + fi
1976 +
1977 + # PREFIX LOCAL: make.conf is written by bootstrap-prefix.sh
1978 + if use !prefix ; then
1979 + cd "${S}/cnf" || die
1980 + if [ -f "make.conf.${ARCH}".diff ]; then
1981 + patch make.conf "make.conf.${ARCH}".diff || \
1982 + die "Failed to patch make.conf.example"
1983 + else
1984 + eerror ""
1985 + eerror "Portage does not have an arch-specific configuration for this arch."
1986 + eerror "Please notify the arch maintainer about this issue. Using generic."
1987 + eerror ""
1988 + fi
1989 + fi
1990 +}
1991 +
1992 +python_compile_all() {
1993 + local targets=()
1994 + use doc && targets+=( docbook )
1995 + use epydoc && targets+=( epydoc )
1996 +
1997 + if [[ ${targets[@]} ]]; then
1998 + esetup.py "${targets[@]}"
1999 + fi
2000 +}
2001 +
2002 +python_test() {
2003 + esetup.py test
2004 +}
2005 +
2006 +python_install() {
2007 + # Install sbin scripts to bindir for python-exec linking
2008 + # they will be relocated in pkg_preinst()
2009 + distutils-r1_python_install \
2010 + --system-prefix="${EPREFIX}/usr" \
2011 + --bindir="$(python_get_scriptdir)" \
2012 + --docdir="${EPREFIX}/usr/share/doc/${PF}" \
2013 + --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
2014 + --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
2015 + --sbindir="$(python_get_scriptdir)" \
2016 + --sysconfdir="${EPREFIX}/etc" \
2017 + "${@}"
2018 +}
2019 +
2020 +python_install_all() {
2021 + distutils-r1_python_install_all
2022 +
2023 + local targets=()
2024 + use doc && targets+=( install_docbook )
2025 + use epydoc && targets+=( install_epydoc )
2026 +
2027 + # install docs
2028 + if [[ ${targets[@]} ]]; then
2029 + esetup.py "${targets[@]}"
2030 + fi
2031 +
2032 + # Due to distutils/python-exec limitations
2033 + # these must be installed to /usr/bin.
2034 + local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
2035 + einfo "Moving admin scripts to the correct directory"
2036 + dodir /usr/sbin
2037 + for target in ${sbin_relocations}; do
2038 + einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
2039 + mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
2040 + done
2041 +}
2042 +
2043 +pkg_preinst() {
2044 + # comment out sanity test until it is fixed to work
2045 + # with the new PORTAGE_PYM_PATH
2046 + #if [[ $ROOT == / ]] ; then
2047 + ## Run some minimal tests as a sanity check.
2048 + #local test_runner=$(find "${ED}" -name runTests)
2049 + #if [[ -n $test_runner && -x $test_runner ]] ; then
2050 + #einfo "Running preinst sanity tests..."
2051 + #"$test_runner" || die "preinst sanity tests failed"
2052 + #fi
2053 + #fi
2054 +
2055 + # elog dir must exist to avoid logrotate error for bug #415911.
2056 + # This code runs in preinst in order to bypass the mapping of
2057 + # portage:portage to root:root which happens after src_install.
2058 + keepdir /var/log/portage/elog
2059 + # This is allowed to fail if the user/group are invalid for prefix users.
2060 + if chown ${PORTAGE_USER}:${PORTAGE_GROUP} "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
2061 + chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
2062 + fi
2063 +}