diff options
author | Guido van Rossum <guido@python.org> | 1999-06-23 21:37:57 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-06-23 21:37:57 (GMT) |
commit | ce7695191fdcfd5564a6fdf7f54255c74206a8c2 (patch) | |
tree | 8fa07e808fdd9d3356f1433914ee2ae53653e477 /Tools/freeze | |
parent | 7c2426439e2b38f3cd2c647c52434407ba7bf9df (diff) | |
download | cpython-ce7695191fdcfd5564a6fdf7f54255c74206a8c2.zip cpython-ce7695191fdcfd5564a6fdf7f54255c74206a8c2.tar.gz cpython-ce7695191fdcfd5564a6fdf7f54255c74206a8c2.tar.bz2 |
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).
Diffstat (limited to 'Tools/freeze')
-rw-r--r-- | Tools/freeze/checkextensions.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/freeze/checkextensions.py b/Tools/freeze/checkextensions.py index 4ed2a7c..8d597bf 100644 --- a/Tools/freeze/checkextensions.py +++ b/Tools/freeze/checkextensions.py @@ -47,9 +47,10 @@ def select(e, mods, vars, mod, skipofiles): for w in string.split(w): if skipofiles and w[-2:] == '.o': continue - if w[0] != '-' and w[-2:] in ('.o', '.a'): + # Assume $var expands to absolute pathname + if w[0] not in ('-', '$') and w[-2:] in ('.o', '.a'): w = os.path.join(e, w) - if w[:2] in ('-L', '-R'): + if w[:2] in ('-L', '-R') and w[2:3] != '$': w = w[:2] + os.path.join(e, w[2:]) files.append(w) return files |