head 1.15; access; symbols OPENPKG_E1_MP_HEAD:1.13 OPENPKG_E1_MP:1.13 OPENPKG_E1_MP_2_STABLE:1.9.2.1 OPENPKG_E1_FP:1.9.2.1 OPENPKG_2_STABLE_MP:1.13 OPENPKG_2_STABLE_20061018:1.9.2.1 OPENPKG_2_STABLE_20060622:1.9 OPENPKG_2_STABLE:1.9.0.2 OPENPKG_2_STABLE_BP:1.9 OPENPKG_2_5_RELEASE:1.8 OPENPKG_2_5_SOLID:1.8.0.2 OPENPKG_2_5_SOLID_BP:1.8 OPENPKG_2_4_RELEASE:1.7 OPENPKG_2_4_SOLID:1.7.0.2 OPENPKG_2_4_SOLID_BP:1.7 OPENPKG_CW_FP:1.6 OPENPKG_2_3_RELEASE:1.2 OPENPKG_2_3_SOLID:1.2.0.6 OPENPKG_2_3_SOLID_BP:1.2 OPENPKG_2_2_RELEASE:1.2 OPENPKG_2_2_SOLID:1.2.0.4 OPENPKG_2_2_SOLID_BP:1.2 OPENPKG_2_1_RELEASE:1.2 OPENPKG_2_1_SOLID:1.2.0.2 OPENPKG_2_1_SOLID_BP:1.2 OPENPKG_2_0_RELEASE:1.1 OPENPKG_2_0_SOLID:1.1.0.4 OPENPKG_2_0_SOLID_BP:1.1 OPENPKG_1_1_SOLID:1.1.0.2; locks; strict; comment @# @; expand @o@; 1.15 date 2008.10.02.17.11.14; author rse; state Exp; branches; next 1.14; commitid fTWpI4f5DAYgK4lt; 1.14 date 2008.02.25.07.01.59; author rse; state Exp; branches; next 1.13; commitid BNiwRZsvMnGGrKSs; 1.13 date 2006.11.03.19.04.39; author rse; state Exp; branches; next 1.12; commitid 7BRGrmfGrIEcQfTr; 1.12 date 2006.11.03.18.36.00; author rse; state Exp; branches; next 1.11; commitid 9SQR33oKMH3oGfTr; 1.11 date 2006.11.02.21.55.45; author rse; state Exp; branches; next 1.10; commitid r9g4P38mMeETO8Tr; 1.10 date 2006.10.11.07.35.48; author rse; state Exp; branches; next 1.9; commitid 11ofbh0s1rFJLeQr; 1.9 date 2006.03.30.06.39.16; author rse; state Exp; branches 1.9.2.1; next 1.8; commitid lAk47vh9ylkXIarr; 1.8 date 2005.08.06.18.01.46; author mk; state Exp; branches; next 1.7; 1.7 date 2005.05.01.19.04.19; author rse; state Exp; branches; next 1.6; 1.6 date 2005.03.11.15.47.03; author ms; state Exp; branches; next 1.5; 1.5 date 2005.03.11.15.44.08; author ms; state Exp; branches; next 1.4; 1.4 date 2005.03.11.15.19.54; author ms; state Exp; branches; next 1.3; 1.3 date 2005.03.05.19.40.18; author rse; state Exp; branches; next 1.2; 1.2 date 2004.06.05.16.58.24; author ms; state Exp; branches; next 1.1; 1.1 date 2003.01.23.10.24.05; author rse; state dead; branches 1.1.2.1; next ; 1.9.2.1 date 2006.10.16.14.55.21; author rse; state Exp; branches; next 1.9.2.2; commitid iZxwRSmmWscPXUQr; 1.9.2.2 date 2006.12.22.19.13.34; author thl; state Exp; branches; next ; commitid 2LefOfqsS8nsjyZr; 1.1.2.1 date 2003.01.23.10.24.05; author rse; state Exp; branches; next ; desc @@ 1.15 log @upgrading package: python 2.5.2 -> 2.6 @ text @Index: configure --- configure.orig 2008-09-07 21:19:04 +0200 +++ configure 2008-10-02 18:39:15 +0200 @@@@ -3098,9 +3098,9 @@@@ CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then - CFLAGS="-g -O2" + CFLAGS="-O2" else - CFLAGS="-g" + CFLAGS="" fi else if test "$GCC" = yes; then @@@@ -4530,7 +4530,7 @@@@ # debug builds. OPT="-g -Wall $STRICT_PROTO" else - OPT="-g $WRAP -O3 -Wall $STRICT_PROTO" + OPT="$WRAP -O3 -Wall $STRICT_PROTO" fi ;; *) @@@@ -13198,7 +13198,7 @@@@ then LINKFORSHARED="-Wl,--export-dynamic" fi;; - SunOS/5*) case $CC in + SunOS/5*) case gcc in *gcc*) if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null then Index: setup.py --- setup.py.orig 2008-09-30 02:15:45 +0200 +++ setup.py 2008-10-02 18:44:21 +0200 @@@@ -310,8 +310,8 @@@@ def detect_modules(self): # 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') + + # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. @@@@ -612,8 +612,6 @@@@ depends = ['socketmodule.h']) ) # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ - '/usr/local/ssl/include', - '/usr/contrib/ssl/include/' ] ssl_incs = find_file('openssl/ssl.h', inc_dirs, search_for_ssl_incs_in @@@@ -624,8 +622,7 @@@@ if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, - ['/usr/local/ssl/lib', - '/usr/contrib/ssl/lib/' + [ ] ) if (ssl_incs is not None and @@@@ -740,14 +737,8 @@@@ # top of the normal inc_dirs. db_inc_paths = [ '/usr/include/db4', - '/usr/local/include/db4', '/opt/sfw/include/db4', - '/usr/include/db3', - '/usr/local/include/db3', - '/opt/sfw/include/db3', - # Fink defaults (http://fink.sourceforge.net/) '/sw/include/db4', - '/sw/include/db3', ] # 4.x minor number specific paths for x in gen_db_minor_ver_nums(4): @@@@ -1537,6 +1528,7 @@@@ dotversion = dotversion[:-1] + '.' + dotversion[-1] tcl_include_sub = [] tk_include_sub = [] + dotversion = '' for dir in inc_dirs: tcl_include_sub += [dir + os.sep + "tcl" + dotversion] tk_include_sub += [dir + os.sep + "tk" + dotversion] @ 1.14 log @upgrading package: python 2.5.1 -> 2.5.2 @ text @a0 28 Index: Include/pyport.h --- Include/pyport.h.orig 2008-02-14 12:26:18 +0100 +++ Include/pyport.h 2008-02-25 07:54:15 +0100 @@@@ -401,8 +401,12 @@@@ * config to #define Py_HUGE_VAL to something that works on your platform. */ #ifndef Py_HUGE_VAL +#if defined (__SVR4) && defined (__sun) +#define Py_HUGE_VAL HUGE +#else #define Py_HUGE_VAL HUGE_VAL #endif +#endif /* Py_OVERFLOWED(X) * Return 1 iff a libm function overflowed. Set errno to 0 before calling Index: Modules/_ctypes/libffi/configure --- Modules/_ctypes/libffi/configure.orig 2007-09-05 01:47:16 +0200 +++ Modules/_ctypes/libffi/configure 2008-02-25 07:54:15 +0100 @@@@ -3516,7 +3516,7 @@@@ cris-*-*) TARGET=LIBFFI_CRIS; TARGETDIR=cris;; s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; -x86_64-*-linux* | x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) TARGET=X86_64; TARGETDIR=x86;; +x86_64-*-linux* | amd64-*-freebsd* | x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) TARGET=X86_64; TARGETDIR=x86;; sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; sh-*-rtems*) TARGET=SH; TARGETDIR=sh;; sh64-*-linux* | sh5*-*-linux*) TARGET=SH64; TARGETDIR=sh64;; d2 3 a4 3 --- configure.orig 2008-02-13 20:17:17 +0100 +++ configure 2008-02-25 07:56:56 +0100 @@@@ -3014,9 +3014,9 @@@@ d16 1 a16 1 @@@@ -4442,7 +4442,7 @@@@ d25 1 a25 1 @@@@ -11661,7 +11661,7 @@@@ d35 3 a37 3 --- setup.py.orig 2008-02-05 00:41:02 +0100 +++ setup.py 2008-02-25 07:54:15 +0100 @@@@ -244,8 +244,8 @@@@ d48 1 a48 1 @@@@ -521,8 +521,6 @@@@ d57 1 a57 1 @@@@ -533,8 +531,7 @@@@ d67 1 a67 1 @@@@ -619,11 +616,9 @@@@ d73 4 d78 1 a78 4 '/usr/include/db3', - '/usr/local/include/db3', '/opt/sfw/include/db3', '/sw/include/db3', d80 3 a82 1 @@@@ -1242,6 +1237,7 @@@@ @ 1.13 log @revert my previous patch as Python replaces the warnings with errors which is even more horrible. So stick with the nasty warnings for now again @ text @d2 3 a4 3 --- Include/pyport.h.orig 2006-06-10 14:23:46 +0200 +++ Include/pyport.h 2006-11-03 19:29:10 +0100 @@@@ -370,8 +370,12 @@@@ d18 2 a19 2 --- Modules/_ctypes/libffi/configure.orig 2006-08-14 18:17:41 +0200 +++ Modules/_ctypes/libffi/configure 2006-11-03 19:29:10 +0100 d30 15 a44 3 --- configure.orig 2006-09-05 04:54:42 +0200 +++ configure 2006-11-03 19:29:10 +0100 @@@@ -3800,11 +3800,11 @@@@ d48 2 a49 2 - OPT="-g -O3 -Wall $STRICT_PROTO" + OPT="-g -O2 -Wall $STRICT_PROTO" d53 1 a53 6 - OPT="-O3 -Wall $STRICT_PROTO" + OPT="-O2 -Wall $STRICT_PROTO" ;; esac case $ac_sys_system in @@@@ -11136,7 +11136,7 @@@@ d63 2 a64 2 --- setup.py.orig 2006-08-10 01:42:18 +0200 +++ setup.py 2006-11-03 19:29:10 +0100 d76 1 a76 1 @@@@ -520,8 +520,6 @@@@ d85 1 a85 1 @@@@ -532,8 +530,7 @@@@ d95 1 a95 1 @@@@ -614,11 +611,9 @@@@ d107 1 a107 1 @@@@ -1223,6 +1218,7 @@@@ @ 1.12 log @disable the massive amount of warnings related to reserved keywords as they make Python nearly unusable with the current existing applications @ text @a0 12 Index: Include/code.h --- Include/code.h.orig 2006-05-23 12:37:38 +0200 +++ Include/code.h 2006-11-03 19:29:53 +0100 @@@@ -52,7 +52,7 @@@@ /* This should be defined if a future statement modifies the syntax. For example, when a keyword is added. */ -#define PY_PARSER_REQUIRES_FUTURE_KEYWORD +#undef PY_PARSER_REQUIRES_FUTURE_KEYWORD #define CO_MAXBLOCKS 20 /* Max static block nesting within a function */ @ 1.11 log @cleanup and fix the whole addon module building @ text @d1 12 d15 1 a15 1 +++ Include/pyport.h 2006-11-02 22:33:14 +0100 d31 1 a31 1 +++ Modules/_ctypes/libffi/configure 2006-11-02 22:33:57 +0100 d43 1 a43 1 +++ configure 2006-11-02 22:33:14 +0100 d69 1 a69 1 +++ setup.py 2006-11-02 22:35:54 +0100 @ 1.10 log @move a few substs for setup.py to python.patch and add another new hunk for fixing tkinter support @ text @d3 1 a3 1 +++ Include/pyport.h 2006-10-11 09:29:21 +0200 d17 12 d31 1 a31 1 +++ configure 2006-10-11 09:29:21 +0200 d57 1 a57 1 +++ setup.py 2006-10-11 09:30:42 +0200 d69 1 a69 1 @@@@ -520,7 +520,7 @@@@ d74 1 a74 2 + '/usr/contrib/ssl/include/' d77 2 a78 1 @@@@ -532,7 +532,7 @@@@ d83 1 a84 1 '/usr/contrib/ssl/lib/' d87 2 a88 1 @@@@ -614,11 +614,11 @@@@ a92 1 + a96 1 + d100 1 a100 1 @@@@ -1223,6 +1223,7 @@@@ @ 1.9 log @upgrading package: python 2.4.2 -> 2.4.3 @ text @d2 3 a4 3 --- Include/pyport.h.orig 2005-09-14 19:54:39 +0200 +++ Include/pyport.h 2006-03-30 08:26:07 +0200 @@@@ -251,8 +251,12 @@@@ d17 80 @ 1.9.2.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d2 3 a4 3 --- Include/pyport.h.orig 2006-06-10 14:23:46 +0200 +++ Include/pyport.h 2006-10-11 09:29:21 +0200 @@@@ -370,8 +370,12 @@@@ a16 80 Index: configure --- configure.orig 2006-09-05 04:54:42 +0200 +++ configure 2006-10-11 09:29:21 +0200 @@@@ -3800,11 +3800,11 @@@@ # debug builds. OPT="-g -Wall $STRICT_PROTO" else - OPT="-g -O3 -Wall $STRICT_PROTO" + OPT="-g -O2 -Wall $STRICT_PROTO" fi ;; *) - OPT="-O3 -Wall $STRICT_PROTO" + OPT="-O2 -Wall $STRICT_PROTO" ;; esac case $ac_sys_system in @@@@ -11136,7 +11136,7 @@@@ then LINKFORSHARED="-Wl,--export-dynamic" fi;; - SunOS/5*) case $CC in + SunOS/5*) case gcc in *gcc*) if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null then Index: setup.py --- setup.py.orig 2006-08-10 01:42:18 +0200 +++ setup.py 2006-10-11 09:30:42 +0200 @@@@ -244,8 +244,8 @@@@ def detect_modules(self): # 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') + + # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. @@@@ -520,7 +520,7 @@@@ depends = ['socketmodule.h']) ) # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ - '/usr/local/ssl/include', + '/usr/contrib/ssl/include/' ] ssl_incs = find_file('openssl/ssl.h', inc_dirs, @@@@ -532,7 +532,7 @@@@ if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, - ['/usr/local/ssl/lib', + [ '/usr/contrib/ssl/lib/' ] ) @@@@ -614,11 +614,11 @@@@ # top of the normal inc_dirs. db_inc_paths = [ '/usr/include/db4', - '/usr/local/include/db4', + '/opt/sfw/include/db4', '/sw/include/db4', '/usr/include/db3', - '/usr/local/include/db3', + '/opt/sfw/include/db3', '/sw/include/db3', ] @@@@ -1223,6 +1223,7 @@@@ dotversion = dotversion[:-1] + '.' + dotversion[-1] tcl_include_sub = [] tk_include_sub = [] + dotversion = '' for dir in inc_dirs: tcl_include_sub += [dir + os.sep + "tcl" + dotversion] tk_include_sub += [dir + os.sep + "tk" + dotversion] @ 1.9.2.2 log @MFC: make up leeway for 2_STABLE by virtue of build-time results @ text @d3 1 a3 1 +++ Include/pyport.h 2006-11-03 19:29:10 +0100 a16 12 Index: Modules/_ctypes/libffi/configure --- Modules/_ctypes/libffi/configure.orig 2006-08-14 18:17:41 +0200 +++ Modules/_ctypes/libffi/configure 2006-11-03 19:29:10 +0100 @@@@ -3516,7 +3516,7 @@@@ cris-*-*) TARGET=LIBFFI_CRIS; TARGETDIR=cris;; s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; -x86_64-*-linux* | x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) TARGET=X86_64; TARGETDIR=x86;; +x86_64-*-linux* | amd64-*-freebsd* | x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) TARGET=X86_64; TARGETDIR=x86;; sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; sh-*-rtems*) TARGET=SH; TARGETDIR=sh;; sh64-*-linux* | sh5*-*-linux*) TARGET=SH64; TARGETDIR=sh64;; d19 1 a19 1 +++ configure 2006-11-03 19:29:10 +0100 d45 1 a45 1 +++ setup.py 2006-11-03 19:29:10 +0100 d57 1 a57 1 @@@@ -520,8 +520,6 @@@@ d62 2 a63 1 - '/usr/contrib/ssl/include/' d66 1 a66 2 search_for_ssl_incs_in @@@@ -532,8 +530,7 @@@@ a70 1 - '/usr/contrib/ssl/lib/' d72 1 d75 1 a75 2 if (ssl_incs is not None and @@@@ -614,11 +611,9 @@@@ d80 1 d85 1 d89 1 a89 1 @@@@ -1223,6 +1218,7 @@@@ @ 1.8 log @- supply libpython.a (without version number) - fix warning from g++ under Solaris 10, when compiling software that includes Python.h (_XOPEN_SOURCE redefined in %prefix/include/python/pyconfig.h) @ text @d2 2 a3 2 --- Include/pyport.h.orig 2004-09-23 21:11:21.000000000 +0200 +++ Include/pyport.h 2005-08-04 05:58:11.804844000 +0200 a16 12 Index: configure --- configure.orig 2005-08-04 05:58:11.943306000 +0200 +++ configure 2005-08-04 05:59:12.634748000 +0200 @@@@ -1524,7 +1524,7 @@@@ # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be # defined precisely as g++ defines it case $ac_sys_system/$ac_sys_release in - SunOS/5.8|SunOS/5.9) + SunOS/5.8|SunOS/5.9|SunOS/5.10) cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE 500 @ 1.7 log @apply improvements from Bill Campbell @ text @d2 3 a4 3 --- Include/pyport.h.orig 2004-06-05 18:34:53.146935009 +0200 +++ Include/pyport.h 2004-06-05 18:34:58.681503403 +0200 @@@@ -238,8 +238,12 @@@@ d17 12 @ 1.6 log @try going around whatever logic is changing my patch code (and screwing it up by doing so) @ text @d2 3 a4 3 --- Include/pyport.h.orig 2004-09-23 21:11:21 +0200 +++ Include/pyport.h 2005-03-05 20:23:52 +0100 @@@@ -251,8 +251,12 @@@@ a16 292 Index: Modules/_bsddb.c --- Modules/_bsddb.c.orig 2004-09-04 03:36:59 +0200 +++ Modules/_bsddb.c 2005-03-05 20:23:52 +0100 @@@@ -97,7 +97,7 @@@@ #error "eek! DBVER can't handle minor versions > 9" #endif -#define PY_BSDDB_VERSION "4.2.9" +#define PY_BSDDB_VERSION "4.3.0" static char *rcs_id = "$Id: _bsddb.c,v 1.38 2004/09/04 01:36:59 greg Exp $"; @@@@ -176,13 +176,16 @@@@ static PyObject* DBInvalidArgError; /* EINVAL */ static PyObject* DBAccessError; /* EACCES */ static PyObject* DBNoSpaceError; /* ENOSPC */ -static PyObject* DBNoMemoryError; /* ENOMEM */ +static PyObject* DBNoMemoryError; /* DB_BUFFER_SMALL (ENOMEM when < 4.3) */ static PyObject* DBAgainError; /* EAGAIN */ static PyObject* DBBusyError; /* EBUSY */ static PyObject* DBFileExistsError; /* EEXIST */ static PyObject* DBNoSuchFileError; /* ENOENT */ static PyObject* DBPermissionsError; /* EPERM */ +#if (DBVER < 43) +#define DB_BUFFER_SMALL ENOMEM +#endif /* --------------------------------------------------------------------- */ @@@@ -462,13 +465,35 @@@@ return 1; } +/* a safe strcpy() without the zeroing behaviour and semantics of strncpy. */ +/* TODO: make this use the native libc strlcpy() when available (BSD) */ +unsigned int our_strlcpy(char* dest, const char* src, unsigned int n) +{ + unsigned int srclen, copylen; + + srclen = strlen(src); + if (n <= 0) + return srclen; + copylen = (srclen > n-1) ? n-1 : srclen; + /* populate dest[0] thru dest[copylen-1] */ + memcpy(dest, src, copylen); + /* guarantee null termination */ + dest[copylen] = 0; + + return srclen; +} /* Callback used to save away more information about errors from the DB * library. */ static char _db_errmsg[1024]; +#if (DBVER <= 42) static void _db_errorCallback(const char* prefix, char* msg) +#else +static void _db_errorCallback(const DB_ENV *db_env, + const char* prefix, const char* msg) +#endif { - strcpy(_db_errmsg, msg); + our_strlcpy(_db_errmsg, msg, sizeof(_db_errmsg)); } @@@@ -486,7 +511,7 @@@@ #if (DBVER < 41) case DB_INCOMPLETE: #if INCOMPLETE_IS_WARNING - strcpy(errTxt, db_strerror(err)); + our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt)); if (_db_errmsg[0]) { strcat(errTxt, " -- "); strcat(errTxt, _db_errmsg); @@@@ -520,11 +545,15 @@@@ case DB_PAGE_NOTFOUND: errObj = DBPageNotFoundError; break; case DB_SECONDARY_BAD: errObj = DBSecondaryBadError; break; #endif + case DB_BUFFER_SMALL: errObj = DBNoMemoryError; break; +#if (DBVER >= 43) + /* ENOMEM and DB_BUFFER_SMALL were one and the same until 4.3 */ + case ENOMEM: errObj = PyExc_MemoryError; break; +#endif case EINVAL: errObj = DBInvalidArgError; break; case EACCES: errObj = DBAccessError; break; case ENOSPC: errObj = DBNoSpaceError; break; - case ENOMEM: errObj = DBNoMemoryError; break; case EAGAIN: errObj = DBAgainError; break; case EBUSY : errObj = DBBusyError; break; case EEXIST: errObj = DBFileExistsError; break; @@@@ -535,8 +564,7 @@@@ } if (errObj != NULL) { - /* FIXME this needs proper bounds checking on errTxt */ - strcpy(errTxt, db_strerror(err)); + our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt)); if (_db_errmsg[0]) { strcat(errTxt, " -- "); strcat(errTxt, _db_errmsg); @@@@ -1420,6 +1448,7 @@@@ return retval; } +#if (DBVER >= 33) static PyObject* DB_pget(DBObject* self, PyObject* args, PyObject* kwargs) { @@@@ -1507,6 +1536,7 @@@@ RETURN_IF_ERR(); return retval; } +#endif /* Return size of entry */ @@@@ -1533,14 +1563,14 @@@@ } CLEAR_DBT(data); - /* We don't allocate any memory, forcing a ENOMEM error and thus - getting the record size. */ + /* We don't allocate any memory, forcing a DB_BUFFER_SMALL error and + thus getting the record size. */ data.flags = DB_DBT_USERMEM; data.ulen = 0; MYDB_BEGIN_ALLOW_THREADS; err = self->db->get(self->db, txn, &key, &data, flags); MYDB_END_ALLOW_THREADS; - if (err == ENOMEM) { + if (err == DB_BUFFER_SMALL) { retval = PyInt_FromLong((long)data.size); err = 0; } @@@@ -2133,19 +2163,35 @@@@ #endif static PyObject* -DB_stat(DBObject* self, PyObject* args) +DB_stat(DBObject* self, PyObject* args, PyObject* kwargs) { int err, flags = 0, type; void* sp; PyObject* d; +#if (DBVER >= 43) + PyObject* txnobj = NULL; + DB_TXN *txn = NULL; + char* kwnames[] = { "txn", "flags", NULL }; +#else + char* kwnames[] = { "flags", NULL }; +#endif - - if (!PyArg_ParseTuple(args, "|i:stat", &flags)) +#if (DBVER >= 43) + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iO:stat", kwnames, + &flags, &txnobj)) return NULL; + if (!checkTxnObj(txnobj, &txn)) + return NULL; +#else + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:stat", kwnames, &flags)) + return NULL; +#endif CHECK_DB_NOT_CLOSED(self); MYDB_BEGIN_ALLOW_THREADS; -#if (DBVER >= 33) +#if (DBVER >= 43) + err = self->db->stat(self->db, txn, &sp, flags); +#elif (DBVER >= 33) err = self->db->stat(self->db, &sp, flags); #else err = self->db->stat(self->db, &sp, NULL, flags); @@@@ -2407,7 +2453,9 @@@@ } MYDB_BEGIN_ALLOW_THREADS; -#if (DBVER >= 33) +#if (DBVER >= 43) + err = self->db->stat(self->db, /*txnid*/ NULL, &sp, flags); +#elif (DBVER >= 33) err = self->db->stat(self->db, &sp, flags); #else err = self->db->stat(self->db, &sp, NULL, flags); @@@@ -2525,7 +2573,7 @@@@ return NULL; } - /* This causes ENOMEM to be returned when the db has the key because + /* This causes DB_BUFFER_SMALL to be returned when the db has the key because it has a record but can't allocate a buffer for the data. This saves having to deal with data we won't be using. */ @@@@ -2536,7 +2584,7 @@@@ err = self->db->get(self->db, txn, &key, &data, 0); MYDB_END_ALLOW_THREADS; FREE_DBT(key); - return PyInt_FromLong((err == ENOMEM) || (err == 0)); + return PyInt_FromLong((err == DB_BUFFER_SMALL) || (err == 0)); } @@@@ -2872,6 +2920,7 @@@@ return retval; } +#if (DBVER >= 33) static PyObject* DBC_pget(DBCursorObject* self, PyObject* args, PyObject *kwargs) { @@@@ -2971,6 +3020,7 @@@@ } return retval; } +#endif static PyObject* @@@@ -3281,15 +3331,15 @@@@ CLEAR_DBT(key); CLEAR_DBT(data); - /* We don't allocate any memory, forcing a ENOMEM error and thus + /* We don't allocate any memory, forcing a DB_BUFFER_SMALL error and thus getting the record size. */ data.flags = DB_DBT_USERMEM; data.ulen = 0; MYDB_BEGIN_ALLOW_THREADS; err = self->dbc->c_get(self->dbc, &key, &data, flags); MYDB_END_ALLOW_THREADS; - if (err == ENOMEM || !err) { - /* ENOMEM means positive size, !err means zero length value */ + if (err == DB_BUFFER_SMALL || !err) { + /* DB_BUFFER_SMALL means positive size, !err means zero length value */ retval = PyInt_FromLong((long)data.size); err = 0; } @@@@ -4333,7 +4383,9 @@@@ {"delete", (PyCFunction)DB_delete, METH_VARARGS|METH_KEYWORDS}, {"fd", (PyCFunction)DB_fd, METH_VARARGS}, {"get", (PyCFunction)DB_get, METH_VARARGS|METH_KEYWORDS}, +#if (DBVER >= 33) {"pget", (PyCFunction)DB_pget, METH_VARARGS|METH_KEYWORDS}, +#endif {"get_both", (PyCFunction)DB_get_both, METH_VARARGS|METH_KEYWORDS}, {"get_byteswapped", (PyCFunction)DB_get_byteswapped,METH_VARARGS}, {"get_size", (PyCFunction)DB_get_size, METH_VARARGS|METH_KEYWORDS}, @@@@ -4364,7 +4416,7 @@@@ #if (DBVER >= 32) {"set_q_extentsize",(PyCFunction)DB_set_q_extentsize,METH_VARARGS}, #endif - {"stat", (PyCFunction)DB_stat, METH_VARARGS}, + {"stat", (PyCFunction)DB_stat, METH_VARARGS|METH_KEYWORDS}, {"sync", (PyCFunction)DB_sync, METH_VARARGS}, #if (DBVER >= 33) {"truncate", (PyCFunction)DB_truncate, METH_VARARGS|METH_KEYWORDS}, @@@@ -4393,7 +4445,9 @@@@ {"dup", (PyCFunction)DBC_dup, METH_VARARGS}, {"first", (PyCFunction)DBC_first, METH_VARARGS|METH_KEYWORDS}, {"get", (PyCFunction)DBC_get, METH_VARARGS|METH_KEYWORDS}, +#if (DBVER >= 33) {"pget", (PyCFunction)DBC_pget, METH_VARARGS|METH_KEYWORDS}, +#endif {"get_recno", (PyCFunction)DBC_get_recno, METH_VARARGS}, {"last", (PyCFunction)DBC_last, METH_VARARGS|METH_KEYWORDS}, {"next", (PyCFunction)DBC_next, METH_VARARGS|METH_KEYWORDS}, @@@@ -4903,7 +4957,9 @@@@ #if (DBVER >= 33) ADD_INT(d, DB_LSTAT_ABORTED); +#if (DBVER < 43) ADD_INT(d, DB_LSTAT_ERR); +#endif ADD_INT(d, DB_LSTAT_FREE); ADD_INT(d, DB_LSTAT_HELD); #if (DBVER == 33) @@@@ -5029,6 +5085,11 @@@@ ADD_INT(d, DB_CHKSUM); #endif +#if (DBVER >= 43) + ADD_INT(d, DB_LOG_INMEMORY); + ADD_INT(d, DB_BUFFER_SMALL); +#endif + #if (DBVER >= 41) ADD_INT(d, DB_ENCRYPT_AES); ADD_INT(d, DB_AUTO_COMMIT); @ 1.5 log @finally get the patch right @ text @@ 1.4 log @correct hunk #1 of _bsddb.c patch block @ text @d20 1 a20 1 @@@@ -97,8 +97,8 @@@@ a24 1 -static char *rcs_id = "$Id: _bsddb.c,v 1.38 2004/09/04 01:36:59 greg Exp $"; d26 1 a26 1 +static char *rcs_id = "$Id: _bsddb.c,v 1.38 2004/09/04 01:36:59 greg Exp $"; a28 1 #ifdef WITH_THREAD @ 1.3 log @apply patch for getting bsddb module to build against Berkeley DB 4.3 @ text @d27 1 a27 1 +static char *rcs_id = "$Id: _bsddb.c,v 1.40 2004/12/16 09:47:28 greg Exp $"; @ 1.2 log @Solaris 10 and later defines HUGE_VAL only with non STDC_ISO99 compilers, so use the HUGE identifier as it is still defined consistently and works well enough @ text @d2 3 a4 3 --- Include/pyport.h.orig 2004-06-05 18:34:53.146935009 +0200 +++ Include/pyport.h 2004-06-05 18:34:58.681503403 +0200 @@@@ -238,8 +238,12 @@@@ d17 294 @ 1.1 log @file python.patch was initially added on branch OPENPKG_1_1_SOLID. @ text @d1 16 @ 1.1.2.1 log @SA-2003.006-python; CAN-2002-1119 @ text @a0 101 --- Lib/os.py-orig Sat Mar 16 19:02:20 2002 +++ Lib/os.py Sat Sep 7 06:49:09 2002 @@@@ -298,7 +298,7 @@@@ _execvpe(file, args) def execvpe(file, args, env): - """execv(file, args, env) + """execvpe(file, args, env) Execute the executable file (which is searched for along $PATH) with argument list args and environment env , replacing the @@@@ -308,8 +308,9 @@@@ __all__.extend(["execl","execle","execlp","execlpe","execvp","execvpe"]) -_notfound = None def _execvpe(file, args, env=None): + from errno import ENOENT, ENOTDIR + if env is not None: func = execve argrest = (args, env) @@@@ -317,7 +318,7 @@@@ func = execv argrest = (args,) env = environ - global _notfound + head, tail = path.split(file) if head: apply(func, (file,) + argrest) @@@@ -327,30 +328,21 @@@@ else: envpath = defpath PATH = envpath.split(pathsep) - if not _notfound: - if sys.platform[:4] == 'beos': - # Process handling (fork, wait) under BeOS (up to 5.0) - # doesn't interoperate reliably with the thread interlocking - # that happens during an import. The actual error we need - # is the same on BeOS for posix.open() et al., ENOENT. - try: unlink('/_#.# ## #.#') - except error, _notfound: pass - else: - import tempfile - t = tempfile.mktemp() - # Exec a file that is guaranteed not to exist - try: execv(t, ('blah',)) - except error, _notfound: pass - exc, arg = error, _notfound + saved_exc = None + saved_tb = None for dir in PATH: fullname = path.join(dir, file) try: apply(func, (fullname,) + argrest) - except error, (errno, msg): - if errno != arg[0]: - exc, arg = error, (errno, msg) - raise exc, arg - + except error, e: + tb = sys.exc_info()[2] + if (e.errno != ENOENT and e.errno != ENOTDIR + and saved_exc is None): + saved_exc = e + saved_tb = tb + if saved_exc: + raise error, saved_exc, saved_tb + raise error, e, tb # Change environ to automatically call putenv() if it exists try: @@@@ -374,7 +366,7 @@@@ from riscosenviron import _Environ elif name in ('os2', 'nt', 'dos'): # Where Env Var Names Must Be UPPERCASE # But we store them as upper case - class _Environ(UserDict.UserDict): + class _Environ(UserDict.IterableUserDict): def __init__(self, environ): UserDict.UserDict.__init__(self) data = self.data @@@@ -403,7 +395,7 @@@@ self[k] = v else: # Where Env Var Names Can Be Mixed Case - class _Environ(UserDict.UserDict): + class _Environ(UserDict.IterableUserDict): def __init__(self, environ): UserDict.UserDict.__init__(self) self.data = environ --- Modules/Setup.dist Wed Oct 17 15:46:28 2001 +++ Modules/Setup.dist Thu Aug 8 21:52:42 2002 @@@@ -97,6 +97,7 @@@@ # setup.py script in the root of the Python source tree. posix posixmodule.c # posix (UNIX) system calls +errno errnomodule.c # posix (UNIX) errno values _sre _sre.c # Fredrik Lundh's new regular expressions new newmodule.c # Tommy Burnette's 'new' module @