1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
#! /bin/sh -e
# DP: When built with --with-pydebug, add a debug directory
# DP: <prefix>/lib-dynload/debug to sys.path just before
# DP: <prefix>/lib-dynload und install the extension modules
# DP: of the debug build in this directory.
dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
dir="$3/"
elif [ $# -ne 1 ]; then
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
fi
case "$1" in
-patch)
patch $pdir -f --no-backup-if-mismatch -p0 < $0
;;
-unpatch)
patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
;;
*)
echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
exit 1
esac
exit 0
--- Modules/getpath.c.orig 2005-01-18 00:56:31.571961744 +0100
+++ Modules/getpath.c 2005-01-18 01:02:23.811413208 +0100
@@ -112,9 +112,14 @@
#endif
#ifndef PYTHONPATH
+#ifdef Py_DEBUG
+#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+ EXEC_PREFIX "/lib/python" VERSION "/lib-dynload/debug"
+#else
#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
#endif
+#endif
#ifndef LANDMARK
#define LANDMARK "os.py"
@@ -323,6 +328,9 @@
strncpy(exec_prefix, home, MAXPATHLEN);
joinpath(exec_prefix, lib_python);
joinpath(exec_prefix, "lib-dynload");
+#ifdef Py_DEBUG
+ joinpath(exec_prefix, "debug");
+#endif
return 1;
}
@@ -340,6 +348,9 @@
n = strlen(exec_prefix);
joinpath(exec_prefix, lib_python);
joinpath(exec_prefix, "lib-dynload");
+#ifdef Py_DEBUG
+ joinpath(exec_prefix, "debug");
+#endif
if (isdir(exec_prefix))
return 1;
exec_prefix[n] = '\0';
@@ -350,6 +361,9 @@
strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
joinpath(exec_prefix, lib_python);
joinpath(exec_prefix, "lib-dynload");
+#ifdef Py_DEBUG
+ joinpath(exec_prefix, "debug");
+#endif
if (isdir(exec_prefix))
return 1;
@@ -654,6 +654,9 @@
reduce(exec_prefix);
reduce(exec_prefix);
reduce(exec_prefix);
+#ifdef Py_DEBUG
+ reduce(exec_prefix);
+#endif
if (!exec_prefix[0])
strcpy(exec_prefix, separator);
}
--- Lib/site.py~ 2004-12-04 00:39:05.000000000 +0100
+++ Lib/site.py 2005-01-18 01:33:36.589707632 +0100
@@ -188,6 +188,12 @@
"python" + sys.version[:3],
"site-packages"),
os.path.join(prefix, "lib", "site-python")]
+ try:
+ # sys.getobjects only available in --with-pydebug build
+ sys.getobjects
+ sitedirs.insert(0, os.path.join(sitedirs[0], 'debug'))
+ except AttributeError:
+ pass
else:
sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
if sys.platform == 'darwin':
|