Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mkudlvasr
python-2.4
python-2.4.2-canonicalize2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File python-2.4.2-canonicalize2.patch of Package python-2.4
--- pyconfig.h.in.canonicalize 2005-09-14 11:47:04.000000000 -0400 +++ pyconfig.h.in 2005-09-14 11:47:02.000000000 -0400 @@ -58,6 +58,9 @@ /* Define if pthread_sigmask() does not work on your system. */ #undef HAVE_BROKEN_PTHREAD_SIGMASK +/* Define to 1 if you have the `canonicalize_file_name' function. */ +#undef HAVE_CANONICALIZE_FILE_NAME + /* Define to 1 if you have the `chown' function. */ #undef HAVE_CHOWN --- Python/sysmodule.c.orig 2005-09-15 15:00:25.000000000 +0200 +++ Python/sysmodule.c 2005-10-04 19:04:32.000000000 +0200 @@ -1184,7 +1184,20 @@ char *p = NULL; int n = 0; PyObject *a; -#ifdef HAVE_READLINK +#ifdef HAVE_CANONICALIZE_FILE_NAME + int errnum; + + if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) { + argv0 = canonicalize_file_name(argv0); + if (argv0 == NULL) argv0 = strdup(argv[0]); + } +#elif defined(HAVE_REALPATH) + if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) { + if (realpath(argv0, fullpath)) { + argv0 = fullpath; + } + } +#elif defined(HAVE_READLINK) char link[MAXPATHLEN+1]; char argv0copy[2*MAXPATHLEN+1]; int nr = 0; @@ -1211,7 +1224,8 @@ } } } -#endif /* HAVE_READLINK */ +#endif /* resolve method selection */ + #if SEP == '\\' /* Special case for MS filename syntax */ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) { char *q; @@ -1237,11 +1251,6 @@ } #else /* All other filename syntaxes */ if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) { -#if defined(HAVE_REALPATH) - if (realpath(argv0, fullpath)) { - argv0 = fullpath; - } -#endif p = strrchr(argv0, SEP); } if (p != NULL) { @@ -1259,6 +1268,9 @@ a = PyString_FromStringAndSize(argv0, n); if (a == NULL) Py_FatalError("no mem for sys.path insertion"); +#ifdef HAVE_CANONICALIZE_FILE_NAME + if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) free(argv0); +#endif /* HAVE_CANONICALIZE_FILE_NAME */ if (PyList_Insert(path, 0, a) < 0) Py_FatalError("sys.path.insert(0) failed"); Py_DECREF(a); --- configure.in.canonicalize 2005-09-14 11:46:00.000000000 -0400 +++ configure.in 2005-09-14 11:47:22.000000000 -0400 @@ -2096,8 +2096,8 @@ AC_MSG_RESULT(MACHDEP_OBJS) # checks for library functions -AC_CHECK_FUNCS(alarm bind_textdomain_codeset chown clock confstr ctermid \ - execv fork fpathconf ftime ftruncate \ +AC_CHECK_FUNCS(alarm bind_textdomain_codeset canonicalize_file_name chown \ + clock confstr ctermid execv fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getpwent getsid getwd \ kill killpg lchown lstat mkfifo mknod mktime \
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor