From: "Sebastian Pipping (sping)" <sping@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/python: python-2.7.1.ebuild python-3.1.2-r4.ebuild python-2.5.4-r4.ebuild python-2.6.6-r1.ebuild ChangeLog python-2.6.5-r3.ebuild python-2.4.6.ebuild python-2.7.ebuild python-3.1.3.ebuild
Date: Wed, 1 Dec 2010 19:53:20 +0000 (UTC) [thread overview]
Message-ID: <20101201195320.DEA3120054@flycatcher.gentoo.org> (raw)
sping 10/12/01 19:53:20
Modified: python-2.7.1.ebuild python-3.1.2-r4.ebuild
python-2.5.4-r4.ebuild python-2.6.6-r1.ebuild
ChangeLog python-2.6.5-r3.ebuild
python-2.4.6.ebuild python-2.7.ebuild
python-3.1.3.ebuild
Log:
dev-lang/python: Repair, hopefully
(Portage version: 2.1.9.25/cvs/Linux x86_64)
Revision Changes Path
1.3 dev-lang/python/python-2.7.1.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.1.ebuild?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.1.ebuild?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.1.ebuild?r1=1.2&r2=1.3
Index: python-2.7.1.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.1.ebuild,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- python-2.7.1.ebuild 29 Nov 2010 11:40:45 -0000 1.2
+++ python-2.7.1.ebuild 1 Dec 2010 19:53:20 -0000 1.3
@@ -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.7.1.ebuild,v 1.2 2010/11/29 11:40:45 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.1.ebuild,v 1.3 2010/12/01 19:53:20 sping Exp $
EAPI="2"
WANT_AUTOMAKE="none"
@@ -331,13 +331,49 @@
rmdir "${ED}$(python_get_libdir)/test/data"
}
+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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then
python_updater_warning="1"
fi
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
if [[ "${python_updater_warning}" == "1" ]]; then
@@ -354,5 +390,7 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
python_mod_cleanup $(python_get_libdir)
}
1.11 dev-lang/python/python-3.1.2-r4.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.2-r4.ebuild?rev=1.11&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.2-r4.ebuild?rev=1.11&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.2-r4.ebuild?r1=1.10&r2=1.11
Index: python-3.1.2-r4.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.2-r4.ebuild,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- python-3.1.2-r4.ebuild 27 Nov 2010 12:50:14 -0000 1.10
+++ python-3.1.2-r4.ebuild 1 Dec 2010 19:53:20 -0000 1.11
@@ -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-3.1.2-r4.ebuild,v 1.10 2010/11/27 12:50:14 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.2-r4.ebuild,v 1.11 2010/12/01 19:53:20 sping Exp $
EAPI="3"
@@ -268,13 +268,49 @@
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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then
python_updater_warning="1"
fi
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
if [[ "$(eselect python show)" == "python2."* ]]; then
@@ -307,5 +343,7 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
python_mod_cleanup $(python_get_libdir)
}
1.25 dev-lang/python/python-2.5.4-r4.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.5.4-r4.ebuild?rev=1.25&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.5.4-r4.ebuild?rev=1.25&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.5.4-r4.ebuild?r1=1.24&r2=1.25
Index: python-2.5.4-r4.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.4-r4.ebuild,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- python-2.5.4-r4.ebuild 27 Nov 2010 12:50:14 -0000 1.24
+++ python-2.5.4-r4.ebuild 1 Dec 2010 19:53:20 -0000 1.25
@@ -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.24 2010/11/27 12:50:14 sping Exp $
+# $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 $
EAPI="1"
@@ -278,13 +278,49 @@
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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
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
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
if [[ "${python_updater_warning}" == "1" ]]; then
@@ -301,5 +337,7 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
python_mod_cleanup $(python_get_libdir)
}
1.5 dev-lang/python/python-2.6.6-r1.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.6-r1.ebuild?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.6-r1.ebuild?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.6-r1.ebuild?r1=1.4&r2=1.5
Index: python-2.6.6-r1.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.6-r1.ebuild,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- python-2.6.6-r1.ebuild 27 Nov 2010 12:50:14 -0000 1.4
+++ python-2.6.6-r1.ebuild 1 Dec 2010 19:53:20 -0000 1.5
@@ -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.6-r1.ebuild,v 1.4 2010/11/27 12:50:14 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.6-r1.ebuild,v 1.5 2010/12/01 19:53:20 sping Exp $
EAPI="2"
@@ -272,13 +272,49 @@
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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.6" && ! has_version "${CATEGORY}/${PN}:2.7"; then
python_updater_warning="1"
fi
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
if [[ "${python_updater_warning}" == "1" ]]; then
@@ -295,5 +331,7 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
python_mod_cleanup $(python_get_libdir)
}
1.504 dev-lang/python/ChangeLog
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.504&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?rev=1.504&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/ChangeLog?r1=1.503&r2=1.504
Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v
retrieving revision 1.503
retrieving revision 1.504
diff -u -r1.503 -r1.504
--- ChangeLog 29 Nov 2010 11:40:45 -0000 1.503
+++ ChangeLog 1 Dec 2010 19:53:20 -0000 1.504
@@ -1,6 +1,12 @@
# ChangeLog for dev-lang/python
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.503 2010/11/29 11:40:45 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.504 2010/12/01 19:53:20 sping Exp $
+
+ 01 Dec 2010; <sping@gentoo.org> python-2.4.6.ebuild, python-2.5.4-r4.ebuild,
+ python-2.6.5-r3.ebuild, python-2.6.6-r1.ebuild, python-2.7.ebuild,
+ python-2.7.1.ebuild, python-3.1.2-r4.ebuild, python-3.1.3.ebuild:
+ Save/restore active Python version across calls to pkg_postrm() of the ebuild
+ about to be replaced. Ensure /usr/bin/python symlink.
29 Nov 2010; <sping@gentoo.org> python-2.7.1.ebuild, python-3.1.3.ebuild:
Remove eselect_python_update() from 2.7.1 and 3.1.3
1.10 dev-lang/python/python-2.6.5-r3.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.5-r3.ebuild?rev=1.10&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.5-r3.ebuild?rev=1.10&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.6.5-r3.ebuild?r1=1.9&r2=1.10
Index: python-2.6.5-r3.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.5-r3.ebuild,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- python-2.6.5-r3.ebuild 27 Nov 2010 12:50:14 -0000 1.9
+++ python-2.6.5-r3.ebuild 1 Dec 2010 19:53:20 -0000 1.10
@@ -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.9 2010/11/27 12:50:14 sping Exp $
+# $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 $
EAPI="2"
@@ -270,13 +270,49 @@
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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.6" && ! has_version "${CATEGORY}/${PN}:2.7"; then
python_updater_warning="1"
fi
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
if [[ "${python_updater_warning}" == "1" ]]; then
@@ -293,5 +329,7 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
python_mod_cleanup $(python_get_libdir)
}
1.43 dev-lang/python/python-2.4.6.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.4.6.ebuild?rev=1.43&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.4.6.ebuild?rev=1.43&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.4.6.ebuild?r1=1.42&r2=1.43
Index: python-2.4.6.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.4.6.ebuild,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- python-2.4.6.ebuild 27 Nov 2010 12:50:14 -0000 1.42
+++ python-2.4.6.ebuild 1 Dec 2010 19:53:20 -0000 1.43
@@ -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.4.6.ebuild,v 1.42 2010/11/27 12:50:14 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.4.6.ebuild,v 1.43 2010/12/01 19:53:20 sping Exp $
EAPI="1"
@@ -263,13 +263,49 @@
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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.4" && ! has_version "${CATEGORY}/${PN}:2.5" && ! has_version "${CATEGORY}/${PN}:2.6" && ! has_version "${CATEGORY}/${PN}:2.7"; then
python_updater_warning="1"
fi
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
# Python 2.4 partially doesn't respect $(get_libdir).
python_mod_optimize -f -x "/(site-packages|test|tests)/" /usr/lib/python${SLOT}
@@ -287,6 +323,8 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
# Python 2.4 partially doesn't respect $(get_libdir).
python_mod_cleanup /usr/lib/python${SLOT}
}
1.6 dev-lang/python/python-2.7.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.ebuild?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.ebuild?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-2.7.ebuild?r1=1.5&r2=1.6
Index: python-2.7.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.ebuild,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- python-2.7.ebuild 27 Nov 2010 12:50:14 -0000 1.5
+++ python-2.7.ebuild 1 Dec 2010 19:53:20 -0000 1.6
@@ -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.7.ebuild,v 1.5 2010/11/27 12:50:14 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.ebuild,v 1.6 2010/12/01 19:53:20 sping Exp $
EAPI="2"
@@ -284,13 +284,49 @@
rmdir "${ED}$(python_get_libdir)/test/data"
}
+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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version "${CATEGORY}/${PN}:2.7"; then
python_updater_warning="1"
fi
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
if [[ "${python_updater_warning}" == "1" ]]; then
@@ -307,5 +343,7 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
python_mod_cleanup $(python_get_libdir)
}
1.3 dev-lang/python/python-3.1.3.ebuild
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.3.ebuild?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.3.ebuild?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/python/python-3.1.3.ebuild?r1=1.2&r2=1.3
Index: python-3.1.3.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.3.ebuild,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- python-3.1.3.ebuild 29 Nov 2010 11:40:45 -0000 1.2
+++ python-3.1.3.ebuild 1 Dec 2010 19:53:20 -0000 1.3
@@ -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-3.1.3.ebuild,v 1.2 2010/11/29 11:40:45 sping Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-3.1.3.ebuild,v 1.3 2010/12/01 19:53:20 sping Exp $
EAPI="3"
WANT_AUTOMAKE="none"
@@ -302,13 +302,49 @@
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}"
+ fi
+}
+
+ensure_python_symlink() {
+ if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+ eselect python update --python${PV%%.*}
+ fi
+}
+
pkg_preinst() {
+ save_active_python_version
+
if has_version "<${CATEGORY}/${PN}-${SLOT}" && ! has_version ">=${CATEGORY}/${PN}-${SLOT}_alpha"; then
python_updater_warning="1"
fi
}
pkg_postinst() {
+ restore_active_python_version
+ ensure_python_symlink
+
python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir)
if [[ "$(eselect python show)" == "python2."* ]]; then
@@ -341,5 +377,7 @@
}
pkg_postrm() {
+ ensure_python_symlink
+
python_mod_cleanup $(python_get_libdir)
}
reply other threads:[~2010-12-01 19:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101201195320.DEA3120054@flycatcher.gentoo.org \
--to=sping@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox