From 257fb1141f2dcb22d3ac6c8bb63af94bc3d652af Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 20 Aug 2017 00:23:11 +0200 Subject: updater: replace whitespace in dir names and strip the extra win dir layer Change-Id: I543b903157d44038468eb4d92261dfd0d8b2909b --- bin/update/tools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/update/tools.py b/bin/update/tools.py index 1e14f793cceb..8cd786635f0d 100644 --- a/bin/update/tools.py +++ b/bin/update/tools.py @@ -20,7 +20,12 @@ def uncompress_file_to_dir(compressed_file, uncompress_dir): zip_file = zipfile.ZipFile(compressed_file) zip_file.extractall(uncompress_dir) zip_file.close() - pass + + uncompress_dir = os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0]) + if " " in os.listdir(uncompress_dir)[0]: + print("replacing whitespace in directory name") + os.rename(os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0]), + os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0].replace(" ", "_"))) else: print("Error: unknown extension " + extension) -- cgit