summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>2010-12-06 02:56:40 +0000
committerJorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>2010-12-06 02:56:40 +0000
commit39725de6f9725b14625fb413234af3e5cca572ec (patch)
tree040748040f2a910b676c32126c08470c3d69e119 /dev-lang/python/python-2.6.5-r3.ebuild
parentVersion bump. (diff)
downloadgentoo-2-39725de6f9725b14625fb413234af3e5cca572ec.tar.gz
gentoo-2-39725de6f9725b14625fb413234af3e5cca572ec.tar.bz2
gentoo-2-39725de6f9725b14625fb413234af3e5cca572ec.zip
Non-maintainer commit.
Reverting commit that broke stage generation - bug 347867. (Portage version: 2.2.0_alpha6/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang/python/python-2.6.5-r3.ebuild')
-rw-r--r--dev-lang/python/python-2.6.5-r3.ebuild48
1 files changed, 12 insertions, 36 deletions
diff --git a/dev-lang/python/python-2.6.5-r3.ebuild b/dev-lang/python/python-2.6.5-r3.ebuild
index 6f44a5ccd51d..cb516f7bce75 100644
--- a/dev-lang/python/python-2.6.5-r3.ebuild
+++ b/dev-lang/python/python-2.6.5-r3.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.6.5-r3.ebuild,v 1.10 2010/12/01 19:53:20 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.5-r3.ebuild,v 1.11 2010/12/06 02:56:40 jmbsvicetto Exp $
EAPI="2"
@@ -270,48 +270,24 @@ src_install() {
rmdir "${ED}$(python_get_libdir)/lib-old"
}
-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.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.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)
@@ -329,7 +305,7 @@ pkg_postinst() {
}
pkg_postrm() {
- ensure_python_symlink
+ eselect_python_update
python_mod_cleanup $(python_get_libdir)
}