summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesus Rivero <neurogeek@gentoo.org>2010-12-16 16:14:40 +0000
committerJesus Rivero <neurogeek@gentoo.org>2010-12-16 16:14:40 +0000
commit90979cb11ad7124fb1013701db867eb8ba3293e6 (patch)
tree63b9d7e77f1de43af3941e5972df074c7bfe1367 /dev-lang/python/python-2.5.4-r4.ebuild
parentx86 stable per bug 345485 (diff)
downloadgentoo-2-90979cb11ad7124fb1013701db867eb8ba3293e6.tar.gz
gentoo-2-90979cb11ad7124fb1013701db867eb8ba3293e6.tar.bz2
gentoo-2-90979cb11ad7124fb1013701db867eb8ba3293e6.zip
Reverting commit that broke stage generation - bug 347867.
(Portage version: 2.2_rc95/cvs/Linux i686)
Diffstat (limited to 'dev-lang/python/python-2.5.4-r4.ebuild')
-rw-r--r--dev-lang/python/python-2.5.4-r4.ebuild48
1 files changed, 12 insertions, 36 deletions
diff --git a/dev-lang/python/python-2.5.4-r4.ebuild b/dev-lang/python/python-2.5.4-r4.ebuild
index a32fe70aa751..cebf39bb608c 100644
--- a/dev-lang/python/python-2.5.4-r4.ebuild
+++ b/dev-lang/python/python-2.5.4-r4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.4-r4.ebuild,v 1.25 2010/12/01 19:53:20 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.4-r4.ebuild,v 1.26 2010/12/16 16:14:40 neurogeek Exp $
EAPI="1"
@@ -278,48 +278,24 @@ src_install() {
newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} || die "newconfd failed"
}
-save_active_python_version() {
- active_python_2=$(eselect python show --python2)
- active_python_3=$(eselect python show --python3)
- active_python_main=$(eselect python show)
-}
-
-restore_active_python_version() {
- if [[ -n "${active_python_2}" &&
- "${active_python_2}" != $(eselect python show --python2) ]] ; then
- einfo "Restoring active Python 2.x interpreter: ${active_python_2}"
- eselect python set --python2 "${active_python_2}"
- fi
- if [[ -n "${active_python_3}" &&
- "${active_python_3}" != $(eselect python show --python3) ]] ; then
- einfo "Restoring active Python 3.x interpreter: ${active_python_3}"
- eselect python set --python3 "${active_python_3}"
- fi
-
- if [[ -n "${active_python_main}" &&
- "${active_python_main}" != $(eselect python show) ]] ; then
- einfo "Restoring main active Python interpreter: ${active_python_main}"
- eselect python set "${active_python_main}"
+pkg_preinst() {
+ if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.5" && ! has_version "${CATEGORY}/${PN}:2.6" && ! has_version "${CATEGORY}/${PN}:2.7"; then
+ python_updater_warning="1"
fi
}
-ensure_python_symlink() {
- if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
- eselect python update --python${PV%%.*}
- fi
-}
+eselect_python_update() {
+ local eselect_python_options
+ [[ "$(eselect python show)" == "python2."* ]] && eselect_python_options="--python2"
-pkg_preinst() {
- save_active_python_version
+ # Create python2 symlink.
+ eselect python update --python2 > /dev/null
- if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.5" && ! has_version "${CATEGORY}/${PN}:2.6" && ! has_version "${CATEGORY}/${PN}:2.7"; then
- python_updater_warning="1"
- fi
+ eselect python update ${eselect_python_options}
}
pkg_postinst() {
- restore_active_python_version
- ensure_python_symlink
+ eselect_python_update
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
@@ -337,7 +313,7 @@ pkg_postinst() {
}
pkg_postrm() {
- ensure_python_symlink
+ eselect_python_update
python_mod_cleanup $(python_get_libdir)
}