summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-03-22 02:43:12 +0000
committerZac Medico <zmedico@gentoo.org>2013-03-22 02:43:12 +0000
commit5fe7f051da546670b2ef0343c35d8e7077129276 (patch)
tree23c46e2f71a75065a635849c0c90ff526f6a1c6c /sys-apps
parent2.1.11.58 version bump. This fixes bug #462528 (emerge AttributeError (diff)
downloadhistorical-5fe7f051da546670b2ef0343c35d8e7077129276.tar.gz
historical-5fe7f051da546670b2ef0343c35d8e7077129276.tar.bz2
historical-5fe7f051da546670b2ef0343c35d8e7077129276.zip
2.2.0_alpha169 version bump. This includes all of the fixes in 2.1.11.58.
Bug #210077 tracks all bugs fixed since portage-2.1.x. Package-Manager: portage-2.2.0_alpha169/cvs/Linux i686 RepoMan-Options: --force Manifest-Sign-Key: 0xFDE8EF85AE5719A3
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/portage/ChangeLog8
-rw-r--r--sys-apps/portage/Manifest10
-rw-r--r--sys-apps/portage/portage-2.2.0_alpha169.ebuild387
3 files changed, 400 insertions, 5 deletions
diff --git a/sys-apps/portage/ChangeLog b/sys-apps/portage/ChangeLog
index 4c21a1ba467a..8ecc86b545e3 100644
--- a/sys-apps/portage/ChangeLog
+++ b/sys-apps/portage/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-apps/portage
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1231 2013/03/22 02:41:18 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1232 2013/03/22 02:43:09 zmedico Exp $
+
+*portage-2.2.0_alpha169 (22 Mar 2013)
+
+ 22 Mar 2013; Zac Medico <zmedico@gentoo.org> +portage-2.2.0_alpha169.ebuild:
+ 2.2.0_alpha169 version bump. This includes all of the fixes in 2.1.11.58. Bug
+ #210077 tracks all bugs fixed since portage-2.1.x.
*portage-2.1.11.58 (22 Mar 2013)
diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
index 1c4ce8bb45ff..6e389eeed0e1 100644
--- a/sys-apps/portage/Manifest
+++ b/sys-apps/portage/Manifest
@@ -14,6 +14,7 @@ DIST portage-2.2.0_alpha160.tar.bz2 895123 SHA256 25741e1a0cb2169008a20a3eda9966
DIST portage-2.2.0_alpha163.patch.bz2 28204 SHA256 f17b3e4a1af61c235922856399086928ad36fd07f5ae9639e8b1f68c1991b4bd SHA512 0797b2d875e14cfea1b28ab353d97f3f414d9214ab74bb654a4936e3d36bc89df02ab5b3c7111cc368ae8a8037fdc8d16bc842d5f97ce129789376c8da645059 WHIRLPOOL ee9c0849a2e319e0c0cbbc6039fd52eebe3bd7b500e6eddcf3a96361820011bbd6d1bbdc1ea6468cb4822dd7bba33f1ead7204e647628be7efeb0637b7c1400c
DIST portage-2.2.0_alpha166.tar.bz2 906770 SHA256 d73a78cb22f68db503fdc587ba594eacd871aa8f7e8d2bb909223d473fff4e55 SHA512 4b7ce8ec60546186fd26a1070dc02be23e4bd7f6b99f3abec7680e33fe1b98592d9fada27ba19f47d5954c919a3448e9cfb8198bd53b9f5dceb4ee03cf000c78 WHIRLPOOL f57158ed7d77e40e8673f5fa1088f4cd625fd1623ac6a5a80c4c69ead861ff12459d0b7b81ec836ff8b0f493bf3b3accf383803824b0e6402362bc5a466287e2
DIST portage-2.2.0_alpha168.patch.bz2 22408 SHA256 cdcf3170620a6e90ba60c0c106e3e3b9a02deb1a6528a4fe2b800aeade500e67 SHA512 c5afb408866435f1360cfff9003ffa64b435b311c2198509103f870f011fbb1c0ce22c5e5063087f40809ece29ce3fa0ca553c110cce2243c704e84cff5b0964 WHIRLPOOL 3b3ba5006651d67903d9c394ace1a793b7324b6ae38bf4d7be0be481f7dab8cf5641b8c32e7dd7296180fcc705ee7b68acf03e0bf9cafc887128482260584c9b
+DIST portage-2.2.0_alpha169.patch.bz2 26215 SHA256 76855492f86040fdc4f00f5cfbd93d971f4a610d259dc20864515af6e535495a SHA512 c9621cc9d1f6cf181105c923f618894ff4b0981d108eb90d3faa51a076f0db3a64398f2eb8d6365436f08264d33e08928bd96431dd24866de82409f0b5c74e04 WHIRLPOOL 87dc006c432c8200f68f781a0de58c8ebb9e0e9dea4f4a2291b1171ff2f26b364c5b05fd9ca546558f8c206cb6ab49fe6f585d665aa1eae1caca2f2457ec1285
DIST portage-man-pl-2.1.2.tar.bz2 53893 SHA256 960eaa7c6f3a2af44bdc665266a8e884628a562373cc477d301597ecc5ef961f SHA512 5f5c8dd1559048546633b1e7291ff8c0f5d637595f1a4c98405424b08c30c089fc9359e0214f78fbe358754f20d327794f4692b9b67639585c29b755975ee853 WHIRLPOOL 756e267b84077501d976f46fa448cda5368cd52aeca6ec43d109c81fe8e2364e0cd0f35630d68a4186c70e3b440b7c870b86ac7ef83cc0afa43e10f9f8e1f422
EBUILD portage-2.1.11.50.ebuild 9616 SHA256 0eaf9eaa380ebf11043b1c030868bf10b79899728a4d18ca5cb5889857024dd3 SHA512 95c10ce269a8c31ee0e00bcde04cfc352a2afbac6d1c90eb77f18e0fdae226107281d47cbfc11e84fc12b8a7b5e64e0cf2098d5eea2cdfd34254c944cb9e4f39 WHIRLPOOL b8ec608c2f1eaa4478b999a3594c03e6b5c0c6523c8bf88a5aeef8b8343d6d70c3d577b5dfcca187d3a7438b99bfce9584489b8fb2b94696e8e2a041907a8a2e
EBUILD portage-2.1.11.52.ebuild 9567 SHA256 e952a76873877a21553b4c5ded7ab29cdfc31ac292ce17c6e2d61c34c7eaddcc SHA512 42872e7d35d3b97d7e7cdeeccffa6e5e1586d565c8d52d4a595862f01eb93bde4625e919f08c0e353266ae930805f4a7ebc6f7f72f21024ff883838ec75733d1 WHIRLPOOL d694c2aa7770bcf5d1daa6f7d154c2dd3d1da3970f4eb1e30e10f325832163b71f462631837f2f5e1e66069e248861dabb46ad0a04e34e179e50c56417b69bda
@@ -24,14 +25,15 @@ EBUILD portage-2.1.6.7_p1.ebuild 8391 SHA256 aa62c9abf35aa31026863d881fcc47eab49
EBUILD portage-2.2.0_alpha163.ebuild 11683 SHA256 0cd72cc6d179853e7150c61f1e2c3a004e384dc23d29ad3c70787a11d337e074 SHA512 7e01187b35ac606a685c2ea5496d664c47a4472f867a9a94a5ee5732b0fe0195b448f8de76c5f6ae6d107ed3eb2d5b23ecbd1aeb15e27044d18027a68c43d2f2 WHIRLPOOL 2c111024ab5c0c540ff3bbce6ed540867e3e7e2fa5cba484b9f580e33f46205462a968cc5cc17a46711acf4364462fb32bd0dfb0f86b0933196bab909aa51456
EBUILD portage-2.2.0_alpha166.ebuild 11683 SHA256 7b541acbcb8b1a8f568ef5721f3f283610fbfa8c732fa918cb9d10e70951cd2c SHA512 9983918111149c20798c6fffce370f5be687ddd41f9a8c860a78753e859e9711579953a771e1c56d9c121bcf9542cac503b22afd87986138991e9b2d20da28a5 WHIRLPOOL dbe4910aebbb057aeb7e87eea873cb6bfbf0d8d0c62e12f516aa20d26dcdf6e0d333c1d6f7fedd20ea112381cbd864ad25075bb45f0eac17cdaaf118ccbfbdc8
EBUILD portage-2.2.0_alpha168.ebuild 11683 SHA256 80db116dfb2eb39781297f4f628656769eaba82b104170123328807dc41f6b4a SHA512 eb42b5e9ae405c8a6f0607a81662cd75aca88b1ed9f49f96f0df8c7ab2f72358a5560397a692a560d1301ae050c6edf1d0c404d0f4d4b68ab03e32bb1f2e39d5 WHIRLPOOL e677d747bce4c304f9c37f68153b69cabb5321bda6d5504f29b409fedeb44c16bf1f85c441ce2bed13a7fe864653c0b75ce7800dfc414812dfdca0aaf838f341
+EBUILD portage-2.2.0_alpha169.ebuild 13514 SHA256 4c854cc384e734710ae99ff1750d84bfe6b2f01eef58c617e1340d1250f058dc SHA512 b01f6f1dc148e52109ccdf235a5e19301c06a0875ac06f7668d0529af6b27b118e5d83eb8923c9f3d4c0e303d4b1a6d4dc95d30a7fee5bcfe8507fc3c0213b10 WHIRLPOOL 178c4c8642fa58dc232c6c42445fec04a6ba153c587dc9954d4b6344076022b54c95cbd397e6f8d1b8234ca36846329a27fc5466a5125de853a2a6510bba1ef3
EBUILD portage-9999.ebuild 12780 SHA256 72786014b61cc2fa53f136217d69158f69d769bf26e527bac2196331d38b186f SHA512 258d22f66e7ac0d35428430fdff8d2273b0de780c8807883eca3cabe9514bda281f5ef7314cabf429e410b836c44f539e1d513fcf53189cabde9bc6f6890d259 WHIRLPOOL 3d605197f80a1cd79f16a766c13f690933f20260dc30de7029e0b10cc997fa78041f2bfec60f284ec1d39406cd0c1f2db7fb993cca7be5e06757cec7ac7bdf54
-MISC ChangeLog 19312 SHA256 3c1429de24f0696b32cb841d35bb1cc5fd8ea085360847da93346ce8a460e9ca SHA512 8d37b80385121d9f69f4b7efdf831536954e6e84a914438f712058dd48e8dbc76adb34e8cbb0307b492f5b0ec8b3a59f7ed734eb3457d08576ec5a5834db4cb4 WHIRLPOOL 41ae05bd60df42a500b081cd7ddefe545068033846fcb9f5accfa853fe206037d1c374599c5cdcd662e61aba34acc1f4b3ad5253f38ca3292ec864b23727c690
+MISC ChangeLog 19564 SHA256 defe186240ae3eae68e919d5b35b74846a7c23b4f800ea3725611ab7f278e28c SHA512 fdd2c36830f40abca55f29e92de17b333afb5fa5f2b9b122ae795693b07487501bb8b2125f3c2dd3122602f6e80b6d71e2ea9baa6014e2cdb041dc184a053ba6 WHIRLPOOL e79ff8c6b66e8ff772ca2c66a0ac1f7a915222f9963553a98e788fbdcadaff2b399a5824e77a2e8d8e4b962fed2d207c567196074746a72b933bc35fa095d375
MISC ChangeLog-2012 133873 SHA256 157a7eb13d4cf2e2c94bfcb7e91f218af1ea88f5ff20c24a50546950a9839c94 SHA512 1241f4ccd7b31bdd340649417257b0e95202992feb66e0cd4d41fc2d35bf0baeac19680f34a831d2fefce0c0fec03aa6e7a191f783e59cf9b93aaf266f010a3f WHIRLPOOL b027bdba0f5ccc1b3a2dc18df92d82b473af5e55536816b7177071c1ae1a89e4d50d42c2093fa1bbe28b92a42014fbefbfc9e7daa4e6426ebecbd5bffc3d479f
MISC metadata.xml 926 SHA256 8736b6884463a876892a4fd45f6239a123c1229d2372ce47d5dff719f0eba2b9 SHA512 38d3c969b49012a94bfadecd1d48936513391a305eee5e5e55eb6c4a6b82e05b6ebf1dd6dfe6fbb5a96ba5fffc33fddcfda8d41f3d367ff4ad030859a655ef8b WHIRLPOOL 6f9afcacb628f75f84d03e812ed93b4e3613fcfc4e1180bcb0551c1c8025050ebd3b21fcdef79358aaad3606558345fcd6f914928eb62155e5b9a50bde0d3bf4
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iEYEAREIAAYFAlFLxM8ACgkQ/ejvha5XGaPIQACgt2+w1RMwrHlGgWaBbiZpzCOy
-UVUAoOzchlmDn2K7y4A2T91a2S8mz4f7
-=YScX
+iEYEAREIAAYFAlFLxT8ACgkQ/ejvha5XGaNwoQCgulZqIEq6+qK0M7WgpqaonUpR
+V0MAoJuOI+OsNWq7lxa4Oo7RVFNY+ykQ
+=NEs8
-----END PGP SIGNATURE-----
diff --git a/sys-apps/portage/portage-2.2.0_alpha169.ebuild b/sys-apps/portage/portage-2.2.0_alpha169.ebuild
new file mode 100644
index 000000000000..e6b044a104d2
--- /dev/null
+++ b/sys-apps/portage/portage-2.2.0_alpha169.ebuild
@@ -0,0 +1,387 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha169.ebuild,v 1.1 2013/03/22 02:43:09 zmedico Exp $
+
+# Require EAPI 2 since we now require at least python-2.6 (for python 3
+# syntax support) which also requires EAPI 2.
+EAPI=3
+PYTHON_COMPAT=(
+ pypy1_9 pypy2_0
+ python3_1 python3_2 python3_3 python3_4
+ python2_6 python2_7
+)
+inherit eutils python
+
+DESCRIPTION="Portage is the package management and distribution system for Gentoo"
+HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
+LICENSE="GPL-2"
+KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+IUSE="build doc epydoc +ipc linguas_pl linguas_ru pypy2_0 python2 python3 selinux xattr"
+
+for _pyimpl in ${PYTHON_COMPAT[@]} ; do
+ IUSE+=" python_targets_${_pyimpl}"
+done
+unset _pyimpl
+
+# Import of the io module in python-2.6 raises ImportError for the
+# thread module if threading is disabled.
+python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
+ !pypy2_0? ( !python2? ( !python3? (
+ || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
+ ) ) )
+ pypy2_0? ( !python2? ( !python3? ( dev-python/pypy:2.0[bzip2,ssl] ) ) )
+ python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
+python_dep="${python_dep_ssl//\[ssl\]}"
+python_dep="${python_dep//,ssl}"
+python_dep="${python_dep//ssl,}"
+
+python_dep="${python_dep}
+ python_targets_pypy1_9? ( dev-python/pypy:1.9 )
+ python_targets_pypy2_0? ( dev-python/pypy:2.0 )
+ python_targets_python2_6? ( dev-lang/python:2.6 )
+ python_targets_python2_7? ( dev-lang/python:2.7 )
+ python_targets_python3_1? ( dev-lang/python:3.1 )
+ python_targets_python3_2? ( dev-lang/python:3.2 )
+ python_targets_python3_3? ( dev-lang/python:3.3 )
+ python_targets_python3_4? ( dev-lang/python:3.4 )
+"
+
+# The pysqlite blocker is for bug #282760.
+# make-3.82 is for bug #455858
+DEPEND="${python_dep}
+ >=sys-devel/make-3.82
+ >=sys-apps/sed-4.0.5 sys-devel/patch
+ doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
+ epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
+# Require sandbox-2.2 for bug #288863.
+# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
+# quite slow, so it's not considered in the dependencies as an alternative to
+# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
+# for now, don't pull in xattr deps for other kernels.
+# For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
+# For compgen, require bash[readline] (bug #445576).
+RDEPEND="${python_dep}
+ !build? ( >=sys-apps/sed-4.0.5
+ || ( >=app-shells/bash-4.2_p37[readline] ( <app-shells/bash-4.2_p37 >=app-shells/bash-3.2_p17 ) )
+ >=app-admin/eselect-1.2
+ || ( ${python_dep_ssl} dev-python/python-mhash )
+ )
+ elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
+ elibc_glibc? ( >=sys-apps/sandbox-2.2 )
+ elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
+ >=app-misc/pax-utils-0.1.17
+ xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) )
+ selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
+ !<app-shells/bash-3.2_p17
+ !<app-admin/logrotate-3.8.0"
+PDEPEND="
+ !build? (
+ >=net-misc/rsync-2.6.4
+ userland_GNU? ( >=sys-apps/coreutils-6.4 )
+ )"
+# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
+# NOTE: FEATURES=installsources requires debugedit and rsync
+
+SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
+
+prefix_src_archives() {
+ local x y
+ for x in ${@}; do
+ for y in ${SRC_ARCHIVES}; do
+ echo ${y}/${x}
+ done
+ done
+}
+
+PV_PL="2.1.2"
+PATCHVER_PL=""
+TARBALL_PV=2.2.0_alpha166
+SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
+ $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
+ linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
+ $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
+
+PATCHVER=
+[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
+if [ -n "${PATCHVER}" ]; then
+ SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
+ $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
+fi
+
+S="${WORKDIR}"/${PN}-${TARBALL_PV}
+S_PL="${WORKDIR}"/${PN}-${PV_PL}
+
+compatible_python_is_selected() {
+ [[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
+}
+
+current_python_has_xattr() {
+ [[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
+ "${EPREFIX}/usr/bin/python" -c 'import xattr' 2>/dev/null
+}
+
+pkg_setup() {
+ if use python2 && use python3 ; then
+ ewarn "Both python2 and python3 USE flags are enabled, but only one"
+ ewarn "can be in the shebangs. Using python3."
+ fi
+ if use pypy2_0 && use python3 ; then
+ ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one"
+ ewarn "can be in the shebangs. Using python3."
+ fi
+ if use pypy2_0 && use python2 ; then
+ ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one"
+ ewarn "can be in the shebangs. Using python2"
+ fi
+ if ! use pypy2_0 && ! use python2 && ! use python3 && \
+ ! compatible_python_is_selected ; then
+ ewarn "Attempting to select a compatible default python interpreter"
+ local x success=0
+ for x in "${EPREFIX}"/usr/bin/python2.* ; do
+ x=${x#${EPREFIX}/usr/bin/python2.}
+ if [[ $x -ge 6 ]] 2>/dev/null ; then
+ eselect python set python2.$x
+ if compatible_python_is_selected ; then
+ elog "Default python interpreter is now set to python-2.$x"
+ success=1
+ break
+ fi
+ fi
+ done
+ if [ $success != 1 ] ; then
+ eerror "Unable to select a compatible default python interpreter!"
+ die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
+ fi
+ fi
+
+ if use python3; then
+ python_set_active_version 3
+ elif use python2; then
+ python_set_active_version 2
+ elif use pypy2_0; then
+ python_set_active_version 2.7-pypy-2.0
+ fi
+}
+
+src_prepare() {
+ if [ -n "${PATCHVER}" ] ; then
+ if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
+ rm "$S/bin/ebuild-helpers/portageq" \
+ || die "failed to remove portageq helper symlink"
+ fi
+ epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
+ fi
+ einfo "Setting portage.VERSION to ${PVR} ..."
+ sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
+ die "Failed to patch portage.VERSION"
+ sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
+ die "Failed to patch VERSION in doc/fragment/version"
+ sed -e "1s/VERSION/${PVR}/" -i $(find man -type f) || \
+ die "Failed to patch VERSION in man page headers"
+
+ if ! use ipc ; then
+ einfo "Disabling ipc..."
+ sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
+ -i pym/_emerge/AbstractEbuildProcess.py || \
+ die "failed to patch AbstractEbuildProcess.py"
+ fi
+
+ if use xattr && use kernel_linux ; then
+ einfo "Adding FEATURES=xattr to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ if use python3; then
+ einfo "Converting shebangs for python3..."
+ python_convert_shebangs -r 3 .
+ elif use python2; then
+ einfo "Converting shebangs for python2..."
+ python_convert_shebangs -r 2 .
+ elif use pypy2_0; then
+ einfo "Converting shebangs for pypy-c2.0..."
+ python_convert_shebangs -r 2.7-pypy-2.0 .
+ fi
+
+ if [[ -n ${EPREFIX} ]] ; then
+ einfo "Setting portage.const.EPREFIX ..."
+ sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
+ -i pym/portage/const.py || \
+ die "Failed to patch portage.const.EPREFIX"
+
+ einfo "Prefixing shebangs ..."
+ find . -type f -print0 | \
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
+ sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done
+
+ einfo "Adjusting make.globals ..."
+ sed -e 's|^SYNC=.*|SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"|' \
+ -e "s|^\(PORTDIR=\)\(/usr/portage\)|\\1\"${EPREFIX}\\2\"|" \
+ -e "s|^\(PORTAGE_TMPDIR=\)\(/var/tmp\)|\\1\"${EPREFIX}\\2\"|" \
+ -i cnf/make.globals || die "sed failed"
+
+ einfo "Adding FEATURES=force-prefix to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ echo -e '\nFEATURES="${FEATURES} preserve-libs"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+
+ cd "${S}/cnf" || die
+ if [ -f "make.conf.${ARCH}".diff ]; then
+ patch make.conf "make.conf.${ARCH}".diff || \
+ die "Failed to patch make.conf.example"
+ else
+ eerror ""
+ eerror "Portage does not have an arch-specific configuration for this arch."
+ eerror "Please notify the arch maintainer about this issue. Using generic."
+ eerror ""
+ fi
+}
+
+src_compile() {
+ if use doc; then
+ emake docbook || die
+ fi
+
+ if use epydoc; then
+ einfo "Generating api docs"
+ emake epydoc || die
+ fi
+}
+
+src_test() {
+ # make files executable, in case they were created by patch
+ find bin -type f | xargs chmod +x
+ emake test || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" \
+ sysconfdir="${EPREFIX}/etc" \
+ prefix="${EPREFIX}/usr" \
+ install || die
+
+ # Use dodoc for compression, since the Makefile doesn't do that.
+ dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
+
+ if use linguas_pl; then
+ doman -i18n=pl "${S_PL}"/man/pl/*.[0-9] || die
+ doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9] || die
+ fi
+
+ # Allow external portage API consumers to import portage python modules
+ # (this used to be done with PYTHONPATH setting in /etc/env.d).
+ # For each of PYTHON_TARGETS, install a tree of *.py symlinks in
+ # site-packages, and compile with the corresponding interpreter.
+ local impl files mod_dir dest_mod_dir python relative_path files x
+ for impl in "${PYTHON_COMPAT[@]}" ; do
+ use "python_targets_${impl}" || continue
+ while read -r mod_dir ; do
+ cd "${S}/pym/${mod_dir}" || die
+ files=$(echo *.py)
+ if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then
+ # __pycache__ directories contain no py files
+ continue
+ fi
+ dest_mod_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages/${mod_dir}
+ dodir "${dest_mod_dir}" || die
+ relative_path=../../../lib/portage/pym/${mod_dir}
+ x=/${mod_dir}
+ while [ -n "${x}" ] ; do
+ relative_path=../${relative_path}
+ x=${x%/*}
+ done
+ for x in ${files} ; do
+ dosym "${relative_path}/${x}" \
+ "${dest_mod_dir}/${x}" || die
+ done
+ done < <(cd "${S}"/pym || die ; find * -type d ! -path "portage/tests*")
+ dest_mod_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages
+ case "${impl}" in
+ python*)
+ python=${impl/_/.}
+ python=${EPREFIX}/usr/bin/${python}
+ "${python}" -m compileall -q -f -d "${EPREFIX}${dest_mod_dir}" "${ED}${dest_mod_dir#/}" || die
+ "${python}" -OO -m compileall -q -f -d "${EPREFIX}${dest_mod_dir}" "${ED}${dest_mod_dir#/}" || die
+ ;;
+ pypy*)
+ python=${impl/_/.}
+ python=${EPREFIX}/usr/bin/${python/pypy/pypy-c}
+ "${python}" -m compileall -q -f -d "${EPREFIX}${dest_mod_dir}" "${ED}${dest_mod_dir#/}" || die
+ ;;
+ esac
+ done
+}
+
+pkg_preinst() {
+ if [[ $ROOT == / ]] ; then
+ # Run some minimal tests as a sanity check.
+ local test_runner=$(find "$ED" -name runTests)
+ if [[ -n $test_runner && -x $test_runner ]] ; then
+ einfo "Running preinst sanity tests..."
+ "$test_runner" || die "preinst sanity tests failed"
+ fi
+ fi
+
+ if use xattr && ! current_python_has_xattr ; then
+ ewarn "For optimal performance in xattr handling, install"
+ ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
+ ewarn "enable USE=python3 for $CATEGORY/$PN."
+ fi
+
+ has_version "<=${CATEGORY}/${PN}-2.2_pre5" \
+ && WORLD_MIGRATION_UPGRADE=true || WORLD_MIGRATION_UPGRADE=false
+
+ # If portage-2.1.6 is installed and the preserved_libs_registry exists,
+ # assume that the NEEDED.ELF.2 files have already been generated.
+ has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \
+ ! ( [ -e "${EROOT}"var/lib/portage/preserved_libs_registry ] && \
+ has_version ">=${CATEGORY}/${PN}-2.1.6_rc" ) \
+ && NEEDED_REBUILD_UPGRADE=true || NEEDED_REBUILD_UPGRADE=false
+}
+
+pkg_postinst() {
+ if $WORLD_MIGRATION_UPGRADE && \
+ grep -q "^@" "${EROOT}/var/lib/portage/world"; then
+ einfo "moving set references from the worldfile into world_sets"
+ cd "${EROOT}/var/lib/portage/"
+ grep "^@" world >> world_sets
+ sed -i -e '/^@/d' world
+ fi
+
+ if $NEEDED_REBUILD_UPGRADE ; then
+ einfo "rebuilding NEEDED.ELF.2 files"
+ for cpv in "${EROOT}/var/db/pkg"/*/*; do
+ if [ -f "${cpv}/NEEDED" ]; then
+ rm -f "${cpv}/NEEDED.ELF.2"
+ while read line; do
+ filename=${line% *}
+ needed=${line#* }
+ needed=${needed//+/++}
+ needed=${needed//#/##}
+ needed=${needed//%/%%}
+ newline=$(scanelf -BF "%a;%F;%S;%r;${needed}" $filename)
+ newline=${newline// - }
+ echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2"
+ done < "${cpv}/NEEDED"
+ fi
+ done
+ fi
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/lib/portage/pym
+}