summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-02-12 04:10:55 +0000
committerZac Medico <zmedico@gentoo.org>2013-02-12 04:10:55 +0000
commited9155eb704c500f7cfaca7a63faeb540d0bdaa4 (patch)
tree97940affe161de47ecba669cca31d0af283d210c /sys-apps
parent2.1.11.51 version bump. This fixes bug #456340 (unsatisfied slot-operator mes... (diff)
downloadhistorical-ed9155eb704c500f7cfaca7a63faeb540d0bdaa4.tar.gz
historical-ed9155eb704c500f7cfaca7a63faeb540d0bdaa4.tar.bz2
historical-ed9155eb704c500f7cfaca7a63faeb540d0bdaa4.zip
2.2.0_alpha162 version bump. This includes all of the fixes in 2.1.11.51.
Bug #210077 tracks all bugs fixed since portage-2.1.x. Package-Manager: portage-2.2.0_alpha162/cvs/Linux i686 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_alpha162.ebuild334
3 files changed, 347 insertions, 5 deletions
diff --git a/sys-apps/portage/ChangeLog b/sys-apps/portage/ChangeLog
index 5b1bd0dd1600..b47240a96cd0 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.1199 2013/02/12 04:08:49 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1200 2013/02/12 04:10:53 zmedico Exp $
+
+*portage-2.2.0_alpha162 (12 Feb 2013)
+
+ 12 Feb 2013; Zac Medico <zmedico@gentoo.org> +portage-2.2.0_alpha162.ebuild:
+ 2.2.0_alpha162 version bump. This includes all of the fixes in 2.1.11.51. Bug
+ #210077 tracks all bugs fixed since portage-2.1.x.
*portage-2.1.11.51 (12 Feb 2013)
diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
index c87f8f19dddc..0807c5ae1ca7 100644
--- a/sys-apps/portage/Manifest
+++ b/sys-apps/portage/Manifest
@@ -11,6 +11,7 @@ DIST portage-2.1.6.tar.bz2 518771 SHA256 b1c507445b3858449c861568f477e1cfab8b232
DIST portage-2.2.0_alpha142.tar.bz2 848765 SHA256 c2fb4499fbf747ad11a297f2ab0340f6af7958868cc72530627dd46596e88ff5 SHA512 f0fb016503d1e7998cc295c07ea83d4210075ea3d8c9421e2e9fe4256dde4138a073c60c6f11dc1dd0b3a362404810dea84ee878eec8a0c74bd43ef8e3741d2c WHIRLPOOL 34f1f5ebd2f18e52b1d441d763fda335cdbcc879aa89e36ca5a8e344567c8ab30d7a88864f97a332ba4b2a9d226eae89a41302e73ebe7eb2d33d2a9a0a3211be
DIST portage-2.2.0_alpha160.tar.bz2 895123 SHA256 25741e1a0cb2169008a20a3eda99666223694f1a046b3ed26ef43246f77acc84 SHA512 bfaf840c56d088a57211fcb6a7e78279f9980078dc0d199828a6cd663fe3801b76a0375ba4cfe00c4455fe822a40d104b3424608751d85f577824cdc03605b35 WHIRLPOOL e3c4a8f9a484e42c30319fe842807557e2953c4bf6c8849a639b6b908044f84f7283f18dd260cd3d8ce5c8ef1f037fa51b67d08c062b76f8267d76ab83f2f6d0
DIST portage-2.2.0_alpha161.patch.bz2 2850 SHA256 77e949bb0b3c6ef10839ec9ae5f29477e88211a35964b75459ec4fa363a1ced5 SHA512 656181fe02cd983e647b4dbe615718e62284cbccf118f98cb7bff02f704d4d3f7fd24d4f161eb1d34ceab3d4e3ac233743a8d1ab33312517de8498c8f3417eb7 WHIRLPOOL 3127c9347a006ac393a2ffd1ebe8c18c3363fec5ca3114a99375c9446daf5737fbdc6d9e813ce95d75851b954c40cf658f0fd81800560cc2b5c2dd6d4c75a969
+DIST portage-2.2.0_alpha162.patch.bz2 25947 SHA256 2de60755bc87a621914a6f1376a26be47c155302b59d06a82c4ecf1e4c6b03c8 SHA512 ec5d4ec12b10b596a429dabc0c722767ab5952f5fc3bd5f1473a76c3a502ff14a96460150d77454d7c546b13f589dd83dbeddeb19aacc9240d67b803c77f3bec WHIRLPOOL 92ac2e99a7f84d272e01ab89b7cfd92df20e723c9425b70c89ddec6a7395a3f99bd33dbb7b57309aadb9e52675d8fea927c2eb7aaca51a1eeaed92b9e792e1e0
DIST portage-man-pl-2.1.2.tar.bz2 53893 SHA256 960eaa7c6f3a2af44bdc665266a8e884628a562373cc477d301597ecc5ef961f SHA512 5f5c8dd1559048546633b1e7291ff8c0f5d637595f1a4c98405424b08c30c089fc9359e0214f78fbe358754f20d327794f4692b9b67639585c29b755975ee853 WHIRLPOOL 756e267b84077501d976f46fa448cda5368cd52aeca6ec43d109c81fe8e2364e0cd0f35630d68a4186c70e3b440b7c870b86ac7ef83cc0afa43e10f9f8e1f422
EBUILD portage-2.1.11.31.ebuild 9545 SHA256 30ce187ab37c32af45c1b6a1063762bafcb5a32643573db5e940f2a8e4b22ac3 SHA512 95ea9c60edcb93f4f5e0a0bd1f6e10dc568e02c78f48d8170f13730ee17eee47a6af7de9fcdda771e8e98cdfe75e74773c1a2094de2d6e01c11fbb4f24523fe4 WHIRLPOOL e8e64368a5c12d3480e1a294e605c65ddac8ae5436855d3a6aa36104ef456125c82fb24b42658f388723491384254c25a6d4469a9908d79fa88cd68bb0397dd0
EBUILD portage-2.1.11.50.ebuild 9616 SHA256 0eaf9eaa380ebf11043b1c030868bf10b79899728a4d18ca5cb5889857024dd3 SHA512 95c10ce269a8c31ee0e00bcde04cfc352a2afbac6d1c90eb77f18e0fdae226107281d47cbfc11e84fc12b8a7b5e64e0cf2098d5eea2cdfd34254c944cb9e4f39 WHIRLPOOL b8ec608c2f1eaa4478b999a3594c03e6b5c0c6523c8bf88a5aeef8b8343d6d70c3d577b5dfcca187d3a7438b99bfce9584489b8fb2b94696e8e2a041907a8a2e
@@ -18,14 +19,15 @@ EBUILD portage-2.1.11.51.ebuild 9581 SHA256 5691f036049189f8872737906c779709d031
EBUILD portage-2.1.6.7_p1.ebuild 8391 SHA256 aa62c9abf35aa31026863d881fcc47eab499992fa290a4aeda39435289358c94 SHA512 f5c66cf066f6096c930a25825314837b214d9c23386f62af8ee4f50b92c8878765ce81274a5335b5f45c8707849ecd3ca5dedb466af7dbbd2744cd356ab7bcbc WHIRLPOOL 6eca21d68dc0ad96d0ab6c9bb84b14dd21100cd48a7531305fa63a1276a1d90ddda33724c32d695632215da338aa91fba412b2f398d2d1ee91fd730d4678484d
EBUILD portage-2.2.0_alpha142.ebuild 11658 SHA256 73168521f83cf15d0530c02adfbee47243681f68430f7c551d671592fdb41d84 SHA512 6c7c1fa8cb48d1a85d1fec24e51b617f89974bf1f595b3b98d5d07050fc9b55deabc8194a7fed1e10748395076ff2283227f789d22f04f336c1fa9c776f5e33b WHIRLPOOL de0f13cb843772089331023fd27e77fb785fbcca1d93b7a36f88d1d8a917d464b09d0c8f69b0f0e05c725b728ab699d9d20df34703ae4704d513b737d09eac74
EBUILD portage-2.2.0_alpha161.ebuild 11732 SHA256 2373fb4a1532e91215921cf0102d20bf25a8d15a3b0c86ba0d4b6d393ac01c49 SHA512 508211398d45dc1bf8e1a78dde95480004486cf673b2f6572589c15ed480924eb0d15c0f89fbee2e7c8ee20db918150887b5b4a3da7753ef306864407f0e3c44 WHIRLPOOL b264cd8892a8a315cfcb27c1d723b41dffeada402d074d34f50ca0419bc0dc895b06e0a08496de19edc30b22696fa4309816b5dbf0ab7a0eca548716e681f2a0
+EBUILD portage-2.2.0_alpha162.ebuild 11683 SHA256 e322bea31bb7553c50a86d917d15b0a5b7cc30cbef62701f07a51eb48101d20a SHA512 af20eb2ca900115eb623c3b8bafd0b940bd33d28d0ba40c1825eb9eb0fa8c7afce6986eec6c04aa24982f6e20a3c17d76b5663b8b1cf90dd6f9de5118abaa966 WHIRLPOOL 9de93bdebeaed30290284d0f111bac9a8df37f993df47b9859b5c4925886a2b31518adf2d27b6667197cdfb7c5a6b1be4654e3cf0b525e18b48fe014ce57c190
EBUILD portage-9999.ebuild 10933 SHA256 df8bfc4843071ca9f6f93db097ade40fa89b12d269a75df36e24b88d5c63b96b SHA512 f223651769423b7a3d5e74435b9e4b98ec11ad03045777449783633cb11fcaf2047c64714a613e92fc6d9d55c0ab7d62142148d10eaccdcb924a7d09b0a04b26 WHIRLPOOL c28ae296f4c92cc4d6fbf265d21e2980618c02863aaece2d17695fe860f634c5102b0c180b27bf1af23930980d8503a400569d5cbe4435a3f259f25c6e03528c
-MISC ChangeLog 11999 SHA256 17d67c71df35ae250735470f5fa7df42540436fc33985a8834d5a44d65c80288 SHA512 0e8c8ef819987e0e750ea5b4aa213147253e8802b0193904c10512a60ef5f8d1e97529600a24d73ce72d1c1239137633f0c22be21dce28a618ee6037891520f5 WHIRLPOOL efb0158fb62742317db3f9144e0177cdefdee6fdb4f174e77a9f06e3c06dd3da7867ac5b563edd396f3a854e965e50931ef8d1f2c592a9c5f70ab2803e5bdca4
+MISC ChangeLog 12251 SHA256 7b91a6695b6237d2720a24105d45b239e84c4093d9cb1b27ab5e49b8a5d21c09 SHA512 d60fb5a7fd2dbc79b38534ea4e052b7de465cd4d385e70a454f06c014f92130cc331d41b720e46a2eec0c509d0bf44680a3930312429aff47f9b1e50c0997773 WHIRLPOOL c531715bce33959e2f10df02c20b34d1540b327dab28a9d7fdfb861822e2db0567ea732fe6bf8c926d29783774bd9cee2bbee1af8bcbff9ed3a68527d456e596
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)
-iEYEAREIAAYFAlEZwFMACgkQ/ejvha5XGaMcdwCgg1hyiX/drLPUtuntDpWDyyHC
-1xsAn3DMK3A1LvVdrp1eNTmM22mD1jMO
-=2lOP
+iEYEAREIAAYFAlEZwM8ACgkQ/ejvha5XGaOIZgCfTlZf0qMESub6dJ7G7Y6+YqKA
+NUoAmwRbi/nzFKLEMAXQWolEqz73nRKk
+=SZT/
-----END PGP SIGNATURE-----
diff --git a/sys-apps/portage/portage-2.2.0_alpha162.ebuild b/sys-apps/portage/portage-2.2.0_alpha162.ebuild
new file mode 100644
index 000000000000..6d64465c7904
--- /dev/null
+++ b/sys-apps/portage/portage-2.2.0_alpha162.ebuild
@@ -0,0 +1,334 @@
+# 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_alpha162.ebuild,v 1.1 2013/02/12 04:10:53 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
+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"
+
+# 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,}"
+
+# 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_alpha160
+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 /usr/bin/python2.* ; do
+ x=${x#/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
+
+ # Set PYTHONPATH for portage API consumers. This way we don't have
+ # to rely on patched python having the correct path, since it has
+ # been known to incorrectly add /usr/libx32/portage/pym to sys.path.
+ echo "PYTHONPATH=\"${EPREFIX}/usr/lib/portage/pym\"" > \
+ "${T}/05portage" || die
+ doenvd "${T}/05portage" || die
+}
+
+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() {
+ # Compile all source files recursively. Any orphans
+ # will be identified and removed in postrm.
+ python_mod_optimize /usr/lib/portage/pym
+
+ 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
+}