summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Tse <liquidx@gentoo.org>2003-10-09 15:47:04 +0000
committerAlastair Tse <liquidx@gentoo.org>2003-10-09 15:47:04 +0000
commit40634b3fe207b371c9e24bff15ad4e242deb3e1d (patch)
tree8e11bb209d936015b12248589098cb769c039931 /dev-lang
parentremoving pkg_postinst/rm() until i have a complete implementation (diff)
downloadgentoo-2-40634b3fe207b371c9e24bff15ad4e242deb3e1d.tar.gz
gentoo-2-40634b3fe207b371c9e24bff15ad4e242deb3e1d.tar.bz2
gentoo-2-40634b3fe207b371c9e24bff15ad4e242deb3e1d.zip
fixed a couple more bugs with python-2.3. holding off introducing a newer python-2.2.3 till i get 2.3 sorted out. i'm already busy enough with one version of python, can't handle breaking more stuff
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/ChangeLog8
-rw-r--r--dev-lang/python/Manifest26
-rw-r--r--dev-lang/python/files/depreorder.py58
-rw-r--r--dev-lang/python/files/python-2.2.3-gentoo_py_dontcompile.patch23
-rw-r--r--dev-lang/python/files/python-updater27
-rw-r--r--dev-lang/python/python-2.3.2-r1.ebuild3
6 files changed, 123 insertions, 22 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index e31631291e04..c03c3fa52703 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-lang/python
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.39 2003/10/09 12:11:47 tuxus Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.40 2003/10/09 15:46:58 liquidx Exp $
+
+ 09 Oct 2003; Alastair Tse <liquidx@gentoo.org> python-2.3.2-r1.ebuild,
+ files/depreorder.py, files/python-2.2.3-gentoo_py_dontcompile.patch,
+ files/python-updater:
+ improved byte-compiling, fixed out-of-order python-updater and added
+ sys-apps/portage to exclusions
09 Oct 2003; <tuxus@gentoo.org> python-2.2.3-r1.ebuild:
stable on mips
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest
index 62ad6d585e5c..841fceffd2b1 100644
--- a/dev-lang/python/Manifest
+++ b/dev-lang/python/Manifest
@@ -1,30 +1,32 @@
-MD5 7f85a84d8b897fb69de9bb32afe7194f ChangeLog 7128
+MD5 ac8ef2bae1a6cd845620644650875dc7 ChangeLog 7403
+MD5 8145ce0144332d6caca98fa5fb648741 metadata.xml 221
MD5 58b06d58bccd371fcbf1b781164c75a9 python-2.1.3-r1.ebuild 2345
MD5 f7959cf61958991a7e25f83a4e8b2ff8 python-2.2.1-r5.ebuild 2912
MD5 b5ce70d94f27185e138e67267ff416fe python-2.2.2-r1.ebuild 3123
MD5 c70d578ef0b3e6358108691e8b88d458 python-2.2.2.ebuild 3027
-MD5 789d8555967a31cc0de2126fa6468fc2 python-2.2.3.ebuild 2999
-MD5 8145ce0144332d6caca98fa5fb648741 metadata.xml 221
MD5 58ed89f3cc48f16f8bc96b76490e5b6a python-2.2.3-r1.ebuild 3293
MD5 0a274212a2a49a52600b617a38bafa09 python-2.2.3-r2.ebuild 3441
+MD5 789d8555967a31cc0de2126fa6468fc2 python-2.2.3.ebuild 2999
+MD5 a53bcd98cbe4a9ff64acc1c655409b12 python-2.3.2-r1.ebuild 4031
MD5 7c0dcd5a1aa1ec0db97cd0847faab0d7 python-2.3.2.ebuild 3675
-MD5 34bafc4f62e66d4a123409cb18350690 python-2.3.2-r1.ebuild 3963
+MD5 3dbbf5dfb3660eb003061a0c59f6e758 files/depreorder.py 1947
MD5 f3f370c8d1382c1a7571cfc1cbb196d9 files/digest-python-2.1.3-r1 62
MD5 aa73c4258e3be099345a929ad6e01665 files/digest-python-2.2.1-r5 62
MD5 b7a6b00d8dede1534e7a5180a14542b1 files/digest-python-2.2.2 62
MD5 b7a6b00d8dede1534e7a5180a14542b1 files/digest-python-2.2.2-r1 62
MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3 62
+MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r1 62
+MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r2 62
+MD5 aafa57d90e8894592bdf346eedc77faa files/digest-python-2.3.2 62
+MD5 aafa57d90e8894592bdf346eedc77faa files/digest-python-2.3.2-r1 62
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 aa781491d5e1590c4bfe6a85eecf5477 files/python-2.2.3-db4.patch 1100
+MD5 86e20b38b62c83f27739544bf331852e files/python-2.2.3-gentoo_py_dontcompile.patch 613
+MD5 46588eb4b2cfdd8277153e8e6f728eca files/python-2.3-add_portage_search_path.patch 607
+MD5 7808762bbf53647c7cd597be4044e9f7 files/python-2.3-gentoo_py_dontcompile.patch 478
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 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r1 62
-MD5 aa781491d5e1590c4bfe6a85eecf5477 files/python-2.2.3-db4.patch 1100
-MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r2 62
-MD5 aafa57d90e8894592bdf346eedc77faa files/digest-python-2.3.2 62
-MD5 46588eb4b2cfdd8277153e8e6f728eca files/python-2.3-add_portage_search_path.patch 607
MD5 201acd1cfd5124f25c58a8db3f78a502 files/python-config-2.3 178
-MD5 b2f51a738667622eff9c4964878d9d95 files/python-updater 7076
-MD5 aafa57d90e8894592bdf346eedc77faa files/digest-python-2.3.2-r1 62
-MD5 7808762bbf53647c7cd597be4044e9f7 files/python-2.3-gentoo_py_dontcompile.patch 478
+MD5 0a6faacc7a781bab8a024aa61525ae74 files/python-updater 7384
diff --git a/dev-lang/python/files/depreorder.py b/dev-lang/python/files/depreorder.py
new file mode 100644
index 000000000000..2350da2e3b00
--- /dev/null
+++ b/dev-lang/python/files/depreorder.py
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+
+# tries to reorder the deps of a given list of packages so they
+# are merged in order - liquidx@g.o (09 Oct 03)
+
+import portage
+import sys, string
+
+fakedbapi = portage.fakedbapi()
+varapi = portage.db["/"]["vartree"].dbapi
+
+pkgs_to_reorder = sys.argv[1:]
+pkgs_ordered = []
+# key = catpkgver
+# value = ( added, dependencies, slot )
+DEP_ADDED = 0
+DEP_DEPLIST = 1
+DEP_SLOT = 2
+dep_cache = {}
+
+# very simply, we extract the dependencies for each package
+for pkg in pkgs_to_reorder:
+ try:
+ deps, slot = varapi.aux_get(pkg, ["DEPEND", "SLOT"])
+ except ValueError:
+ sys.stderr.write("Error getting dependency information off " + pkg + "\n")
+ continue
+ realdeps = portage.dep_check(deps, fakedbapi)
+ vardeps = []
+ # match() finds the versions of all those that are installed
+ for dep in realdeps[1]:
+ vardeps = vardeps + varapi.match(dep)
+ dep_cache[pkg] = ( 0, vardeps, slot )
+
+# then we just naively append to a sorted list of deps using this rule.
+# if a dependency is going to be merged, we add it to the list like
+# with the dep then the pkg itself.
+# eg: dev-python/pyqt deps on dev-python/sip, so we the list will look like
+# [dev-python/sip, dev-python/pyqt]
+for pkg, depinfo in dep_cache.items():
+ dep_to_add = []
+ for dep in depinfo[DEP_DEPLIST]:
+ if dep in pkgs_to_reorder:
+ dep_to_add.append(dep)
+ pkgs_ordered += dep_to_add + [pkg]
+
+# now, because the packages may have nested or multple dependencies, we
+# then move thru the list from first to last and remove all duplicates.
+# that way we know for sure that a package isn't merged twice or a dep
+# comes before the package that depends on it.
+pkgs_final_order = []
+for pkg in pkgs_ordered:
+ if pkg not in pkgs_final_order:
+ pkgs_final_order += [pkg]
+
+print string.join(pkgs_final_order, "\n")
+#print portage.dep_expand("=dev-python/sip-3.8", portage.portdb)
+#print portage.dep_check("X? ( >=dev-python/sip-3.8 )", fakedbapi)
diff --git a/dev-lang/python/files/python-2.2.3-gentoo_py_dontcompile.patch b/dev-lang/python/files/python-2.2.3-gentoo_py_dontcompile.patch
new file mode 100644
index 000000000000..021f5226b70c
--- /dev/null
+++ b/dev-lang/python/files/python-2.2.3-gentoo_py_dontcompile.patch
@@ -0,0 +1,23 @@
+--- Python-2.2.3/Python/import.c 2003-03-23 14:32:56.000000000 +0000
++++ /tmp/import.c 2003-10-09 09:45:51.000000000 +0100
+@@ -719,6 +719,7 @@
+ write_compiled_module(PyCodeObject *co, char *cpathname, long mtime)
+ {
+ FILE *fp;
++ char *py_dontcompile;
+
+ if (CANT_WRITE(co->co_argcount) ||
+ CANT_WRITE(co->co_nlocals) ||
+@@ -731,8 +732,10 @@
+ cpathname);
+ return;
+ }
+-
+- fp = open_exclusive(cpathname);
++ if ((py_dontcompile = getenv("PYTHON_DONTCOMPILE")) != NULL)
++ fp = open_exclusive(cpathname);
++ else
++ fp = NULL;
+ if (fp == NULL) {
+ if (Py_VerboseFlag)
+ PySys_WriteStderr(
diff --git a/dev-lang/python/files/python-updater b/dev-lang/python/files/python-updater
index 95662876e54f..d73d337b85d0 100644
--- a/dev-lang/python/files/python-updater
+++ b/dev-lang/python/files/python-updater
@@ -24,8 +24,9 @@
OLD_PY_VER=2.2
NEW_PY_VER=$(python -V 2>&1 | sed 's:Python ::' | cut -d. -f1-2)
OLD_MODULES_DIR=/usr/lib/python${OLD_PY_VER}
+OLD_INCLUDE_DIR=/usr/include/python${OLD_PY_VER}
-PKGS_EXCEPTIONS="dev-lang/python"
+PKGS_EXCEPTIONS="dev-lang/python sys-apps/portage"
PKGS_MANUAL="app-office/gnumeric app-office/dia x11-libs/vte"
LOGFILE="/tmp/python-updater.log"
@@ -37,6 +38,7 @@ PORTDIR_OVERLAYS=`portageq portdir_overlay`
PRETEND=0
PKGS_TO_REMERGE=""
PKGS_COUNT_REMERGE=0
+PORTAGE_PYTHON="/usr/bin/python"
# load the gentoo-style info macros, but hack to get around
# it thinking this is an rc script
@@ -68,6 +70,8 @@ elog() {
echo "${DATESTRING} - ${*}" >> ${LOGFILE}
}
+
+
#
#
# Command Line Parsing
@@ -90,6 +94,16 @@ if [ -n "$1" ]; then
fi
#
+# Test where portage is, in python2.2 or somewhere else?
+#
+for py in /usr/bin/python /usr/bin/python${OLD_PY_VER} /usr/bin/python${NEW_PY_VER}; do
+ if ${py} -c "import portage"; then
+ PORTAGE_PYTHON=${py}
+ break;
+ fi
+done
+
+#
#
# Find all packages that have installed something in
# /usr/lib/python${OLD_PY_VER}
@@ -120,6 +134,8 @@ for content in `find ${PKG_DBDIR} -name CONTENTS`; do
if fgrep "${OLD_MODULES_DIR}" ${content} > /dev/null; then
PKGS_TO_REMERGE="${PKGS_TO_REMERGE} ${CATPKGVER}"
elogecho "Adding to list: ${CATPKGVER}"
+ elif fgrep "${OLD_INCLUDE_DIR}" ${content} > /dev/null; then
+ PKGS_TO_REMERGE="${PKGS_TO_REMERGE} ${CATPKGVER}"
fi
done
@@ -150,19 +166,14 @@ for pkg in ${PKGS_TO_REMERGE}; do
done
#
-# Check the actual order which these should be merged (probably doesn't work)
+# Use my super dumb package reordering algorithm that works most of the time
#
eloginfo "Re-ordering packages to merge .."
-PKGS_OK_SORTED_CMD="emerge -p "
-for pkg in $PKGS_OK; do
- PKGS_OK_SORTED_CMD="${PKGS_OK_SORTED_CMD} =$pkg"
-done
-PKGS_OK_SORTED_CMD="${PKGS_OK_SORTED_CMD}"
+PKGS_OK_SORTED="$(${PORTAGE_PYTHON} ${PORTDIR}/dev-lang/python/files/depreorder.py ${PKGS_OK} | xargs)"
eloginfo "Preparing to merge these packages in this order:"
-PKGS_OK_SORTED="`${PKGS_OK_SORTED_CMD} | grep ebuild | sed 's:\[ebuild.*\] ::'`"
for pkg in $PKGS_OK_SORTED; do
elogecho "$pkg"
done
diff --git a/dev-lang/python/python-2.3.2-r1.ebuild b/dev-lang/python/python-2.3.2-r1.ebuild
index bdc3062a0d60..b5eb528f2e30 100644
--- a/dev-lang/python/python-2.3.2-r1.ebuild
+++ b/dev-lang/python/python-2.3.2-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.2-r1.ebuild,v 1.2 2003/10/08 15:49:37 liquidx Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.2-r1.ebuild,v 1.3 2003/10/09 15:46:58 liquidx Exp $
inherit flag-o-matic python
@@ -111,6 +111,7 @@ pkg_postrm() {
pkg_postinst() {
python_makesym
python_mod_optimize
+ python_mod_optimize -x site-packages ${ROOT}usr/lib/python${PYVER}
echo
ewarn