summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):