Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce76951

Browse files
committed
Simplified version of a patch by Chih-Hao Huang, who wrote:
""" When there are additional Setup files, specified by -e option of freeze, checkextenstions.py assumes that *.o, *.a, -Lpath, and -Rpath are all relative to where the Setup file is. select() inserts the path to the Setup file to make them absolute. However, the assumption is not true. There are cases that absolute paths are specified for them. The inserted prefix, by select(), results in error. The following fix check for absolute paths. The assumption is: an absolute path begins with either '/' or '$'. In the latter case, it is from the environmental variable. (Variables defined locally in the Setup file have already been handled by expandvars()) """ My version of the patch has been verified by Charles Waldman (a colleague of Chih-Hao).
1 parent 7c24264 commit ce76951

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Tools/freeze/checkextensions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ def select(e, mods, vars, mod, skipofiles):
4747
for w in string.split(w):
4848
if skipofiles and w[-2:] == '.o':
4949
continue
50-
if w[0] != '-' and w[-2:] in ('.o', '.a'):
50+
# Assume $var expands to absolute pathname
51+
if w[0] not in ('-', '$') and w[-2:] in ('.o', '.a'):
5152
w = os.path.join(e, w)
52-
if w[:2] in ('-L', '-R'):
53+
if w[:2] in ('-L', '-R') and w[2:3] != '$':
5354
w = w[:2] + os.path.join(e, w[2:])
5455
files.append(w)
5556
return files

0 commit comments

Comments
 (0)