Ignore:
Timestamp:
May 21, 2007, 2:27:53 AM (19 years ago)
Author:
bird
Message:

In progress...

Location:
trunk/essentials/dev-lang/python
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/essentials/dev-lang/python/Include/osdefs.h

    r3225 r3364  
    2020#define MAXPATHLEN 256
    2121#endif
     22
    2223#define DELIM ';'
    2324#endif
     
    3435#ifndef SEP
    3536#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
    3665#endif
    3766
  • trunk/essentials/dev-lang/python/Lib/tempfile.py

    r3225 r3364  
    437437    return _TemporaryFileWrapper(file, name)
    438438
    439 if _os.name != 'posix' or _os.sys.platform == 'cygwin':
     439if _os.name != 'posix' or _os.sys.platform == 'cygwin':
    440440    # On non-POSIX and Cygwin systems, assume that we cannot unlink a file
    441441    # while it is open.
  • trunk/essentials/dev-lang/python/Makefile.pre.in

    r3225 r3364  
    484484
    485485$(AST_H): $(AST_ASDL) $(ASDLGEN_FILES)
     486
    486487        $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL)
     488
    487489
    488490$(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
     491
    489492        $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL)
     493
    490494
    491495Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
  • trunk/essentials/dev-lang/python/Modules/getpath.c

    r3225 r3364  
    136136{
    137137    size_t i = strlen(dir);
    138     while (i > 0 && dir[i] != SEP)
     138    while (i > 0 && )
    139139        --i;
    140140    dir[i] = '\0';
     
    209209{
    210210    size_t n, k;
    211     if (stuff[0] == SEP)
     211    if ()
    212212        n = 0;
    213213    else {
    214214        n = strlen(buffer);
    215         if (n > 0 && buffer[n-1] != SEP && n < MAXPATHLEN)
     215        if (n > 0 && && n < MAXPATHLEN)
    216216            buffer[n++] = SEP;
    217217    }
     
    230230copy_absolute(char *path, char *p)
    231231{
    232     if (p[0] == SEP)
     232    if (
    233233        strcpy(path, p);
     234
     235
     236
     237
     238
     239
    234240    else {
    235241        getcwd(path, MAXPATHLEN);
    236         if (p[0] == '.' && p[1] == SEP)
     242        if (p[0] == '.' && )
    237243            p += 2;
    238244        joinpath(path, p);
     
    246252    char buffer[MAXPATHLEN + 1];
    247253
    248     if (path[0] == SEP)
     254    if (IS_ABSPATH(path)) {
     255#ifdef ALTSEP
     256        while ((path = strchr(path, ALTSEP)))
     257            *path++ = SEP;
     258#endif
    249259        return;
     260
    250261    copy_absolute(buffer, path);
    251262    strcpy(path, buffer);
     
    399410         * $PATH isn't exported, you lose.
    400411         */
    401         if (strchr(prog, SEP))
     412        if ())
    402413                strncpy(progpath, prog, MAXPATHLEN);
    403414#ifdef __APPLE__
     
    442453        else
    443454                progpath[0] = '\0';
    444         if (progpath[0] != SEP)
     455#ifndef ALTSEP
     456        if (!IS_ABSPATH(progpath))
     457#endif
    445458                absolutize(progpath);
    446459        strncpy(argv0_path, progpath, MAXPATHLEN);
     
    488501            /* It's not null terminated! */
    489502            tmpbuffer[linklen] = '\0';
    490             if (tmpbuffer[0] == SEP)
     503            if ()
    491504                /* tmpbuffer should never be longer than MAXPATHLEN,
    492505                   but extra check does not hurt */
     
    553566
    554567    while (1) {
    555         char *delim = strchr(defpath, DELIM);
    556 
    557         if (defpath[0] != SEP)
     568        char *delim = strchr(defpath,
     569
     570        if ()
    558571            /* Paths are relative to prefix */
    559572            bufsz += prefixsz;
     
    598611        defpath = pythonpath;
    599612        while (1) {
    600             char *delim = strchr(defpath, DELIM);
    601 
    602             if (defpath[0] != SEP) {
     613            char *delim = strchr(defpath,
     614
     615            if () {
    603616                strcat(buf, prefix);
    604617                strcat(buf, separator);
     
    606619
    607620            if (delim) {
    608                 size_t len = delim - defpath + 1;
     621                size_t len = delim - defpath;
    609622                size_t end = strlen(buf) + len;
    610623                strncat(buf, defpath, len);
    611                 *(buf + end) = '\0';
     624                *(buf + end) = DELIM;   /* bird: correct the DELIM char. */
     625                *(buf + end + 1) = '\0';
    612626            }
    613627            else {
  • trunk/essentials/dev-lang/python/Modules/posixmodule.c

    r3225 r3364  
    132132#define fsync _commit
    133133#else
    134 #if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS)
     134#if ) || defined(__VMS)
    135135/* Everything needed is defined in PC/os2emx/pyconfig.h or vms/pyconfig.h */
    136136#else                   /* all other compilers */
  • trunk/essentials/dev-lang/python/Objects/exceptions.c

    r3225 r3364  
    10521052        return "???";
    10531053    while (*cp != '\0') {
    1054         if (*cp == SEP)
     1054        if ()
    10551055            result = cp + 1;
    10561056        ++cp;
  • trunk/essentials/dev-lang/python/PC/os2emx/Setup.os2emx

    r3343 r3364  
    110110# setup.py script in the root of the Python source tree.
    111111
    112 posix posixmodule.c             # posix (UNIX) system calls
     112 posix (UNIX) system calls
    113113errno errnomodule.c             # posix (UNIX) errno values
    114114pwd pwdmodule.c                 # this is needed to find out the user's home dir
  • trunk/essentials/dev-lang/python/Python/dynload_shlib.c

    r3225 r3364  
    2121#else
    2222#if defined(PYOS_OS2) && defined(PYCC_GCC)
     23
     24
     25
    2326#include "dlfcn.h"
    2427#endif
    2528#endif
    2629
    27 #if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__)
     30#if ((defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__)) \
     31    || (defined(__OS2__) && defined(__KLIBC__))
    2832#define LEAD_UNDERSCORE "_"
    2933#else
     
    3741        {"module.dll", "rb", C_EXTENSION},
    3842#else
    39 #if defined(PYOS_OS2) && defined(PYCC_GCC)
     43#if )
    4044        {".pyd", "rb", C_EXTENSION},
    4145        {".dll", "rb", C_EXTENSION},
     
    8286        }
    8387
    84         PyOS_snprintf(funcname, sizeof(funcname), 
     88        PyOS_snprintf(funcname, sizeof(funcname),
    8589                      LEAD_UNDERSCORE "init%.200s", shortname);
    8690
     
    114118
    115119        if (Py_VerboseFlag)
    116                 PySys_WriteStderr("dlopen(\"%s\", %x);\n", pathname, 
     120                PySys_WriteStderr("dlopen(\"%s\", %x);\n", pathname,
    117121                                  dlopenflags);
    118122
     
    123127        /* As C module use only one name space this is probably not a */
    124128        /* important limitation */
    125         PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s", 
     129        PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s",
    126130                      shortname);
    127131        pathname = pathbuf;
  • trunk/essentials/dev-lang/python/Python/import.c

    r3225 r3364  
    14751475#include <dirent.h>
    14761476
     1477
     1478
     1479
    14771480#elif defined(PYOS_OS2)
    14781481#define INCL_DOS
     
    15941597
    15951598/* 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
    15961622#elif defined(PYOS_OS2)
    15971623        HDIR hdir = 1;
  • trunk/essentials/dev-lang/python/Python/sysmodule.c

    r3225 r3364  
    13191319                        /* It's a symlink */
    13201320                        link[nr] = '\0';
    1321                         if (link[0] == SEP)
     1321                        if ()
    13221322                                argv0 = link; /* Link to absolute path */
    1323                         else if (strchr(link, SEP) == NULL)
     1323                        else if ()
    13241324                                ; /* Link without path */
    13251325                        else {
    13261326                                /* Must join(dirname(argv0), link) */
    13271327                                char *q = strrchr(argv0, SEP);
     1328
     1329
     1330
     1331
     1332
     1333
     1334
     1335
     1336
     1337
    13281338                                if (q == NULL)
    13291339                                        argv0 = link; /* argv0 without path */
     
    13311341                                        /* Must make a copy */
    13321342                                        strcpy(argv0copy, argv0);
    1333                                         q = strrchr(argv0copy, SEP);
     1343;
    13341344                                        strcpy(q+1, link);
    13351345                                        argv0 = argv0copy;
     
    13691379#endif
    13701380                        p = strrchr(argv0, SEP);
     1381
     1382
     1383
     1384
     1385
     1386
     1387
     1388
     1389
     1390
     1391
    13711392                }
    13721393                if (p != NULL) {
  • trunk/essentials/dev-lang/python/Python/traceback.c

    r3225 r3364  
    140140                PyObject *path;
    141141                char *tail = strrchr(filename, SEP);
     142
     143
     144
     145
     146
     147
     148
     149
     150
    142151                if (tail == NULL)
    143152                        tail = filename;
     
    164173                                        if (strlen(namebuf) != len)
    165174                                                continue; /* v contains '\0' */
    166                                         if (len > 0 && namebuf[len-1] != SEP)
     175                                        if (len > 0 && )
    167176                                                namebuf[len++] = SEP;
    168177                                        strcpy(namebuf+len, tail);
  • trunk/essentials/dev-lang/python/configure.in

    r3225 r3364  
    184184        atheos*) MACHDEP="atheos";;
    185185        irix646) MACHDEP="irix6";;
     186
     187
    186188        '')     MACHDEP="unknown";;
    187189        esac
     
    487489    gcc) CC="$CC -D_HAVE_BSDI";;
    488490    esac;;
     491
     492
     493
    489494esac
    490495
     
    519524# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
    520525# 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#
    524529# RUNSHARED is used to run shared python without installed libraries
    525530#
     
    665670          RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
    666671          ;;
     672
     673
     674
     675
     676
     677
     678
    667679  esac
    668680else # shared is disabled
     
    706718                BeOS*) LN="ln -s";;
    707719                CYGWIN*) LN="ln -s";;
     720
    708721                atheos*) LN="ln -s";;
    709722                *) LN=ln;;
     
    13961409AC_SUBST(LINKFORSHARED)
    13971410# 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
    13991412AC_MSG_CHECKING(SO)
    14001413if test -z "$SO"
     
    14081421                ;;
    14091422        CYGWIN*)   SO=.dll;;
     1423
    14101424        *)         SO=.so;;
    14111425        esac
     
    34023416if test ! -f Modules/Setup
    34033417then
    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
    34053423fi
    34063424
Note: See TracChangeset for help on using the changeset viewer.