bcl2fastq2 package: recursively delete after copy (#9959)

Fixes #9944

73c978d replaced a move with a copy, which cased rmdir to fail (as
it expects an empty directory). This switches to use `shutil.rmtree`
instead.
This commit is contained in:
George Hartzell 2018-11-27 17:22:14 -08:00 committed by Peter Scheibel
parent 33b112a60d
commit e4e980ee97

View File

@ -5,6 +5,7 @@
from spack import *
import os
import shutil
import glob
import llnl.util.tty as tty
@ -71,11 +72,10 @@ def wrap():
tty.msg("The tarball has already been unpacked")
else:
tty.msg("Unpacking bcl2fastq2 tarball")
tty.msg("cwd sez: {0}".format(os.getcwd()))
tarball = glob.glob(join_path('spack-expanded-archive',
'bcl2fastq2*.tar.gz'))[0]
copy(tarball, '.')
os.rmdir('spack-expanded-archive')
shutil.rmtree('spack-expanded-archive')
tar = which('tar')
tarball = os.path.basename(tarball)
tar('-xf', tarball)