summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hartzell <hartzell@alerce.com>2017-10-18 23:59:25 -0700
committerMassimiliano Culpo <massimiliano.culpo@googlemail.com>2017-10-19 08:59:25 +0200
commitb46f1e3605ed2e2491c563f391145054442cb024 (patch)
tree466547565bfbc762c6b83ac0cc7603b803b6f344
parent4774c9887e8fb7d62a096abde16bc75e7f2a43da (diff)
downloadspack-b46f1e3605ed2e2491c563f391145054442cb024.tar.gz
spack-b46f1e3605ed2e2491c563f391145054442cb024.tar.bz2
spack-b46f1e3605ed2e2491c563f391145054442cb024.tar.xz
spack-b46f1e3605ed2e2491c563f391145054442cb024.zip
bcl2fastq needs `with working_dir:` after changes in #5776 (#5803)
#5776 cleaned up the way the the current working directory is managed (less magic state). bcl2fastq is packaged like a russian doll, rather than an archive file that contains the source, there's a zip file that contains a tar.gz file that contains the source. The package definition has a bit of extra code that unpacks the inner tarball. That extra bit of code now needs to explicitly arrange to be in the correct directory before it does its work.
-rw-r--r--var/spack/repos/builtin/packages/bcl2fastq2/package.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/bcl2fastq2/package.py b/var/spack/repos/builtin/packages/bcl2fastq2/package.py
index 67302c4324..3fd88e2be9 100644
--- a/var/spack/repos/builtin/packages/bcl2fastq2/package.py
+++ b/var/spack/repos/builtin/packages/bcl2fastq2/package.py
@@ -85,16 +85,20 @@ class Bcl2fastq2(Package):
def unpack_it(self, f):
def wrap():
f() # call the original expand_archive()
- if os.path.isdir('bcl2fastq'):
- tty.msg("The tarball has already been unpacked")
- else:
- tty.msg("Unpacking bcl2fastq2 tarball")
- tarball = 'bcl2fastq2-v{0}.tar.gz'.format(self.version.dotted)
- shutil.move(join_path('spack-expanded-archive', tarball), '.')
- os.rmdir('spack-expanded-archive')
- tar = which('tar')
- tar('-xf', tarball)
- tty.msg("Finished unpacking bcl2fastq2 tarball")
+ with working_dir(self.stage.path):
+ if os.path.isdir('bcl2fastq'):
+ tty.msg("The tarball has already been unpacked")
+ else:
+ tty.msg("Unpacking bcl2fastq2 tarball")
+ tty.msg("cwd sez: {0}".format(os.getcwd()))
+ tarball = 'bcl2fastq2-v{0}.tar.gz'.format(
+ self.version.dotted)
+ shutil.move(join_path('spack-expanded-archive', tarball),
+ '.')
+ os.rmdir('spack-expanded-archive')
+ tar = which('tar')
+ tar('-xf', tarball)
+ tty.msg("Finished unpacking bcl2fastq2 tarball")
return wrap
def install(self, spec, prefix):