diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index b4f9c211844..a4a5b93929a 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -110,11 +110,12 @@ def _need_to_create_path(self): # Path looks ok, but need to check the target of the link. if os.path.islink(self.path): real_path = os.path.realpath(self.path) + real_tmp = os.path.realpath(self.tmp_root) if spack.use_tmp_stage: # If we're using a tmp dir, it's a link, and it points at the right spot, # then keep it. - if (os.path.commonprefix((real_path, self.tmp_root)) == self.tmp_root + if (os.path.commonprefix((real_path, real_tmp)) == real_tmp and os.path.exists(real_path)): return False else: @@ -266,7 +267,6 @@ def expand_archive(self): downloaded. """ self.chdir() - if not self.archive_file: tty.die("Attempt to expand archive before fetching.")