Changeset 3364 for trunk/essentials/dev-lang
- Timestamp:
- May 21, 2007, 2:27:53 AM (19 years ago)
- Location:
- trunk/essentials/dev-lang/python
- Files:
-
- 11 edited
- 1 copied
-
Include/osdefs.h (modified) (2 diffs)
-
Lib/tempfile.py (modified) (1 diff)
-
Makefile.pre.in (modified) (1 diff)
-
Modules/getpath.c (modified) (10 diffs)
-
Modules/posixmodule.c (modified) (1 diff)
-
Objects/exceptions.c (modified) (1 diff)
-
PC/os2emx/Setup.os2emx (copied) (copied from trunk/essentials/dev-lang/python/Modules/Setup.dist ) (1 diff)
-
Python/dynload_shlib.c (modified) (5 diffs)
-
Python/import.c (modified) (2 diffs)
-
Python/sysmodule.c (modified) (3 diffs)
-
Python/traceback.c (modified) (2 diffs)
-
configure.in (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/dev-lang/python/Include/osdefs.h
r3225 r3364 20 20 #define MAXPATHLEN 256 21 21 #endif 22 22 23 #define DELIM ';' 23 24 #endif … … 34 35 #ifndef SEP 35 36 #define SEP '/' 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 36 65 #endif 37 66 -
trunk/essentials/dev-lang/python/Lib/tempfile.py
r3225 r3364 437 437 return _TemporaryFileWrapper(file, name) 438 438 439 if _os.name != 'posix' or _os.sys.platform == 'cygwin' :439 if _os.name != 'posix' or _os.sys.platform == 'cygwin': 440 440 # On non-POSIX and Cygwin systems, assume that we cannot unlink a file 441 441 # while it is open. -
trunk/essentials/dev-lang/python/Makefile.pre.in
r3225 r3364 484 484 485 485 $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES) 486 486 487 $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL) 488 487 489 488 490 $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) 491 489 492 $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL) 493 490 494 491 495 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H) -
trunk/essentials/dev-lang/python/Modules/getpath.c
r3225 r3364 136 136 { 137 137 size_t i = strlen(dir); 138 while (i > 0 && dir[i] != SEP)138 while (i > 0 && ) 139 139 --i; 140 140 dir[i] = '\0'; … … 209 209 { 210 210 size_t n, k; 211 if ( stuff[0] == SEP)211 if () 212 212 n = 0; 213 213 else { 214 214 n = strlen(buffer); 215 if (n > 0 && buffer[n-1] != SEP&& n < MAXPATHLEN)215 if (n > 0 && && n < MAXPATHLEN) 216 216 buffer[n++] = SEP; 217 217 } … … 230 230 copy_absolute(char *path, char *p) 231 231 { 232 if ( p[0] == SEP)232 if ( 233 233 strcpy(path, p); 234 235 236 237 238 239 234 240 else { 235 241 getcwd(path, MAXPATHLEN); 236 if (p[0] == '.' && p[1] == SEP)242 if (p[0] == '.' && ) 237 243 p += 2; 238 244 joinpath(path, p); … … 246 252 char buffer[MAXPATHLEN + 1]; 247 253 248 if (path[0] == SEP) 254 if (IS_ABSPATH(path)) { 255 #ifdef ALTSEP 256 while ((path = strchr(path, ALTSEP))) 257 *path++ = SEP; 258 #endif 249 259 return; 260 250 261 copy_absolute(buffer, path); 251 262 strcpy(path, buffer); … … 399 410 * $PATH isn't exported, you lose. 400 411 */ 401 if ( strchr(prog, SEP))412 if ()) 402 413 strncpy(progpath, prog, MAXPATHLEN); 403 414 #ifdef __APPLE__ … … 442 453 else 443 454 progpath[0] = '\0'; 444 if (progpath[0] != SEP) 455 #ifndef ALTSEP 456 if (!IS_ABSPATH(progpath)) 457 #endif 445 458 absolutize(progpath); 446 459 strncpy(argv0_path, progpath, MAXPATHLEN); … … 488 501 /* It's not null terminated! */ 489 502 tmpbuffer[linklen] = '\0'; 490 if ( tmpbuffer[0] == SEP)503 if () 491 504 /* tmpbuffer should never be longer than MAXPATHLEN, 492 505 but extra check does not hurt */ … … 553 566 554 567 while (1) { 555 char *delim = strchr(defpath, DELIM);556 557 if ( defpath[0] != SEP)568 char *delim = strchr(defpath, 569 570 if () 558 571 /* Paths are relative to prefix */ 559 572 bufsz += prefixsz; … … 598 611 defpath = pythonpath; 599 612 while (1) { 600 char *delim = strchr(defpath, DELIM);601 602 if ( defpath[0] != SEP) {613 char *delim = strchr(defpath, 614 615 if () { 603 616 strcat(buf, prefix); 604 617 strcat(buf, separator); … … 606 619 607 620 if (delim) { 608 size_t len = delim - defpath + 1;621 size_t len = delim - defpath; 609 622 size_t end = strlen(buf) + len; 610 623 strncat(buf, defpath, len); 611 *(buf + end) = '\0'; 624 *(buf + end) = DELIM; /* bird: correct the DELIM char. */ 625 *(buf + end + 1) = '\0'; 612 626 } 613 627 else { -
trunk/essentials/dev-lang/python/Modules/posixmodule.c
r3225 r3364 132 132 #define fsync _commit 133 133 #else 134 #if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS)134 #if ) || defined(__VMS) 135 135 /* Everything needed is defined in PC/os2emx/pyconfig.h or vms/pyconfig.h */ 136 136 #else /* all other compilers */ -
trunk/essentials/dev-lang/python/Objects/exceptions.c
r3225 r3364 1052 1052 return "???"; 1053 1053 while (*cp != '\0') { 1054 if ( *cp == SEP)1054 if () 1055 1055 result = cp + 1; 1056 1056 ++cp; -
trunk/essentials/dev-lang/python/PC/os2emx/Setup.os2emx
r3343 r3364 110 110 # setup.py script in the root of the Python source tree. 111 111 112 posix posixmodule.c #posix (UNIX) system calls112 posix (UNIX) system calls 113 113 errno errnomodule.c # posix (UNIX) errno values 114 114 pwd pwdmodule.c # this is needed to find out the user's home dir -
trunk/essentials/dev-lang/python/Python/dynload_shlib.c
r3225 r3364 21 21 #else 22 22 #if defined(PYOS_OS2) && defined(PYCC_GCC) 23 24 25 23 26 #include "dlfcn.h" 24 27 #endif 25 28 #endif 26 29 27 #if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__) 30 #if ((defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__)) \ 31 || (defined(__OS2__) && defined(__KLIBC__)) 28 32 #define LEAD_UNDERSCORE "_" 29 33 #else … … 37 41 {"module.dll", "rb", C_EXTENSION}, 38 42 #else 39 #if defined(PYOS_OS2) && defined(PYCC_GCC)43 #if ) 40 44 {".pyd", "rb", C_EXTENSION}, 41 45 {".dll", "rb", C_EXTENSION}, … … 82 86 } 83 87 84 PyOS_snprintf(funcname, sizeof(funcname), 88 PyOS_snprintf(funcname, sizeof(funcname), 85 89 LEAD_UNDERSCORE "init%.200s", shortname); 86 90 … … 114 118 115 119 if (Py_VerboseFlag) 116 PySys_WriteStderr("dlopen(\"%s\", %x);\n", pathname, 120 PySys_WriteStderr("dlopen(\"%s\", %x);\n", pathname, 117 121 dlopenflags); 118 122 … … 123 127 /* As C module use only one name space this is probably not a */ 124 128 /* important limitation */ 125 PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s", 129 PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s", 126 130 shortname); 127 131 pathname = pathbuf; -
trunk/essentials/dev-lang/python/Python/import.c
r3225 r3364 1475 1475 #include <dirent.h> 1476 1476 1477 1478 1479 1477 1480 #elif defined(PYOS_OS2) 1478 1481 #define INCL_DOS … … 1594 1597 1595 1598 /* OS/2 */ 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1596 1622 #elif defined(PYOS_OS2) 1597 1623 HDIR hdir = 1; -
trunk/essentials/dev-lang/python/Python/sysmodule.c
r3225 r3364 1319 1319 /* It's a symlink */ 1320 1320 link[nr] = '\0'; 1321 if ( link[0] == SEP)1321 if () 1322 1322 argv0 = link; /* Link to absolute path */ 1323 else if ( strchr(link, SEP) == NULL)1323 else if () 1324 1324 ; /* Link without path */ 1325 1325 else { 1326 1326 /* Must join(dirname(argv0), link) */ 1327 1327 char *q = strrchr(argv0, SEP); 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1328 1338 if (q == NULL) 1329 1339 argv0 = link; /* argv0 without path */ … … 1331 1341 /* Must make a copy */ 1332 1342 strcpy(argv0copy, argv0); 1333 q = strrchr(argv0copy, SEP);1343 ; 1334 1344 strcpy(q+1, link); 1335 1345 argv0 = argv0copy; … … 1369 1379 #endif 1370 1380 p = strrchr(argv0, SEP); 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1371 1392 } 1372 1393 if (p != NULL) { -
trunk/essentials/dev-lang/python/Python/traceback.c
r3225 r3364 140 140 PyObject *path; 141 141 char *tail = strrchr(filename, SEP); 142 143 144 145 146 147 148 149 150 142 151 if (tail == NULL) 143 152 tail = filename; … … 164 173 if (strlen(namebuf) != len) 165 174 continue; /* v contains '\0' */ 166 if (len > 0 && namebuf[len-1] != SEP)175 if (len > 0 && ) 167 176 namebuf[len++] = SEP; 168 177 strcpy(namebuf+len, tail); -
trunk/essentials/dev-lang/python/configure.in
r3225 r3364 184 184 atheos*) MACHDEP="atheos";; 185 185 irix646) MACHDEP="irix6";; 186 187 186 188 '') MACHDEP="unknown";; 187 189 esac … … 487 489 gcc) CC="$CC -D_HAVE_BSDI";; 488 490 esac;; 491 492 493 489 494 esac 490 495 … … 519 524 # LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On 520 525 # systems without shared libraries, LDLIBRARY is the same as LIBRARY 521 # (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,522 # DLLLIBRARY is the shared (i.e., DLL) library.523 # 526 # (defined in the Makefiles). On Cygwin 527 # DLLLIBRARY is the shared (i.e., DLL) library. 528 # 524 529 # RUNSHARED is used to run shared python without installed libraries 525 530 # … … 665 670 RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib} 666 671 ;; 672 673 674 675 676 677 678 667 679 esac 668 680 else # shared is disabled … … 706 718 BeOS*) LN="ln -s";; 707 719 CYGWIN*) LN="ln -s";; 720 708 721 atheos*) LN="ln -s";; 709 722 *) LN=ln;; … … 1396 1409 AC_SUBST(LINKFORSHARED) 1397 1410 # SO is the extension of shared libraries `(including the dot!) 1398 # -- usually .so, .sl on HP-UX, .dll on Cygwin 1411 # -- usually .so, .sl on HP-UX, .dll on Cygwin 1399 1412 AC_MSG_CHECKING(SO) 1400 1413 if test -z "$SO" … … 1408 1421 ;; 1409 1422 CYGWIN*) SO=.dll;; 1423 1410 1424 *) SO=.so;; 1411 1425 esac … … 3402 3416 if test ! -f Modules/Setup 3403 3417 then 3404 cp $srcdir/Modules/Setup.dist Modules/Setup 3418 if test "$MACHDEP" = "emx"; then 3419 cp $srcdir/PC/os2emx/Modules/Setup.os2emx Modules/Setup 3420 else 3421 cp $srcdir/Modules/Setup.dist Modules/Setup 3422 if 3405 3423 fi 3406 3424
Note:
See TracChangeset
for help on using the changeset viewer.
