summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2015-04-08 00:22:34 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2015-04-08 00:22:34 -0700
commit5077a2a343a93c3875b693387a3cfbb3be8395b6 (patch)
treeb68407ecd3cde9137737230b89d50b27c9c1632c
parentab40d0b1a48478d6ba6af140de3d695ee8750749 (diff)
downloadspack-5077a2a343a93c3875b693387a3cfbb3be8395b6.tar.gz
spack-5077a2a343a93c3875b693387a3cfbb3be8395b6.tar.bz2
spack-5077a2a343a93c3875b693387a3cfbb3be8395b6.tar.xz
spack-5077a2a343a93c3875b693387a3cfbb3be8395b6.zip
Add a DIY stage class.
-rw-r--r--lib/spack/spack/stage.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index 84454c9d2c..d451743508 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -309,6 +309,39 @@ class Stage(object):
os.chdir(os.path.dirname(self.path))
+class DIYStage(object):
+ """Simple class that allows any directory to be a spack stage."""
+ def __init__(self, path):
+ self.archive_file = None
+ self.path = path
+ self.source_path = path
+
+ def chdir(self):
+ if os.path.isdir(self.path):
+ os.chdir(self.path)
+ else:
+ tty.die("Setup failed: no such directory: " + self.path)
+
+ def chdir_to_source(self):
+ self.chdir()
+
+ def fetch(self):
+ tty.msg("No need to fetch for DIY.")
+
+ def check(self):
+ tty.msg("No checksum needed for DIY.")
+
+ def expand_archive(self):
+ tty.msg("Using source directory: %s" % self.source_path)
+
+ def restage(self):
+ tty.die("Cannot restage DIY stage.")
+
+ def destroy(self):
+ # No need to destroy DIY stage.
+ pass
+
+
def _get_mirrors():
"""Get mirrors from spack configuration."""
config = spack.config.get_config()