aboutsummaryrefslogtreecommitdiff
path: root/tools/file_packager.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-06-18 16:47:33 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-06-18 16:47:33 -0700
commit571abfdbe1cf1a174d1f9454881c4119f80e7447 (patch)
tree36efa6725e335377938376d44ceb9caa34c0a854 /tools/file_packager.py
parent0b2ef820afa027b66358d9cf4b535af25136c606 (diff)
handle case of nonexisting .crn when testing dds updates
Diffstat (limited to 'tools/file_packager.py')
-rw-r--r--tools/file_packager.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/file_packager.py b/tools/file_packager.py
index 4a3d8030..dfb9ec15 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -160,9 +160,12 @@ if crunch:
if file_['name'].endswith(CRUNCH_INPUT_SUFFIX):
# Do not crunch if crunched version exists and is more recent than dds source
crunch_name = unsuffixed(file_['name']) + CRUNCH_OUTPUT_SUFFIX
- crunch_time = os.stat(crunch_name).st_mtime
- dds_time = os.stat(file_['name']).st_mtime
- if dds_time < crunch_time: continue
+ try:
+ crunch_time = os.stat(crunch_name).st_mtime
+ dds_time = os.stat(file_['name']).st_mtime
+ if dds_time < crunch_time: continue
+ except:
+ pass # if one of them does not exist, continue on
Popen([CRUNCH, '-file', file_['name'], '-quality', crunch], stdout=sys.stderr).communicate()
shutil.move(os.path.basename(crunch_name), crunch_name) # crunch places files in the current dir