From 6d956f372fe01331ec38834e39a248fe258c9a23 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sun, 26 Jan 2014 02:15:31 -0800 Subject: [PATCH] Fix bug in staging. - Stage needs to account for symlinks in self.tmp_dir - Use os.realpath on self.tmp_dir when checking to see if a stage needs to be rebuilt --- lib/spack/spack/stage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.")