From b46f1e3605ed2e2491c563f391145054442cb024 Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Wed, 18 Oct 2017 23:59:25 -0700 Subject: 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. --- .../repos/builtin/packages/bcl2fastq2/package.py | 24 +++++++++++++--------- 1 file 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): -- cgit v1.2.3-60-g2f50