[ARVADOS] updated: d67d6c4e86ecc98d433c7f6da270cd9d43072dc0

git at public.curoverse.com git at public.curoverse.com
Wed Mar 4 16:38:46 EST 2015


Summary of changes:
 .../app/controllers/actions_controller.rb          |  54 ++++++++-
 sdk/python/arvados/api.py                          |  65 ++++++-----
 sdk/python/arvados/keep.py                         |  16 +++
 sdk/python/tests/test_api.py                       |   7 ++
 .../controllers/arvados/v1/schema_controller.rb    |   1 +
 services/api/config/application.default.yml        |   6 +
 services/crunchstat/crunchstat.go                  |  98 ++++++++--------
 services/crunchstat/crunchstat_test.go             | 125 ++++++++++++++-------
 8 files changed, 250 insertions(+), 122 deletions(-)

       via  d67d6c4e86ecc98d433c7f6da270cd9d43072dc0 (commit)
       via  fc1d010fe970f6c78696423319c21b821e42fbf9 (commit)
       via  fcad01c98cfc6bab6af9c6d461692c28bfba6de8 (commit)
       via  5fbc413ccdabc9c7551f13e5a76573d72c438251 (commit)
       via  068189e8be1e83066ea3c7b79a1dfdb2dcacde54 (commit)
       via  3979c83819a07b544aa4a0510bbeb58d1c92905a (commit)
       via  b434a3a88bffcf068b500c430d6a0db0c6923190 (commit)
       via  a04ea95e79c60ed2a54eaec5b5c2e235fe39ef9a (commit)
       via  0b4ad564482929d3f8eaefe8324df54bb276b74b (commit)
       via  78387b4fb0abf03bbc6523acec7babf1e6ef321b (commit)
       via  f1589a6f1c94fe066232e0474c76485369b971f2 (commit)
       via  4d26f92c806e36c4dcfcb4809c854d5081c86fff (commit)
       via  508bcab6bd1a7ca34a929d7314f5ad5c2e48ce26 (commit)
       via  46558e7be9da2099ccb12497230ad81ed1d35889 (commit)
       via  61508b804d2ab9fc36308bb74c00e5bd58e09314 (commit)
      from  912699d40991706b279aa6f9ed51991ea9250001 (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 d67d6c4e86ecc98d433c7f6da270cd9d43072dc0
Merge: fc1d010 fcad01c
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Wed Mar 4 16:38:27 2015 -0500

    Merge branch 'master' into 5145-combine-collections-repeated-filenames


commit fc1d010fe970f6c78696423319c21b821e42fbf9
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Wed Mar 4 16:31:16 2015 -0500

    5145: while combining colletions, append an integer for any duplicate files.

diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index 59dcbb9..97acc38 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -147,12 +147,48 @@ class ActionsController < ApplicationController
     end
 
     combined = ""
+    files_in_dirs = {}
     files.each do |m|
       mt = chash[m[1]+m[2]].andand.manifest_text
       if not m[4].nil? and m[4].size > 1
-        combined += arv_normalize mt, '--extract', ".#{m[4]}"
+        manifest_files = files_in_dirs['.']
+        if !manifest_files
+          manifest_files = []
+          files_in_dirs['.'] = manifest_files
+        end
+        manifest_file = m[4].split('/')[-1]
+        uniq_file = derive_unique_filename(manifest_file, manifest_files)
+        normalized = arv_normalize mt, '--extract', ".#{m[4]}"
+        normalized = normalized.gsub(manifest_file) {|s| uniq_file}
+        combined += normalized
+        manifest_files << uniq_file
       else
-        combined += mt
+        manifest_streams = mt.split "\n"
+        adjusted_streams = []
+        manifest_streams.each do |stream|
+          manifest_parts = stream.split
+          adjusted_parts = []
+          manifest_files = files_in_dirs[manifest_parts[0]]
+          if !manifest_files
+            manifest_files = []
+            files_in_dirs[manifest_parts[0]] = manifest_files
+          end
+
+          manifest_parts.each do |part|
+            part_match = /\d*:\d*:(.*)/.match(part)
+            if part_match
+              uniq_file = derive_unique_filename(part_match[1], manifest_files)
+              adjusted_parts << (part.gsub(part_match[1]) {|s| uniq_file})
+              manifest_files << uniq_file
+            else
+              adjusted_parts << part
+            end
+          end
+          adjusted_streams << adjusted_parts.join(' ')
+        end
+        adjusted_streams.each do |stream|
+          combined += (stream + "\n")
+        end
       end
     end
 
@@ -206,4 +242,18 @@ class ActionsController < ApplicationController
     end
   end
 
+  protected
+
+  def derive_unique_filename filename, manifest_files
+    filename_parts = filename.split('.')
+    filename_part = filename_parts[0]
+    counter = 1
+    while true
+      return filename if !manifest_files.include? filename
+      filename_parts[0] = filename_part + "(" + counter.to_s + ")"
+      filename = filename_parts.join('.')
+      counter += 1
+    end
+  end
+
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list