Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
loc = srcobj["location"]
if loc.startswith("_:"):
return True
loc = srcobj["location"]
if loc.startswith("_:"):
return True
- if prefix:
- if loc != prefix+srcobj["basename"]:
- return True
- else:
i = loc.rfind("/")
if i > -1:
prefix = loc[:i+1]
else:
prefix = loc+"/"
i = loc.rfind("/")
if i > -1:
prefix = loc[:i+1]
else:
prefix = loc+"/"
+
+ if loc != prefix+srcobj["basename"]:
+ return True
+
if srcobj["class"] == "File" and loc not in self._pathmap:
return True
for s in srcobj.get("secondaryFiles", []):
if srcobj["class"] == "File" and loc not in self._pathmap:
return True
for s in srcobj.get("secondaryFiles", []):
"Directory" if os.path.isdir(ab) else "File", True)
for srcobj in referenced_files:
"Directory" if os.path.isdir(ab) else "File", True)
for srcobj in referenced_files:
+ print("na na na", srcobj, srcobj["location"].endswith("/"+srcobj["basename"]))
remap = []
if srcobj["class"] == "Directory" and srcobj["location"] not in self._pathmap:
c = arvados.collection.Collection(api_client=self.arvrunner.api,
remap = []
if srcobj["class"] == "Directory" and srcobj["location"] not in self._pathmap:
c = arvados.collection.Collection(api_client=self.arvrunner.api,
ab = self.collection_pattern % c.portable_data_hash()
self._pathmap[srcobj["location"]] = MapperEnt("keep:"+c.portable_data_hash(), ab, "Directory", True)
ab = self.collection_pattern % c.portable_data_hash()
self._pathmap[srcobj["location"]] = MapperEnt("keep:"+c.portable_data_hash(), ab, "Directory", True)
- elif srcobj["class"] == "File" and (srcobj.get("secondaryFiles") or
- (srcobj["location"].startswith("_:") and "contents" in srcobj)):
-
- # If all secondary files/directories are located in
- # the same collection as the primary file and the
- # paths and names that are consistent with staging,
- # don't create a new collection.
- if not self.needs_new_collection(srcobj):
- continue
-
+ elif srcobj["class"] == "File" and self.needs_new_collection(srcobj):
c = arvados.collection.Collection(api_client=self.arvrunner.api,
keep_client=self.arvrunner.keep_client,
num_retries=self.arvrunner.num_retries )
c = arvados.collection.Collection(api_client=self.arvrunner.api,
keep_client=self.arvrunner.keep_client,
num_retries=self.arvrunner.num_retries )
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+class: CommandLineTool
+cwlVersion: v1.2
+inputs:
+ p: File
+ checkname: string
+outputs: []
+arguments:
+ - sh
+ - "-c"
+ - |
+ name=`basename $(inputs.p.path)`
+ ls -l $(inputs.p.path)
+ if test $name = $(inputs.checkname) ; then
+ echo success
+ else
+ echo expected basename to be $(inputs.checkname) but was $name
+ exit 1
+ fi
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+class: ExpressionTool
+cwlVersion: v1.2
+inputs:
+ f1: File
+ newname: string
+outputs:
+ out: File
+expression: |
+ ${
+ inputs.f1.basename = inputs.newname;
+ return {"out": inputs.f1};
+ }
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+class: Workflow
+cwlVersion: v1.2
+inputs:
+ f1:
+ type: File
+ default:
+ class: File
+ location: whale.txt
+ newname:
+ type: string
+ default: "badger.txt"
+outputs: []
+requirements:
+ StepInputExpressionRequirement: {}
+ InlineJavascriptRequirement: {}
+steps:
+ rename:
+ in:
+ f1: f1
+ newname: newname
+ run: rename.cwl
+ out: [out]
+
+ echo:
+ in:
+ p: rename/out
+ checkname: newname
+ out: []
+ run: check.cwl
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+whale
output: {}
tool: chipseq/cwl-packed.json
doc: "Test issue 18723 - correctly upload two directories with the same basename"
output: {}
tool: chipseq/cwl-packed.json
doc: "Test issue 18723 - correctly upload two directories with the same basename"
+
+- job: null
+ output: {}
+ tool: 18994-basename/wf_ren.cwl
+ doc: "Test issue 18994 - correctly stage file with modified basename"