summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2014-10-20 04:10:27 +0000
committerBrian Dolbec <dolsen@gentoo.org>2014-10-20 04:10:27 +0000
commitb068a18847a639c042cebfda9a6ba487dcad5231 (patch)
treee080c5300a4b115f3fe9f1c3854fd024fd106b33 /sys-apps
parentVersion bump. (diff)
downloadhistorical-b068a18847a639c042cebfda9a6ba487dcad5231.tar.gz
historical-b068a18847a639c042cebfda9a6ba487dcad5231.tar.bz2
historical-b068a18847a639c042cebfda9a6ba487dcad5231.zip
version bump
Package-Manager: portage-2.2.14/cvs/Linux x86_64 Manifest-Sign-Key: 0x65E309F2189DB0B8
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/portage/ChangeLog10
-rw-r--r--sys-apps/portage/Manifest26
-rw-r--r--sys-apps/portage/portage-2.2.14.ebuild322
3 files changed, 355 insertions, 3 deletions
diff --git a/sys-apps/portage/ChangeLog b/sys-apps/portage/ChangeLog
index 17687385488b..5055f3b06e32 100644
--- a/sys-apps/portage/ChangeLog
+++ b/sys-apps/portage/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-apps/portage
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1414 2014/10/19 04:03:33 patrick Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1415 2014/10/20 04:09:52 dolsen Exp $
+
+*portage-2.2.14 (20 Oct 2014)
+
+ 20 Oct 2014; Brian Dolbec <dolsen@gentoo.org> +portage-2.2.14.ebuild:
+ Version bump. Fixes bugs 508364, 524964, 524328, 523684, 506192.
19 Oct 2014; Patrick Lauer <patrick@gentoo.org> metadata.xml:
Remove unneeded useflag description from metadata.xml
@@ -19,7 +24,8 @@
-portage-2.2.11-r1.ebuild, -portage-2.2.12-r1.ebuild, -portage-2.2.13.ebuild,
+portage-2.2.14_rc1.ebuild, portage-9999.ebuild:
Version bump, cleanout old. Move sbin relocation code from pkg_preinst() to
- python_install_all() for 9999,
+ python_install_all() for 9999. Fixes bugs 508364, 523182, 517310, 481578,
+ 523494, 523532, 523152, 522084, 523048, 521990.
26 Sep 2014; Brian Dolbec <dolsen@gentoo.org> portage-9999.ebuild:
Move the admin scripts to /usr/sbin/ in pkg_preinst
diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
index b9159a6736c3..019f3c3001c4 100644
--- a/sys-apps/portage/Manifest
+++ b/sys-apps/portage/Manifest
@@ -1,11 +1,35 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
AUX README.RESCUE 137 SHA256 69bea0c755eab59b6b4d90838b8551744f0b0c8eeac170b1cd13a71ee83f9ac4 SHA512 dba0f0d6d4cd140e636cc70dfb7bdb298e2f2fb040bc07b0874cac994bdbabd26bfd9361d85a0f8b9a92a185281e4901606b9e4f563afdc8867341bbe6af1cb0 WHIRLPOOL 713fcc790442999d56e13efaf536fec9954dadeda680b3642d0358311332096ddedf8b55697bd1ca620d84f0dc7d025ff7931e086c74c1f5032be72dca2ff8f5
DIST portage-2.2.12.tar.bz2 879865 SHA256 d745d3d20abc0347632bf3a66bd80e5a45db24f3ba047cfbbacea8812156062f SHA512 55426a2d34227a4e0998342a62cd76ae9e1499ae5a92b62a10c93f7957012170615ab9d204878a25e815ee5ef9e925fe800f0eb7c3c35307577ba0ed8b38461c WHIRLPOOL 7f6987fbda9f59643e8693d75b3ed10a9b57ce5fa82a80679cc663ef1c02dbbf9986542c0e3b6638a3f4a5fb6058a0e06738a46e0f44fc5f56daed509f5bf12b
+DIST portage-2.2.14.tar.bz2 896674 SHA256 8dd65971e0f1c31dca922b0f7be06e622aabbed8d012d056ff25a169fc9946d8 SHA512 c8724b42d9932adf6065ff9f9c3bb3d22ec3258dcdb23e041ce704f2c7b634d459a36764f3ec5aa4613843733c70725025af10439816c538ec12837db50dc1ab WHIRLPOOL 82bb660fcc1f0bb4639b53829cf8207fc40ee01a0cb9935ad46fb5039f0558fbbbb3af3d12d208289e9701e0874d77a7990911fd50fe04806948c6c6955625fc
DIST portage-2.2.14_rc1.tar.bz2 896187 SHA256 fb37bba1c45dbec949fb3ecf8cb531841e87f8b2e17a426d47962c91d51b0cb5 SHA512 bc6a131c8f4f69dd114f602140c303ef880ff698913282d9db6973c84b9a1d43136f89ab4598a6b090c169f326d32fcfb8a5e587eff1dd63b365ab4f821a732d WHIRLPOOL 447fdf8e5bdf2546d2574522c650120b4be5b0056261a1cc7fda96dec0d90bf68749d9528fd8e67ea8f4f4ae06453436770fc6fcd6c5dc2f4d259ecd1f32b235
DIST portage-2.2.8.tar.bz2 874672 SHA256 c1074e01173df5384e003598dbc5f64f09e92f83fd26faab2f88f9f0bc64aa7e SHA512 acc47d94ff8c08e5a7bf2d4c4e600863430dd1e7d0bb8b4254d6477a498933cae663db84debf9487d2243c2cba689629ef8e8b6cf108e10d40e89e8e8d7e1257 WHIRLPOOL d54290ede8d3d85e5211cda7e86ed740178121ef2f47cf0858c27941d8679d29c11445befff962986d40a47ded50d0d4654de19e7d4aef3fdf2546655a0d6fe2
EBUILD portage-2.2.12.ebuild 19009 SHA256 820aed7f219c712121eb56211a620e4a7ec2c1b64c813dad18a5ec6e3cefc14c SHA512 86136d2e27f2ad6b7820d29f92bed86559638355c5560618c78fe2dcc9e25b98bc4a7d78f20c0dc601fd7f33b9bbd12be4a8b9ebf5ac099166ae8c480b56d7eb WHIRLPOOL 8284303e34766d2338884dfc328882f959747ce1fefd6436461298b48284703fb857333f76b29936b71f03e8362859c6e218631073b247b68d75da93e4cbcb2a
+EBUILD portage-2.2.14.ebuild 10811 SHA256 2a70bffc21e3aa814db1c8d5d71b0639dd1a05b20de24a2148fb3161dd879553 SHA512 b28fc1fceb53b46780970e33524f81e21766168fd172ead9347233da5e9744c17a52a94f8331e6c0c0dc526854472e63fc19631f98204f561b2ec7f78a54b1a3 WHIRLPOOL 21b933e75c1b2404cddf7858b8b7eb09204e03b8884d9750657156866e1ee7f7b3c537780e600b237e63b181df997459e33a0a8a2dc0e9d01ba96425b7069f86
EBUILD portage-2.2.14_rc1.ebuild 7307 SHA256 e1428ce92365b42ca69f210baea9b21f10c3d9cffd77b2869c5ce26a82b32595 SHA512 33e4e92886fb635191de862db470f7626e974eebd64213a06b7a2b5ac0b812fe361e366793de4518d3767218f703f6191fc0f0a5170d6527097089f188af905d WHIRLPOOL f234073362ccc24a986a2694745464a83ca47dede58f8159162357090bcf806aa30067d26c0df7fcd5572f51b119633b9cc33fe9269e0e80895ee3c4108e1be3
EBUILD portage-2.2.8-r2.ebuild 19246 SHA256 e5117305e6132b0460e73b6f05de6f0c408a7ecb7d3303f3ea19c65d37e485cf SHA512 64bb817cb9467335117c96b69aa533b7e34edb0f0c3d50b87278f2c35c49d7074d3b702447cd18a646c66fc512a163b584bb1d5ec023a8077123ffde171785c7 WHIRLPOOL 99fcf94232e0de66fa33e0f0150a56b085cf67bf1a2c1434f8cc773561e5390cdbe33ca4a8d3d940c80f5209a94b9803d27503d4152420b8e1f3127a590a8666
EBUILD portage-9999.ebuild 7171 SHA256 ef597137643ad6843c93767282b1a08c6a342ec3fe2297baf0363ccb47856b0f SHA512 3d417540b4f5f36452dbb52f1157425decfdc3ae7bdfedf35297655933e3ead0da21aeb02a519c66ebc7f819282aae111374325e212d75df52db9e88dc9f75d2 WHIRLPOOL d18b81709918b4cc6b1efdfa9281d455dbac20cb6874dcc6a71be76a4e3e946a956f57c5cd09c9fb96a8a7a5184d9b7580df9a3f5153efd72eba93a9f4b0c58b
-MISC ChangeLog 59980 SHA256 ae90f5a9d11d9f61b763b8dbb22630cb716a3889217d13a69a6edeef7e539ec0 SHA512 9ac5043b01448669ff1d9d8495221ebbc295e0204a85d064766d84c6ce2eb5954f2ac5626f4519ef457b442985db7c32b9d5d187af3d916fe3dd4f2c38d54d55 WHIRLPOOL 37d89e738c14231f4ee81de72e167f05855cbcf20e0aa40ad58987cefbb31ff223702a2742bc92c61b881a7adbf67fe61f823bdf580e6aef78df452dbd6ba7e1
+MISC ChangeLog 60244 SHA256 d7b95cee0d96cc3dfae87a06dc24302e2fec8e7c10cad103b751251d473651f5 SHA512 e2271cf5698ce974c2da4004458e39d6aefd7d2a06ae3ec9f58d3911a3e0711c830d79d3b6228c885d2a2e8da90798231019e782e241f68c7dcef4b390fdb48c WHIRLPOOL 0caa40b447fa6c3602a7b9e050e95fa6bee4d8717847cf3bf834024750630e17517a4a5c22ac6f5570e49c93a33e1b68b4e8ee0eec1470cce9d59d074c26f91b
MISC ChangeLog-2012 133873 SHA256 157a7eb13d4cf2e2c94bfcb7e91f218af1ea88f5ff20c24a50546950a9839c94 SHA512 1241f4ccd7b31bdd340649417257b0e95202992feb66e0cd4d41fc2d35bf0baeac19680f34a831d2fefce0c0fec03aa6e7a191f783e59cf9b93aaf266f010a3f WHIRLPOOL b027bdba0f5ccc1b3a2dc18df92d82b473af5e55536816b7177071c1ae1a89e4d50d42c2093fa1bbe28b92a42014fbefbfc9e7daa4e6426ebecbd5bffc3d479f
MISC metadata.xml 1089 SHA256 54047345d787e1a3d94193fe7512fbbcc77005c62c96d549d997a37b184d9567 SHA512 f083ddb6c5099aaed029211923c68ffa8e240443cd8f2681f9b607dae0f2946afd709cea32d39f44b26969769ecd7fe13b7dd0cfca1302f1ab927b9c6169ecf6 WHIRLPOOL 942aa501aaf6f61055964ef216d5269770f35c5fd7d10f849c70f01fccbe398aef9e18f9439e18586b2dcea813698eec34929501c388d8fd43055683f7262574
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0
+
+iQJ8BAEBCABmBQJURIr+XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2OUZEQTI0MjY5QzhCNUE3RTlFMjMxRTkw
+MTg2ODIyMzFCOTI2RTRGAAoJEAGGgiMbkm5PJPwP/3OdjeY+49flONA1des1mQwu
+vAPx16y4jte3hzn6LLEDOg8HZNYwY1dPye1856Dq2kZ23ri9prbGbtqEc6vmOIuy
+hxSlO4pQxstrzWaCqfuvw29AwHW+FMgF2qOCTHtsKDF+OgDjau3RpKZ/SAe62JeZ
+5CmsO0d/QQuHappzjxaBXiBHhfRhiODm5E6YjbXmEyxQpcsaQxjj2GdBNyCzkD1z
+T9LdOdG8q4MSqOVc3Bvu1p1kKsZxvIWnfXRGOd+njQj3FZawhjZr2ds8wBl7t1Ah
+3aach3jZYld56ryoXXbaIsGhF4fv84ELhXuV8ZULjs9Trw/I/Fvit6Ug1RbZJ/EO
+HNk3w1mECj4fF9/71RZorWt+pXOqAGVC+5U2k7Lk7wwv4+CfEesvCdhZs72fbi6t
+HQjrlhVlMu56Igv+yICz//ApWKyqosLqqATwgvREj7x7+1GrBVCKR5lb9r8V4L6w
+lOSKKjfWeL6MJDaqvsXvz3bhfzga+2fslHNWWEQvx01Ggkf6LIvvuiOrzDyICH1f
+smFk5ZmF2m81TEIKiGb1hgv1PANDnYUqrfc18xNt6EsTVtukV5MTNAIGZsTViz4P
+1+7jTIU6NIM9NiN82dZJWN6OAuYMP0faUCSrQDlhDxgTu1+fP6OrX/WOhczeOQTH
+Sm/2pOid7/WA3x4fxwLJ
+=KSkT
+-----END PGP SIGNATURE-----
diff --git a/sys-apps/portage/portage-2.2.14.ebuild b/sys-apps/portage/portage-2.2.14.ebuild
new file mode 100644
index 000000000000..dbdd5b5160c2
--- /dev/null
+++ b/sys-apps/portage/portage-2.2.14.ebuild
@@ -0,0 +1,322 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.14.ebuild,v 1.1 2014/10/20 04:09:52 dolsen Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=(
+ pypy
+ python3_2 python3_3 python3_4
+ python2_7
+)
+# Note: substituted below
+PYTHON_REQ_USE='bzip2(+)'
+
+inherit distutils-r1 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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
+
+DEPEND="!build? ( ${PYTHON_DEPS//bzip2(+)/ssl(+),bzip2(+)} )
+ dev-lang/python-exec:2
+ >=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[$(python_gen_usedep 'python2*')] )"
+# 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="
+ dev-lang/python-exec:2
+ !build? (
+ >=sys-apps/sed-4.0.5
+ app-shells/bash:0[readline]
+ >=app-admin/eselect-1.2
+ )
+ 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
+ selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
+ xattr? ( kernel_linux? (
+ >=sys-apps/install-xattr-0.3
+ $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
+ python{2_7,3_2} pypy)
+ ) )
+ !<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
+
+REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
+
+SRC_ARCHIVES="http://dev.gentoo.org/~dolsen/releases/portage"
+
+prefix_src_archives() {
+ local x y
+ for x in ${@}; do
+ for y in ${SRC_ARCHIVES}; do
+ echo ${y}/${x}
+ done
+ done
+}
+
+TARBALL_PV=${PV}
+SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
+ $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ 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 [[ -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|\(/usr/portage\)|${EPREFIX}\\1|" \
+ -e "s|^\(PORTAGE_TMPDIR=\"\)\(/var/tmp\"\)|\\1${EPREFIX}\\2|" \
+ -i cnf/make.globals || die "sed failed"
+
+ einfo "Adjusting repos.conf ..."
+ sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
+ -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
+ -e "s|^\(location = \)\(/usr/portage\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(sync-uri = \).*|\\1rsync://prefix.gentooexperimental.org/gentoo-portage-prefix|" \
+ -i cnf/repos.conf || 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
+
+ cd "${S}/cnf" || die
+ if [ -f "make.conf.example.${ARCH}".diff ]; then
+ patch make.conf.example "make.conf.example.${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
+}
+
+python_compile_all() {
+ local targets=()
+ use doc && targets+=( docbook )
+ use epydoc && targets+=( epydoc )
+
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+}
+
+python_test() {
+ esetup.py test
+}
+
+python_install() {
+ # Install sbin scripts to bindir for python-exec linking
+ # they will be relocated in pkg_preinst()
+ distutils-r1_python_install \
+ --system-prefix="${EPREFIX}/usr" \
+ --bindir="$(python_get_scriptdir)" \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
+ --sbindir="$(python_get_scriptdir)" \
+ --sysconfdir="${EPREFIX}/etc" \
+ "${@}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ local targets=()
+ use doc && targets+=( install_docbook )
+ use epydoc && targets+=( install_epydoc )
+
+ # install docs
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+
+ # Due to distutils/python-exec limitations
+ # these must be installed to /usr/bin.
+ local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
+ einfo "Moving admin scripts to the correct directory"
+ dodir /usr/sbin
+ for target in ${sbin_relocations}; do
+ einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
+ mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}"
+ done
+}
+
+pkg_preinst() {
+ # comment out sanity test until it is fixed to work
+ # with the new PORTAGE_PYM_PATH
+ #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
+
+ # elog dir must exist to avoid logrotate error for bug #415911.
+ # This code runs in preinst in order to bypass the mapping of
+ # portage:portage to root:root which happens after src_install.
+ keepdir /var/log/portage/elog
+ # This is allowed to fail if the user/group are invalid for prefix users.
+ if chown portage:portage "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
+ chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.1.13" || \
+ {
+ has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
+ has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
+ } ; then
+ USERPRIV_UPGRADE=true
+ USERSYNC_UPGRADE=true
+ REPOS_CONF_UPGRADE=true
+ REPOS_CONF_SYNC=
+ type -P portageq >/dev/null 2>&1 && \
+ REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
+ else
+ USERPRIV_UPGRADE=false
+ USERSYNC_UPGRADE=false
+ REPOS_CONF_UPGRADE=false
+ fi
+}
+
+pkg_postinst() {
+
+ if ${REPOS_CONF_UPGRADE} ; then
+ einfo "Generating repos.conf"
+ local repo_name=
+ [[ -f ${PORTDIR}/profiles/repo_name ]] && \
+ repo_name=$(< "${PORTDIR}/profiles/repo_name")
+ if [[ -z ${REPOS_CONF_SYNC} ]] ; then
+ REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
+ fi
+ local sync_type=
+ [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
+
+ if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
+ sync_type=cvs
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
+ fi
+
+ cat <<-EOF > "${T}/repos.conf"
+ [DEFAULT]
+ main-repo = ${repo_name:-gentoo}
+
+ [${repo_name:-gentoo}]
+ location = ${PORTDIR:-${EPREFIX}/usr/portage}
+ sync-type = ${sync_type:-rsync}
+ sync-uri = ${REPOS_CONF_SYNC}
+ EOF
+
+ [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
+
+ local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
+ if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
+ dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
+ fi
+ # Don't install the config update if the desired repos.conf directory
+ # and config file exist, since users may accept it blindly and break
+ # their config (bug #478726).
+ [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
+ mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
+
+ if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
+ einfo "Generating make.conf PORTDIR setting for backward compatibility"
+ for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
+ [[ -e ${dest} ]] && break
+ done
+ [[ -d ${dest} ]] && dest=${dest}/portdir.conf
+ rm -rf "${T}/make.conf"
+ [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
+ cat <<-EOF >> "${T}/make.conf"
+
+ # Set PORTDIR for backward compatibility with various tools:
+ # gentoo-bashcomp - bug #478444
+ # euse - bug #474574
+ # euses and ufed - bug #478318
+ PORTDIR="${EPREFIX}/usr/portage"
+ EOF
+ mkdir -p "${dest%/*}"
+ mv "${T}/make.conf" "$(new_config_protect "${dest}")"
+ fi
+ fi
+
+ local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
+
+ if ${USERSYNC_UPGRADE} && \
+ [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
+ local ownership=$(get_ownership "${PORTDIR}")
+ if [[ -n ${ownership} ]] ; then
+ einfo "Adjusting PORTDIR permissions for usersync"
+ find "${PORTDIR}" -path "${distdir%/}" -prune -o \
+ ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
+ -exec chown "${ownership}" {} +
+ fi
+ fi
+
+ # Do this last, since it could take a long time if there
+ # are lots of live sources, and the user may be tempted
+ # to kill emerge while it is running.
+ if ${USERPRIV_UPGRADE} && \
+ [[ -d ${distdir} && -w ${distdir} ]] ; then
+ local ownership=$(get_ownership "${distdir}")
+ if [[ ${ownership#*:} == portage ]] ; then
+ einfo "Adjusting DISTDIR permissions for userpriv"
+ find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
+ -exec chown -R portage:portage {} +
+ fi
+ fi
+}