Merge pull request #3078 from yuanxing-THU/master

Ignore .DS_Store in the ROMFS pruner.
This commit is contained in:
Lorenz Meier 2015-10-27 22:25:23 +01:00
commit 8ba0c003db
1 changed files with 2 additions and 3 deletions

View File

@ -57,7 +57,7 @@ def main():
for (root, dirs, files) in os.walk(args.folder): for (root, dirs, files) in os.walk(args.folder):
for file in files: for file in files:
# only prune text files # only prune text files
if ".zip" in file or ".bin" in file or ".swp" in file or ".data" in file: if ".zip" in file or ".bin" in file or ".swp" in file or ".data" in file or ".DS_Store" in file:
continue continue
file_path = os.path.join(root, file) file_path = os.path.join(root, file)
@ -74,7 +74,6 @@ def main():
else: else:
if not line.isspace() and not line.strip().startswith("#"): if not line.isspace() and not line.strip().startswith("#"):
pruned_content += line pruned_content += line
# overwrite old scratch file # overwrite old scratch file
with open(file_path, "wb") as f: with open(file_path, "wb") as f:
f.write(pruned_content.encode("ascii", errors='strict')) f.write(pruned_content.encode("ascii", errors='strict'))