From 55aaa11f2d32ce7d39a6c2faa23167d3be66f8ca Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" Date: Thu, 25 Jan 2024 20:55:03 -0800 Subject: [PATCH] Use proper hurdat2 package (with README) --- .../main/nextflow/quilt/jep/QuiltPackage.groovy | 1 + .../quilt/nio/QuiltFileSystemProvider.groovy | 15 +++++++++------ .../quilt/nio/QuiltFileSystemProviderTest.groovy | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index 0cc72db7..ef94562b 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -195,6 +195,7 @@ class QuiltPackage { manifest.install(dest) log.debug("done: installed into $dest)") + println("Children: ${relativeChildren('')}") } catch (IOException e) { log.error("failed to install $packageName") // this is non-fatal error, so we don't want to stop the pipeline diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy index a2ea1d8f..9c10afa7 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy @@ -116,27 +116,30 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr void download(Path remoteFile, Path localDestination, CopyOption... options) throws IOException { log.debug "QuiltFileSystemProvider.download: ${remoteFile} -> ${localDestination}" QuiltPath qPath = asQuiltPath(remoteFile) - println("QuiltFileSystemProvider.download: ${qPath}") + println("QuiltFileSystemProvider.qPath: ${qPath}") Path proxy = qPath.localPath() + println("QuiltFileSystemProvider.proxy: ${proxy}") QuiltPackage pkg = qPath.pkg() + println("QuiltFileSystemProvider.pkg[installed=${pkg.installed}]: ${pkg}") + /*QuiltPackage pkg = qPath.pkg() String pathName = pkg.parsed.getPath() Path localFolder = localDestination.getParent() Path actualDestination = Paths.get(localFolder.toUriString(), pathName) - log.debug "QuiltFileSystemProvider.download: ${proxy} -> ${actualDestination}" + log.debug "QuiltFileSystemProvider.actualDestination: ${actualDestination}"*/ final CopyOptions opts = CopyOptions.parse(options) // delete target if it exists and REPLACE_EXISTING is specified if (opts.replaceExisting()) { - FileHelper.deletePath(actualDestination) + FileHelper.deletePath(localDestination) } - else if (Files.exists(actualDestination)) { - throw new FileAlreadyExistsException(actualDestination.toString()) + else if (Files.exists(localDestination)) { + throw new FileAlreadyExistsException(localDestination.toString()) } if (!Files.exists(proxy)) { throw new NoSuchFileException(remoteFile.toString()) } - Files.copy(proxy, actualDestination, options) + Files.copy(proxy, localDestination, options) } void upload(Path localFile, Path remoteDestination, CopyOption... options) throws IOException { diff --git a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy index 5ed36070..c6ee7af1 100644 --- a/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy +++ b/plugins/nf-quilt/src/test/nextflow/quilt/nio/QuiltFileSystemProviderTest.groovy @@ -29,7 +29,7 @@ class QuiltFileSystemProviderTest extends QuiltSpecification { given: QuiltFileSystemProvider provider = new QuiltFileSystemProvider() String filename = 'README.md' - Path remoteFile = Paths.get('quilt+s3://quilt-example#package=examples%2fhurdat&path=' + filename) + Path remoteFile = Paths.get('quilt+s3://quilt-example#package=examples%2fhurdat2&path=' + filename) Path tempFolder = Files.createTempDirectory('quilt') Path tempFile = tempFolder.resolve(filename)