diff options
author | Zac Medico <zmedico@gentoo.org> | 2013-05-03 21:10:00 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2013-05-03 21:10:00 +0000 |
commit | a66f15aa4660fc8685595ad81818c9269d9599a5 (patch) | |
tree | 4f02e347289f7ade3403fc921d5d14f46aef6c27 /sys-apps | |
parent | update SRC_URI (diff) | |
download | historical-a66f15aa4660fc8685595ad81818c9269d9599a5.tar.gz historical-a66f15aa4660fc8685595ad81818c9269d9599a5.tar.bz2 historical-a66f15aa4660fc8685595ad81818c9269d9599a5.zip |
2.2.0_alpha174 version bump. This includes all of the fixes in 2.1.11.63.
Bug #210077 tracks all bugs fixed since portage-2.1.x.
Package-Manager: portage-2.2.0_alpha174/cvs/Linux i686
Manifest-Sign-Key: 0xFDE8EF85AE5719A3
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/portage/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/portage/Manifest | 10 | ||||
-rw-r--r-- | sys-apps/portage/portage-2.2.0_alpha174.ebuild | 450 |
3 files changed, 463 insertions, 5 deletions
diff --git a/sys-apps/portage/ChangeLog b/sys-apps/portage/ChangeLog index 6edd00e5d4a0..2b2e5d30df29 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.1261 2013/05/03 21:08:22 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1262 2013/05/03 21:09:58 zmedico Exp $ + +*portage-2.2.0_alpha174 (03 May 2013) + + 03 May 2013; Zac Medico <zmedico@gentoo.org> +portage-2.2.0_alpha174.ebuild: + 2.2.0_alpha174 version bump. This includes all of the fixes in 2.1.11.63. Bug + #210077 tracks all bugs fixed since portage-2.1.x. *portage-2.1.11.63 (03 May 2013) diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest index bd066be0b9a0..fc5ab354c760 100644 --- a/sys-apps/portage/Manifest +++ b/sys-apps/portage/Manifest @@ -10,20 +10,22 @@ DIST portage-2.1.6.7_p1.patch.bz2 4741 SHA256 ddaae2ad8c01e6477bfe22e23a4da57eb9 DIST portage-2.1.6.tar.bz2 518771 SHA256 b1c507445b3858449c861568f477e1cfab8b2326ded906b852c5193fb3839647 SHA512 d035f84601802ecaea3c0edea037a783fec743733bd40895eb5bb8a220449eb24cf1e2623cbca2e378197caba63a833d8cc54f1e49d886266307288b0adcfbdc WHIRLPOOL 25b6a6e3810f428c630ec7a6dc3cf2cfbe6bfdf276553786e1436b2630532ab442186e427bc75f249a224c5171b508a92303ce352b07be1a8a4d805c568ec10f DIST portage-2.2.0_alpha170.tar.bz2 913726 SHA256 4b08d9c5369a14655cb4236d2ed0c4a2396e7b35f0bfb9447e9ecf741cca56a6 SHA512 4bfd6c5ddf46546bbd7f59dfd1f284682de8f72b20781e78334ebf83d1940f5e29d0f5d2f92a2784b3c21135ebeaadfaf847e3dbe73fa1ed8159026dcea5800e WHIRLPOOL ad245518ee685a5233dc01de9b215ce58bc0f22490383e144ec75e30388e7dc180b99975f00a25aabdfcf956707fe7f057353aa610ec9f37db24d30519430511 DIST portage-2.2.0_alpha173.patch.bz2 6958 SHA256 1c7fe7108e86387fbeb566c2277ca5fa28412820bf31148eee5efca028446007 SHA512 f21d2ae221bee21ee6120e3a1e804712f27ad874b1aa631be9bb4d7fcc8466a4fc158051567d91b1810cd77a5c350a90bb5bd7cf553f96769b7f9c1b2b96e982 WHIRLPOOL bd22135defd36703a0d14267d3265e9c9ea69e20114d2ef220e64841e7b4d6937d5063423306988e695ff450f71c4ed0f9ef9eb0e99db5f5d433cf3481c0875a +DIST portage-2.2.0_alpha174.patch.bz2 38028 SHA256 6bcfd191a64c6b7d541a894afe34e99b9f9feae4d81c36c3a1e32bf1afa9e398 SHA512 87be89536c110988ba0de667b101641e189c523c25142fda4249a7f635118c7b1bf8a7dade59abf684e863aee90af8712f47339e8a082a8ceb1b80d15e4cffe2 WHIRLPOOL 9312f52a8515a087e78de8d51d919b40918b931c0d30a689b61efffb8e56313c96a6d22dd200982acef8b934fc8ba8e5f5615eb549f06d40dd063c2d08daf044 DIST portage-man-pl-2.1.2.tar.bz2 53893 SHA256 960eaa7c6f3a2af44bdc665266a8e884628a562373cc477d301597ecc5ef961f SHA512 5f5c8dd1559048546633b1e7291ff8c0f5d637595f1a4c98405424b08c30c089fc9359e0214f78fbe358754f20d327794f4692b9b67639585c29b755975ee853 WHIRLPOOL 756e267b84077501d976f46fa448cda5368cd52aeca6ec43d109c81fe8e2364e0cd0f35630d68a4186c70e3b440b7c870b86ac7ef83cc0afa43e10f9f8e1f422 EBUILD portage-2.1.11.55.ebuild 10561 SHA256 96aea2c66f6b40da539e1169154338bfe117cf4ceefca544189c979bd610a7ab SHA512 0ace12e68af49972fcaaab13b621496c4f3b763826410ae56931310c2fa9e989d823ee02113e14f5238ec2e385169c8757b9ed6adbbcdcbbd325b6f8a39717df WHIRLPOOL 31c393cbf89b4f0a9c1fce372c5dde70f4b00861e4251a52792794211485bf275204200a1a858c5bc8db563428a69e27ab846cbc2049b2c119acc594003a5fb5 EBUILD portage-2.1.11.62.ebuild 13160 SHA256 45edaf5657c15bfd8817e6c5ef472329bf3f838a9b494e85ab02419a3f3dc28a SHA512 294f95d3bf9469494826d9dd3fc3716cfcd8372c346c1eba95f66af74ea13c88c9e430a199e581a2f2a872df91b1192b7cf34bbf910b1dae1e547bb5fde196c7 WHIRLPOOL 8eebfb2eb0eba1de3c5e2dff83865e85715966ebf0ae12704fe2f4b6f2730a85f3345073ca8430693bd7976015ac823bc0ee5b09e8918bed44ef95fd68126f28 EBUILD portage-2.1.11.63.ebuild 13175 SHA256 2eba2c37c348cb80311423d449a1989865171f0147e3606e5eac040e9025383d SHA512 ed4c9b6290920935ca0bbf5903bada9b384b9c4aadaa1ba5909d5d0a7dd58d8d7b5380acfe384394c3f8ebdca78182655e465295884730df666d32806621a8cd WHIRLPOOL 43f877c074676076f9d4e154cb3fee6b485d34bb8acca87d68fdf6961e085d0db8020cbbb7c2c982c7be96d0cfe93d7b46f49e782c7854f173d209e960ba4174 EBUILD portage-2.1.6.7_p1.ebuild 8362 SHA256 6be861ce5b12d79387b8970d78818371bb87f7f64d9e8b0cde06a4b0506f7ea7 SHA512 81c8382a826a65e96608d7f3dc8b2f6901e7518757d0f2375bfe2847cea8398c0f9bc6fac70eb44a17ad38fabba3bd1a05ac56433e178e3974f3412f4dccd831 WHIRLPOOL 33333059c1dadca596134a0cea382aee44a529dcadaffcf26f3e0b0a709eafce84a3725b4306070ac87ffa197f6f4082f2eddb171747bc0972bfc141458f6327 EBUILD portage-2.2.0_alpha173.ebuild 15327 SHA256 78d95fd85f3902b9874f78756fd49b31f28f95c56fdd667aace5f5458f6a304f SHA512 fd7c12306815d8ff9f1a89d9b0780f2913781d651b756fce1864b7d7cd0736565c36d0f298538ea2c7e5033d9436d2e5d072718e39abd985e43f28a0b68ef259 WHIRLPOOL 4e884c2b137d45163144f958461d0fb91271ce7965e3d7d6ba46f13b0b9a071d8884d40ef12c9b1ccd3ac2e19df19e992e8bbacfad5798aaad846844ab7cf51e +EBUILD portage-2.2.0_alpha174.ebuild 15327 SHA256 94d43263c9d6865e11e4b4ab97748c3cea525736a13dc5355423962e4578ad3e SHA512 5bc3cf172217aa63c825236e7055bdd933a3b225a2aefcef5ceb08ab511153f17ccfce8d705d1c98815b397ea75cf9c0c0d2a56db0c1b9beab83a39843ff4f78 WHIRLPOOL 899e3d0a0a48bc770612692d78b33af4575850a10956c769dffc29906e997015d07e299ae1ae1f29867d1c272aa4a7ebbb4ee3192f30d6e00db070808a028d12 EBUILD portage-9999.ebuild 14559 SHA256 669df9f23a4f17297cb1fb92b2f32d9e6d31de3e1dd3b2b9dcf95acaf37427d5 SHA512 b6c26b56f1ce39ab1b0ffee9da9ecc0af9a99dea49980386f3ff158594a2c97a8cd7e53e3bc32e88c74134d8510d9a759696129778dc39c6eef7519c93e99fc0 WHIRLPOOL bb51e7a51404cb759a1fce327d4dda33ab15f7970db622d8504500598d113b11a46349c7b220243d5bb1888b6d08af98394600fe56ff91f628edfe2059307a83 -MISC ChangeLog 25609 SHA256 0ffb9552706c610f5fef82a2d2345363ce01919c8553a7dc5c8bd3c7d13c52f4 SHA512 aebfc49cff74e96ff32fe8026d0a8315d459f0edb2012c5e66e4cc8c3158438ec1563e1787c8a680669fabace0102bd761612cec2e456330f19db4a73ce6e71d WHIRLPOOL caa066e57d2ce14ce2a868645e7637d1fe7659a6f506341978f9f8eaf63a867ff38b3701e5d1e043532c0073c19e5b8ca7441483fcbc17cf683780a532136b4a +MISC ChangeLog 25861 SHA256 2eace414f4e0f637f2a046136f6aea137a427684f26638e5138c8a41f7017bfc SHA512 741cbb43f669ffbb19b45fea9e87584eb3e9ea4bbbe831fab7db222c7e878e3040cce78db61418ad29a11e0c9c7c5ea2e4f3684f4a08631da5b3d7727d0f8b87 WHIRLPOOL 020d52ebe1403b495b1ecb6bd09b2f329dd1df68aa7f1b0100ed9107dba75e9a8b9b2f904c00975e308b86dd96db8a8c64b47d18f6cff015a960a55b405ebd11 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) -iEYEAREIAAYFAlGEJ0gACgkQ/ejvha5XGaO49gCg3GDgEU/+Vw2ofSTx6+jYufVJ -zXYAoNQx0tVK2mPQjibYWvjQ5YNeNbaZ -=kOgg +iEYEAREIAAYFAlGEJ6gACgkQ/ejvha5XGaMKtACgzbyFDy9eauZKTViRPk/RAeQj +meYAoOGjkM7IyogMBVv3p7JfVOUNL7J2 +=nc+1 -----END PGP SIGNATURE----- diff --git a/sys-apps/portage/portage-2.2.0_alpha174.ebuild b/sys-apps/portage/portage-2.2.0_alpha174.ebuild new file mode 100644 index 000000000000..84a7e224a996 --- /dev/null +++ b/sys-apps/portage/portage-2.2.0_alpha174.ebuild @@ -0,0 +1,450 @@ +# 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_alpha174.ebuild,v 1.1 2013/05/03 21:09:58 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 multilib + +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_alpha170 +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() { + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' + local PYTHON=${EPREFIX}/usr/bin/${EPYTHON} + [[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \ + "${PYTHON}" -c 'import xattr' 2>/dev/null +} + +call_with_python_impl() { + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' + env EPYTHON=${EPYTHON} "$@" +} + +get_python_interpreter() { + [ $# -eq 1 ] || die "expected 1 argument, got $#: $*" + local impl=$1 python + case "${impl}" in + python*) + python=${impl/_/.} + ;; + pypy*) + python=${impl/_/.} + python=${python/pypy/pypy-c} + ;; + *) + die "Unrecognized python target: ${impl}" + esac + echo ${python} +} + +get_python_sitedir() { + [ $# -eq 1 ] || die "expected 1 argument, got $#: $*" + local impl=$1 + local site_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages + [[ -d ${EROOT}${site_dir} ]] || \ + ewarn "site-packages dir missing for ${impl}: ${EROOT}${site_dir}" + echo "${site_dir}" +} + +python_compileall() { + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' + local d=${EPREFIX}$1 PYTHON=${EPREFIX}/usr/bin/${EPYTHON} + local d_image=${D}${d#/} + [[ -d ${d_image} ]] || die "directory does not exist: ${d_image}" + case "${EPYTHON}" in + python*) + "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die + # Note: Using -OO breaks emaint, since it requires __doc__, + # and __doc__ is None when -OO is used. + "${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die + ;; + pypy*) + "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die + ;; + *) + die "Unrecognized EPYTHON value: ${EPYTHON}" + esac +} + +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 + + # We use EPYTHON to designate the active python interpreter, + # but we only export when needed, via call_with_python_impl. + EPYTHON=python + export -n EPYTHON + if use python3; then + EPYTHON=python3 + elif use python2; then + EPYTHON=python2 + elif use pypy2_0; then + EPYTHON=pypy-c2.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 + + local set_shebang= + if use python3; then + set_shebang=python3 + elif use python2; then + set_shebang=python2 + elif use pypy2_0; then + set_shebang=pypy-c2.0 + fi + if [[ -n ${set_shebang} ]] ; then + einfo "Converting shebangs for ${set_shebang}..." + while read -r -d $'\0' ; do + local shebang=$(head -n1 "$REPLY") + if [[ ${shebang} == "#!/usr/bin/python"* ]] ; then + sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \ + die "sed failed" + fi + done < <(find . -type f -print0) + 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 ..." + 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 < <(find . -type f -print0) + + 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 + call_with_python_impl \ + emake docbook || die + fi + + if use epydoc; then + einfo "Generating api docs" + call_with_python_impl \ + emake epydoc || die + fi +} + +src_test() { + # make files executable, in case they were created by patch + find bin -type f | xargs chmod +x + call_with_python_impl \ + emake test || die +} + +src_install() { + call_with_python_impl \ + 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 x + for impl in "${PYTHON_COMPAT[@]}" ; do + use "python_targets_${impl}" || continue + if use build && [[ ${ROOT} == / && + ! -x ${EPREFIX}/usr/bin/$(get_python_interpreter ${impl}) ]] ; then + # Tolerate --nodeps at beginning of stage1 for catalyst + ewarn "skipping python_targets_${impl}, interpreter not found" + continue + fi + while read -r mod_dir ; do + cd "${ED}/usr/lib/portage/pym/${mod_dir}" || die + files=$(echo *.py) + if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then + # __pycache__ directories contain no py files + continue + fi + dest_mod_dir=$(get_python_sitedir ${impl})/${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 "${ED}"/usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*") + cd "${S}" || die + EPYTHON=$(get_python_interpreter ${impl}) \ + python_compileall "$(get_python_sitedir ${impl})" + done + + # Compile /usr/lib/portage/pym with the active interpreter, since portage + # internal commands force this directory to the beginning of sys.path. + python_compileall /usr/lib/portage/pym +} + +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 +} |