summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory L. Lee <lee218@llnl.gov>2015-06-03 14:22:10 -0700
committerGregory L. Lee <lee218@llnl.gov>2015-06-03 14:22:10 -0700
commitc1580126552218df4e49cf7ee2010e62ceca38da (patch)
tree23f93a7f15cf8ab39b03cfbe8abbe34446b662d0
parentc4f5a881e694cd891b792210ce215ec40879e82a (diff)
parentbe3e8170def8af203ba7580f44e09538e2c8004c (diff)
downloadspack-c1580126552218df4e49cf7ee2010e62ceca38da.tar.gz
spack-c1580126552218df4e49cf7ee2010e62ceca38da.tar.bz2
spack-c1580126552218df4e49cf7ee2010e62ceca38da.tar.xz
spack-c1580126552218df4e49cf7ee2010e62ceca38da.zip
Merge branch 'develop' of ssh://cz-stash.llnl.gov:7999/scale/spack into develop
-rw-r--r--lib/spack/spack/cmd/location.py5
-rw-r--r--lib/spack/spack/fetch_strategy.py19
2 files changed, 19 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/location.py b/lib/spack/spack/cmd/location.py
index 709e894b7f..e8e9c3f277 100644
--- a/lib/spack/spack/cmd/location.py
+++ b/lib/spack/spack/cmd/location.py
@@ -55,6 +55,8 @@ def setup_parser(subparser):
directories.add_argument(
'-s', '--stage-dir', action='store_true', help="Stage directory for a spec.")
directories.add_argument(
+ '-S', '--stages', action='store_true', help="Top level Stage directory.")
+ directories.add_argument(
'-b', '--build-dir', action='store_true',
help="Checked out or expanded source directory for a spec (requires it to be staged first).")
@@ -72,6 +74,9 @@ def location(parser, args):
elif args.packages:
print spack.db.root
+ elif args.stages:
+ print spack.stage_path
+
else:
specs = spack.cmd.parse_specs(args.spec)
if not specs:
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index c892e9ea26..e46ec74e09 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -220,13 +220,22 @@ class URLFetchStrategy(FetchStrategy):
os.chdir(tarball_container)
decompress(self.archive_file)
- # If the tarball *didn't* explode, move
- # the expanded directory up & remove the protector directory.
+ # Check for an exploding tarball, i.e. one that doesn't expand
+ # to a single directory. If the tarball *didn't* explode,
+ # move contents up & remove the container directory.
+ #
+ # NOTE: The tar program on Mac OS X will encode HFS metadata
+ # in hidden files, which can end up *alongside* a single
+ # top-level directory. We ignore hidden files to accomodate
+ # these "semi-exploding" tarballs.
files = os.listdir(tarball_container)
- if len(files) == 1:
- expanded_dir = os.path.join(tarball_container, files[0])
+ non_hidden = filter(lambda f: not f.startswith('.'), files)
+ if len(non_hidden) == 1:
+ expanded_dir = os.path.join(tarball_container, non_hidden[0])
if os.path.isdir(expanded_dir):
- shutil.move(expanded_dir, self.stage.path)
+ for f in files:
+ shutil.move(os.path.join(tarball_container, f),
+ os.path.join(self.stage.path, f))
os.rmdir(tarball_container)
# Set the wd back to the stage when done.