[ARVADOS] updated: 0a53423e423d107e457e1555ce3ec4e9ab2dd911
git at public.curoverse.com
git at public.curoverse.com
Tue Aug 12 11:42:15 EDT 2014
Summary of changes:
crunch_scripts/decompress-all.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
via 0a53423e423d107e457e1555ce3ec4e9ab2dd911 (commit)
from fd7cf52127c9aa905aeae09b13dd4d1ee9f66e1c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 0a53423e423d107e457e1555ce3ec4e9ab2dd911
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Aug 12 11:42:09 2014 -0400
3373: Test filename extension before attempting to call dtrx. Non-zero dtrx exit code is now treated as failure.
diff --git a/crunch_scripts/decompress-all.py b/crunch_scripts/decompress-all.py
index 460425f..9a286b2 100755
--- a/crunch_scripts/decompress-all.py
+++ b/crunch_scripts/decompress-all.py
@@ -45,12 +45,18 @@ if streamname != None:
os.chdir(streamname)
else:
streamname = '.'
-streamreader = filter(lambda s: s.name() == streamname, cr.all_streams())[0]
-filereader = streamreader.files()[filename]
-rc = subprocess.call(["dtrx", "-r", "-n", "-q", arvados.get_task_param_mount('input')])
-if rc == 0:
- out = arvados.CollectionWriter()
- out.write_directory_tree(outdir, max_manifest_depth=0)
- task.set_output(out.finish())
+
+m = re.match(r'\.(gz|Z|bz2|tgz|tbz|zip|rar|7z|cab|deb|rpm|cpio|gem)$', arvados.get_task_param_mount('input'), re.IGNORECASE)
+
+if m != None:
+ rc = subprocess.call(["dtrx", "-r", "-n", "-q", arvados.get_task_param_mount('input')])
+ if rc == 0:
+ out = arvados.CollectionWriter()
+ out.write_directory_tree(outdir, max_manifest_depth=0)
+ task.set_output(out.finish())
+ else:
+ return rc
else:
+ streamreader = filter(lambda s: s.name() == streamname, cr.all_streams())[0]
+ filereader = streamreader.files()[filename]
task.set_output(streamname + filereader.as_manifest()[1:])
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list