summaryrefslogtreecommitdiffstats
path: root/bootstrap.py
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2013-05-22 20:47:29 (GMT)
committerDirk Baechle <dl9obn@darc.de>2013-05-22 20:47:29 (GMT)
commit412e04144b3ce118f450e250134d66724a68ce04 (patch)
treea0015f77e435c319ff2c5c6ff7077921295f526c /bootstrap.py
parent320244104f2de73a758b0644d12185981c111582 (diff)
downloadSCons-412e04144b3ce118f450e250134d66724a68ce04.zip
SCons-412e04144b3ce118f450e250134d66724a68ce04.tar.gz
SCons-412e04144b3ce118f450e250134d66724a68ce04.tar.bz2
- fixed bootstrap.py, such that it can be called from an arbitrary working directory again
- fixed indentation in SConsDoc.py
Diffstat (limited to 'bootstrap.py')
-rwxr-xr-xbootstrap.py31
1 files changed, 7 insertions, 24 deletions
diff --git a/bootstrap.py b/bootstrap.py
index 78a85b5..1f80fb2 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -80,9 +80,7 @@ def parseManifestLines(basedir, lines):
comment lines, starting with a '#'.
"""
sources = []
- oldwd = os.path.abspath(os.getcwd())
basewd = os.path.abspath(basedir)
- os.chdir(basedir)
for l in lines:
if l.startswith('#'):
# Skip comments
@@ -90,33 +88,18 @@ def parseManifestLines(basedir, lines):
l = l.rstrip('\n')
if l.endswith('**'):
# Glob all files recursively
- globwd, tail = os.path.split(l)
- if globwd:
- os.chdir(globwd)
- for path, dirs, files in os.walk('.'):
+ globwd = os.path.dirname(os.path.join(basewd, l))
+ for path, dirs, files in os.walk(globwd):
for f in files:
- if globwd:
- fpath = os.path.join(globwd, path, f)
- else:
- fpath = os.path.join(path, f)
- sources.append(os.path.normpath(fpath))
- if globwd:
- os.chdir(basewd)
+ fpath = os.path.join(globwd, path, f)
+ sources.append(os.path.relpath(fpath, basewd))
elif '*' in l:
# Glob file pattern
- globwd, tail = os.path.split(l)
- if globwd:
- os.chdir(globwd)
- files = glob.glob(tail)
- for f in files:
- fpath = os.path.join(globwd, f)
- sources.append(os.path.normpath(fpath))
- os.chdir(basewd)
- else:
- sources.extend(glob.glob(tail))
+ files = glob.glob(os.path.join(basewd, l))
+ for f in files:
+ sources.append(os.path.relpath(f, basewd))
else:
sources.append(l)
- os.chdir(oldwd)
return sources