Also glob the 'rm' field

This commit is contained in:
Daniel Martí 2014-04-15 23:58:12 +02:00
parent d4f9f341ed
commit 559ad9ef5b

View file

@ -1094,7 +1094,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
# Delete unwanted files # Delete unwanted files
if 'rm' in build: if 'rm' in build:
for part in build['rm']: for part in getpaths(build_dir, build, 'rm'):
dest = os.path.join(build_dir, part) dest = os.path.join(build_dir, part)
logging.info("Removing {0}".format(part)) logging.info("Removing {0}".format(part))
if os.path.lexists(dest): if os.path.lexists(dest):
@ -1183,7 +1183,7 @@ def getpaths(build_dir, build, field):
p = p.strip() p = p.strip()
full_path = os.path.join(build_dir, p) full_path = os.path.join(build_dir, p)
full_path = os.path.normpath(full_path) full_path = os.path.normpath(full_path)
paths += [r[len(build_dir):] for r in glob.glob(full_path)] paths += [r[len(build_dir)+1:] for r in glob.glob(full_path)]
return paths return paths
# Scan the source code in the given directory (and all subdirectories) # Scan the source code in the given directory (and all subdirectories)
@ -1259,7 +1259,7 @@ def scan_source(build_dir, root_dir, thisbuild):
# Path (relative) to the file # Path (relative) to the file
fp = os.path.join(r, curfile) fp = os.path.join(r, curfile)
fd = fp[len(build_dir):] fd = fp[len(build_dir)+1:]
# Check if this file has been explicitly excluded from scanning # Check if this file has been explicitly excluded from scanning
if toignore(fd): if toignore(fd):