X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ff22334d01e09b0074be6416f9285dae8d5af565..8ab0bcca4fc5dae249e25a97bbc3a816c160d05d:/lib/crunchrun/copier.go diff --git a/lib/crunchrun/copier.go b/lib/crunchrun/copier.go index d440b8f8d3..a081c5d325 100644 --- a/lib/crunchrun/copier.go +++ b/lib/crunchrun/copier.go @@ -51,7 +51,6 @@ type filetodo struct { // manifest, err := (&copier{...}).Copy() type copier struct { client *arvados.Client - arvClient IArvadosClient keepClient IKeepClient hostOutputDir string ctrOutputDir string @@ -161,7 +160,20 @@ func (cp *copier) walkMount(dest, src string, maxSymlinks int, walkMountsBelow b // srcRelPath is the path to the file/dir we are trying to // copy, relative to its mount point -- ".", "./foo.txt", ... srcRelPath := filepath.Join(".", srcMount.Path, src[len(srcRoot):]) - outputRelPath := src[len(cp.ctrOutputDir):] + + // outputRelPath is the path relative in the output directory + // that corresponds to the path in the output collection where + // the file will go, for logging + var outputRelPath = "" + if strings.HasPrefix(src, cp.ctrOutputDir) { + outputRelPath = strings.TrimPrefix(src[len(cp.ctrOutputDir):], "/") + } + if outputRelPath == "" { + // blank means copy a whole directory, so replace it + // with a wildcard to make it a little clearer what's + // going on since outputRelPath is only used for logging + outputRelPath = "*" + } switch { case srcMount.ExcludeFromOutput: @@ -359,7 +371,7 @@ func (cp *copier) getManifest(pdh string) (*manifest.Manifest, error) { return mft, nil } var coll arvados.Collection - err := cp.arvClient.Get("collections", pdh, nil, &coll) + err := cp.client.RequestAndDecode(&coll, "GET", "arvados/v1/collections/"+pdh, nil, nil) if err != nil { return nil, fmt.Errorf("error retrieving collection record for %q: %s", pdh, err) }