Hello!

In the mean time I have sent the attached patch to people involved with
building Gentoo stages.  Before further taking action on/with that patch
I am waiting for their response.

I am now posting it here in order to let you know about this change in
status and to give potentially interested parties a chance to join with
review.

Best,



Sebastian
Index: python-2.7.1.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.1.ebuild,v
retrieving revision 1.3
diff -u -r1.3 python-2.7.1.ebuild
--- python-2.7.1.ebuild 1 Dec 2010 19:53:20 -0000       1.3
+++ python-2.7.1.ebuild 3 Dec 2010 13:43:05 -0000
@@ -356,10 +356,35 @@
        fi
 }
 
-ensure_python_symlink() {
-       if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
-               eselect python update --python${PV%%.*}
-       fi
+repair_python_integration() {
+       case "$1" in
+       pkg_postinst)
+               # Ensure active python on our line (either 2.x or 3.x)
+               # If unset, use us
+               if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+                       eselect python set --python${PV%%.*} python${SLOT} || 
die
+               fi
+
+               # Ensure two symlinks are in place
+               for symlink in ${EROOT%/}/usr/bin/python{,${PV%%.*}}; do
+                       [[ -f "${symlink}" ]] && continue
+                       einfo "Creating symlink: ${symlink}"
+                       ln -s python-wrapper "${symlink}" || die
+               done
+               ;;
+
+       pkg_postrm)
+               # Ensure active python on our line (either 2.x or 3.x)
+               # If unset, use latest
+               if [[ -z "$(eselect python show --python${PV%%.*})" ]]; then
+                       eselect python update --python${PV%%.*} --if-unset || 
die
+               fi
+               ;;
+
+       *)
+               die 'unsupported usage of repair_python_integration()'
+               ;;
+       esac
 }
 
 pkg_preinst() {
@@ -372,7 +397,7 @@
 
 pkg_postinst() {
        restore_active_python_version
-       ensure_python_symlink
+       repair_python_integration ${FUNCNAME}
 
        python_mod_optimize -f -x "/(site-packages|test|tests)/" 
$(python_get_libdir)
 
@@ -390,7 +415,7 @@
 }
 
 pkg_postrm() {
-       ensure_python_symlink
+       repair_python_integration ${FUNCNAME}
 
        python_mod_cleanup $(python_get_libdir)
 }

Reply via email to