# ChangeLog for dev-lang/python
-# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.120 2004/12/29 22:04:49 ciaranm Exp $
+# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.121 2005/01/05 00:38:48 pythonhead Exp $
+
+*python-2.4 (04 Jan 2005)
+
+ 04 Jan 2005; Rob Cakebread <pythonhead@gentoo.org>
+ +files/python-2.4-add_portage_search_path.patch,
+ +files/python-2.4-db4.2.patch,
+ +files/python-2.4-disable_modules_and_ssl.patch,
+ +files/python-2.4-gentoo_py_dontcompile.patch,
+ +files/python-2.4-mimetypes_apache.patch, files/python-updater,
+ +python-2.4.ebuild:
+ Version bump. bug# 68775
29 Dec 2004; Ciaran McCreesh <ciaranm@gentoo.org> :
Change encoding to UTF-8 for GLEP 31 compliance
-MD5 c39ec090e893ae788bca853c4e3d0e4d python-2.3.4.ebuild 7013
-MD5 8e7b6af2b72bbba5f53a4c323057499f ChangeLog 20364
-MD5 0499eca9ccd343cf1c183ce21902e286 python-2.1.3-r1.ebuild 2324
-MD5 3296993efe6a80471c0becf92c363c7d python-2.3.3-r1.ebuild 7015
-MD5 6dd864fb6beb993ede8802350e83602c python-2.2.3-r5.ebuild 4309
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 dbc9feab3262ca9536461c33958ee0fd ChangeLog 20747
MD5 8145ce0144332d6caca98fa5fb648741 metadata.xml 221
-MD5 add5816d1a35b2e9311e5b9f6d2e2f90 python-2.3.3.ebuild 5568
-MD5 7808762bbf53647c7cd597be4044e9f7 files/python-2.3-gentoo_py_dontcompile.patch 478
-MD5 201acd1cfd5124f25c58a8db3f78a502 files/python-config-2.3 178
-MD5 5f2361b3e770981b737a9ad3d2863931 files/python-2.2.1-r5-gentoo.diff 4152
-MD5 46588eb4b2cfdd8277153e8e6f728eca files/python-2.3-add_portage_search_path.patch 607
-MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2 178
-MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2.1 178
+MD5 b0dabb5b661c34b2054f5ae852c2fd45 python-2.1.3-r1.ebuild 2329
+MD5 06c1ad3f6bf19e785820e8f8154053f5 python-2.4.ebuild 6519
+MD5 d646219175210ff5eec9a8996d2edb43 python-2.2.3-r5.ebuild 4311
+MD5 3d174b1204c330f7cb067dbe6134fb73 python-2.3.3.ebuild 5571
+MD5 79ce98d4e26ccecf872e428d3d7574af python-2.3.3-r1.ebuild 7019
+MD5 6fa0ddcfee993f8905d9c70a4325eda0 python-2.3.4.ebuild 7017
+MD5 1c5cd53cb89c821a549968bac31df0f1 files/depreorder.py 2235
MD5 f3f370c8d1382c1a7571cfc1cbb196d9 files/digest-python-2.1.3-r1 62
-MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2.2 178
-MD5 9fe31aedbbc7e8ea1847ed6dd70bf15b files/python-2.2.3-fPIC.patch 767
+MD5 fccf57b8c47164b676517e516898dc46 files/digest-python-2.4 64
+MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r5 62
+MD5 d5e1334ddcc639401001d01f26ce0af5 files/digest-python-2.3.3 66
+MD5 5f2361b3e770981b737a9ad3d2863931 files/python-2.2.1-r5-gentoo.diff 4152
+MD5 11aa066154fe2e0a4c306124c7e5dd4a files/python-2.2.2-tk-8.4.x.patch 2997
MD5 96d4207fb41391c70d5f02e1785c9527 files/python-2.2.3-db4.patch 1220
-MD5 7a12ce3bbe0961cf1533fcf838e17fa9 files/python-2.3-db4.2.patch 1015
MD5 7480e63a1ff3aff7eaf8718424add7f8 files/python-2.2.3-disable_modules_and_ssl.patch 1212
-MD5 4b9922f74b1076d82d1fdb653fa5769a files/python-2.3-add_portage_search_path_take_2.patch 614
-MD5 1263c81e808c8ca882208f9cddd121a2 files/python-updater 8352
+MD5 9fe31aedbbc7e8ea1847ed6dd70bf15b files/python-2.2.3-fPIC.patch 767
MD5 07398060a831f18193315973df204cbf files/python-2.2.3-gentoo_py_dontcompile.patch 732
-MD5 c2e3a6ed5d700a7976f5b763cd935599 files/digest-python-2.3.4 66
+MD5 46588eb4b2cfdd8277153e8e6f728eca files/python-2.3-add_portage_search_path.patch 607
+MD5 7a12ce3bbe0961cf1533fcf838e17fa9 files/python-2.3-db4.2.patch 1015
+MD5 7808762bbf53647c7cd597be4044e9f7 files/python-2.3-gentoo_py_dontcompile.patch 478
+MD5 ec16631b538a7481f0537191d5f23b27 files/python-2.3-mimetypes_apache.patch 454
MD5 2b953054102d344834597bc73b209e12 files/python-2.3.2-disable_modules_and_ssl.patch 1285
+MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2 178
+MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2.1 178
+MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2.2 178
+MD5 201acd1cfd5124f25c58a8db3f78a502 files/python-config-2.3 178
+MD5 fe5a878d2ba1e49ebc789b65f430290a files/python-updater 8611
MD5 d5e1334ddcc639401001d01f26ce0af5 files/digest-python-2.3.3-r1 66
-MD5 11aa066154fe2e0a4c306124c7e5dd4a files/python-2.2.2-tk-8.4.x.patch 2997
-MD5 1c5cd53cb89c821a549968bac31df0f1 files/depreorder.py 2235
-MD5 ec16631b538a7481f0537191d5f23b27 files/python-2.3-mimetypes_apache.patch 454
-MD5 d5e1334ddcc639401001d01f26ce0af5 files/digest-python-2.3.3 66
-MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r5 62
+MD5 c2e3a6ed5d700a7976f5b763cd935599 files/digest-python-2.3.4 66
+MD5 7a12ce3bbe0961cf1533fcf838e17fa9 files/python-2.4-db4.2.patch 1015
+MD5 4b9922f74b1076d82d1fdb653fa5769a files/python-2.3-add_portage_search_path_take_2.patch 614
MD5 a387f41bfc6767b90a51daaa0c0aac45 files/python-2.3.4-lib64.patch 11779
+MD5 5bee9fa15d4effc7423e76d2f7f47655 files/python-2.4-add_portage_search_path.patch 556
+MD5 2b953054102d344834597bc73b209e12 files/python-2.4-disable_modules_and_ssl.patch 1285
+MD5 2121d3986faa4b6c2c3ed472f77f2a9d files/python-2.4-gentoo_py_dontcompile.patch 477
+MD5 ec16631b538a7481f0537191d5f23b27 files/python-2.4-mimetypes_apache.patch 454
+MD5 d74e7f0fd47f00e8b3fe7ca36b7eb629 files/python-config-2.4 179
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.0 (GNU/Linux)
+
+iD8DBQFB2zc7z2gxt1z4IGYRAi3SAJ9LF0IaHn9ls27gBxWEblMD9yyr+gCg1PF5
+3TZ9tec9i0V+0E19krQpVKE=
+=gzYA
+-----END PGP SIGNATURE-----
--- /dev/null
+MD5 44c2226eff0f3fc1f2fedaa1ce596533 Python-2.4.tar.bz2 7840762
--- /dev/null
+--- Lib/site.py 2004-09-03 15:10:33.158488512 -0700
++++ Lib/site.py 2004-09-03 15:10:24.101865328 -0700
+@@ -183,6 +183,7 @@
+ "python" + sys.version[:3],
+ "site-packages"),
+ os.path.join(prefix, "lib", "site-python")]
++ sitedirs = [os.path.join(prefix,"lib","portage","pym")] + sitedirs
+ else:
+ sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
+ if sys.platform == 'darwin':
+
--- /dev/null
+--- setup.py.old 2004-02-10 22:22:12.028012888 +0000
++++ setup.py 2004-02-10 22:24:17.751899952 +0000
+@@ -497,14 +497,8 @@
+ '/opt/sfw',
+ '/sw/lib',
+ ),
+- 'incdirs': ('/usr/local/BerkeleyDB.4.2/include',
+- '/usr/local/include/db42',
+- '/usr/local/BerkeleyDB.4.1/include',
+- '/usr/local/include/db41',
+- '/usr/local/BerkeleyDB.4.0/include',
+- '/usr/local/include/db4',
+- '/opt/sfw/include/db4',
+- '/sw/include/db4',
++ 'incdirs': ('/usr/include/db4.2',
++ '/usr/include/db4.1',
+ '/usr/include/db4',
+ )},
+ 'db3': {'libs': ('db-3.3', 'db-3.2', 'db-3.1', 'db3',),
--- /dev/null
+--- setup.py.old 2003-11-01 19:23:48.495647848 +0000
++++ setup.py 2003-11-01 19:24:16.044459792 +0000
+@@ -15,7 +15,14 @@
+ from distutils.command.install_lib import install_lib
+
+ # This global variable is used to hold the list of modules to be disabled.
+-disabled_module_list = []
++try:
++ disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
++except KeyError:
++ disabled_module_list = []
++try:
++ disable_ssl = os.environ["PYTHON_DISABLE_SSL"]
++except KeyError:
++ disable_ssl = 0
+
+ def add_dir_to_list(dirlist, dir):
+ """Add the directory 'dir' to the list 'dirlist' (at the front) if
+@@ -240,6 +247,7 @@
+ return sys.platform
+
+ def detect_modules(self):
++ global disable_ssl
+ # Ensure that /usr/local is always used
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+@@ -451,7 +459,8 @@
+ ] )
+
+ if (ssl_incs is not None and
+- ssl_libs is not None):
++ ssl_libs is not None and
++ not disable_ssl):
+ exts.append( Extension('_ssl', ['_ssl.c'],
+ include_dirs = ssl_incs,
+ library_dirs = ssl_libs,
--- /dev/null
+--- Python-2.4/Python/import.c 2004-09-08 10:02:03.166032656 +0100
++++ import.c 2004-09-08 10:02:57.423420120 +0100
+@@ -808,8 +808,12 @@
+ write_compiled_module(PyCodeObject *co, char *cpathname, long mtime)
+ {
+ FILE *fp;
+-
+- fp = open_exclusive(cpathname);
++ char *py_dontcompile = getenv("PYTHON_DONTCOMPILE");
++
++ if (!py_dontcompile)
++ fp = open_exclusive(cpathname);
++ else
++ fp = NULL;
+ if (fp == NULL) {
+ if (Py_VerboseFlag)
+ PySys_WriteStderr(
+
--- /dev/null
+--- Lib/mimetypes.py.old 2004-01-24 21:48:39.957577048 +0000
++++ Lib/mimetypes.py 2004-01-24 21:49:27.023421952 +0000
+@@ -33,6 +33,8 @@
+
+ knownfiles = [
+ "/etc/mime.types",
++ "/etc/apache/conf/mime.types", # Apache 1.x for Gentoo
++ "/etc/apache2/conf/mime.types", # Apache 2.x for Gentoo
+ "/usr/local/etc/httpd/conf/mime.types",
+ "/usr/local/lib/netscape/mime.types",
+ "/usr/local/etc/httpd/conf/mime.types", # Apache 1.2
--- /dev/null
+#!/usr/bin/python
+import distutils.sysconfig, string
+print "-lpython2.4 -lm -L/usr/lib/python2.4/config",string.join(string.split(distutils.sysconfig.get_config_var("MODLIBS")))
+
# PKGS_MASKED = list of packages that are installed, but masked.
#
-OLD_PY_VER=2.2
NEW_PY_VER=$(python -V 2>&1 | sed 's:Python ::' | cut -d. -f1-2)
PKGS_EXCEPTIONS="dev-lang/python sys-apps/portage"
EBUILD="1"
source /sbin/functions.sh
+
+
+for old in 2.4 2.3 2.2 2.1; do
+ if [ "${old}" != "${NEW_PY_VER}" ]; then
+ if [ -e /usr/bin/python${old} ] ; then
+ OLD_PY_VER=${old}
+ break;
+ fi
+ fi
+done
+
+
+if [ -z "${OLD_PY_VER}" ] ; then
+ eerror "Can't determine any previous Python version(s)."
+ exit 1
+fi
+
+
# misc helper functions
eloginfo() {
einfo $*
else
eloginfo "Python update completed successfully."
fi
+
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.1.3-r1.ebuild,v 1.17 2004/07/20 00:19:28 pylon Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.1.3-r1.ebuild,v 1.18 2005/01/05 00:38:48 pythonhead Exp $
IUSE="readline tcltk berkdb"
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.2.3-r5.ebuild,v 1.24 2004/07/14 13:46:04 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.2.3-r5.ebuild,v 1.25 2005/01/05 00:38:48 pythonhead Exp $
inherit flag-o-matic eutils python
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.3-r1.ebuild,v 1.23 2004/10/18 20:22:02 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.3-r1.ebuild,v 1.24 2005/01/05 00:38:48 pythonhead Exp $
# NOTE about python-portage interactions :
# - Do not add a pkg_setup() check for a certain version of portage
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.3.ebuild,v 1.30 2004/09/24 10:47:44 liquidx Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.3.ebuild,v 1.31 2005/01/05 00:38:48 pythonhead Exp $
# NOTE about python-portage interactions :
# - Do not add a pkg_setup() check for a certain version of portage
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.4.ebuild,v 1.20 2004/11/12 15:29:19 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.4.ebuild,v 1.21 2005/01/05 00:38:48 pythonhead Exp $
# NOTE about python-portage interactions :
# - Do not add a pkg_setup() check for a certain version of portage
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.4.ebuild,v 1.1 2005/01/05 00:38:48 pythonhead Exp $
+
+# NOTE about python-portage interactions :
+# - Do not add a pkg_setup() check for a certain version of portage
+# in dev-lang/python. It _WILL_ stop people installing from
+# Gentoo 1.4 images.
+
+inherit eutils flag-o-matic python
+
+PYVER_MAJOR="`echo ${PV%_*} | cut -d '.' -f 1`"
+PYVER_MINOR="`echo ${PV%_*} | cut -d '.' -f 2`"
+PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
+MY_P="Python-${PV}"
+S="${WORKDIR}/${MY_P}"
+DESCRIPTION="A really great language"
+SRC_URI="http://www.python.org/ftp/python/${PYVER}/${MY_P}.tar.bz2"
+HOMEPAGE="http://www.python.org"
+
+IUSE="ncurses gdbm ssl readline tcltk berkdb bootstrap ipv6 build ucs2 doc X"
+LICENSE="PSF-2.2"
+SLOT="2.4"
+
+KEYWORDS="~x86 ~ppc ~sparc ~arm ~hppa ~amd64 ~s390 ~alpha ~ia64 ~mips"
+
+DEPEND="virtual/libc
+ >=sys-libs/zlib-1.1.3
+ !build? (
+ X? ( tcltk? ( >=dev-lang/tk-8.0 ) )
+ ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) )
+ berkdb? ( >=sys-libs/db-3.1 )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ doc? ( =dev-python/python-docs-${PV}* )
+ dev-libs/expat
+ )"
+
+RDEPEND="${DEPEND} dev-python/python-fchksum"
+
+# The dev-python/python-fchksum RDEPEND is needed to that this python provides
+# the functionality expected from previous pythons.
+
+PROVIDE="virtual/python"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ # prepends /usr/lib/portage/pym to sys.path
+ epatch ${FILESDIR}/${PN}-${PYVER}-add_portage_search_path.patch
+ # adds support for PYTHON_DONTCOMPILE shell environment to
+ # supress automatic generation of .pyc and .pyo files - liquidx (08 Oct 03)
+ epatch ${FILESDIR}/${PN}-${PYVER}-gentoo_py_dontcompile.patch
+ epatch ${FILESDIR}/${PN}-${PYVER}-disable_modules_and_ssl.patch
+ epatch ${FILESDIR}/${PN}-${PYVER}-mimetypes_apache.patch
+ epatch ${FILESDIR}/${PN}-${PYVER}-db4.2.patch
+}
+
+src_configure() {
+ # disable extraneous modules with extra dependencies
+ if use build; then
+ export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter"
+ export PYTHON_DISABLE_SSL=1
+ else
+ use gdbm \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm"
+ use berkdb \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm bsddb"
+ use readline \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline"
+ ( use !X || use !tcltk ) \
+ && PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter"
+ use ncurses \
+ || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel"
+ use ssl \
+ || export PYTHON_DISABLE_SSL=1
+ export PYTHON_DISABLE_MODULES
+ echo $PYTHON_DISABLE_MODULES
+ fi
+}
+
+src_compile() {
+ filter-flags -malign-double
+
+ [ "${ARCH}" = "alpha" ] && append-flags -fPIC
+ [ "${ARCH}" = "amd64" ] && append-flags -fPIC
+
+ # http://bugs.gentoo.org/show_bug.cgi?id=50309
+ if is-flag -O3; then
+ is-flag -fstack-protector-all && replace-flags -O3 -O2
+ use hardened && replace-flags -O3 -O2
+ fi
+
+ export OPT="${CFLAGS}"
+
+ local myconf
+ #if we are creating a new build image, we remove the dependency on g++
+ if use build && ! use bootstrap; then
+ myconf="--with-cxx=no"
+ fi
+
+ # super-secret switch. don't use this unless you know what you're
+ # doing. enabling UCS2 support will break your existing python
+ # modules
+ use ucs2 \
+ && myconf="${myconf} --enable-unicode=ucs2" \
+ || myconf="${myconf} --enable-unicode=ucs4"
+
+ src_configure
+
+ econf --with-fpectl \
+ --enable-shared \
+ `use_enable ipv6` \
+ --infodir='${prefix}'/share/info \
+ --mandir='${prefix}'/share/man \
+ --with-threads \
+ --with-cxx=no \
+ ${myconf} || die
+ emake || die "Parallel make failed"
+}
+
+src_install() {
+ dodir /usr
+ src_configure
+ make DESTDIR="${D}" altinstall || die
+
+ # install our own custom python-config
+ exeinto /usr/bin
+ newexe ${FILESDIR}/python-config-${PYVER} python-config
+
+ # The stuff below this line extends from 2.1, and should be deprecated
+ # in 2.3, or possibly can wait till 2.4
+
+ # seems like the build do not install Makefile.pre.in anymore
+ # it probably shouldn't - use DistUtils, people!
+ if [ "${CONF_LIBDIR}" == "lib64" ] ;then
+ insinto /usr/lib64/python${PYVER}/config
+ else
+ insinto /usr/lib/python${PYVER}/config
+ fi
+ doins ${S}/Makefile.pre.in
+
+ # While we're working on the config stuff... Let's fix the OPT var
+ # so that it doesn't have any opts listed in it. Prevents the problem
+ # with compiling things with conflicting opts later.
+ if [ "${CONF_LIBDIR}" == "lib64" ] ;then
+ dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
+ /usr/lib64/python${PYVER}/config/Makefile
+ else
+ dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \
+ /usr/lib/python${PYVER}/config/Makefile
+ fi
+
+ # install python-updater in /usr/sbin
+ dosbin ${FILESDIR}/python-updater
+
+ if use build ; then
+ rm -rf ${D}/usr/lib/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test}
+ else
+ use uclibc && rm -rf ${D}/usr/lib/python${PYVER}/{test,bsddb/test}
+ use berkdb || rm -rf ${D}/usr/lib/python${PYVER}/bsddb
+ ( use !X || use !tcltk ) && rm -rf ${D}/usr/lib/python${PYVER}/lib-tk
+ fi
+}
+
+pkg_postrm() {
+ python_makesym
+ python_mod_cleanup /usr/lib/python${PYVER}
+ [ "${CONF_LIBDIR}" == "lib64" ] && python_mod_cleanup /usr/lib64/python${PYVER}
+}
+
+pkg_postinst() {
+ local myroot
+ myroot=$(echo $ROOT | sed 's:/$::')
+
+
+ python_makesym
+ python_mod_optimize
+ python_mod_optimize -x site-packages -x test ${myroot}/usr/lib/python${PYVER}
+ [ "${CONF_LIBDIR}" == "lib64" ] && \
+ python_mod_optimize -x site-packages -x test ${myroot}/usr/lib64/python${PYVER}
+
+ # workaround possible python-upgrade-breaks-portage situation
+ if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then
+ if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then
+ einfo "Working around possible python-portage upgrade breakage"
+ mkdir -p ${myroot}/usr/lib/portage/pym
+ cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym
+ python_mod_optimize ${myroot}/usr/lib/portage/pym
+ fi
+ fi
+
+ echo
+ ewarn
+ ewarn "If you have just upgraded from an older version of python you will need to run:"
+ ewarn
+ ewarn "/usr/sbin/python-updater"
+ ewarn
+ ewarn "This will automatically rebuild all the python dependent modules"
+ ewarn "to run with python-${PYVER}."
+ ewarn
+ ewarn "Your original Python is still installed and can be accessed via"
+ ewarn "/usr/bin/python2.x."
+ ewarn
+ ebeep 5
+}
+