diff options
-rw-r--r-- | lib/spack/spack/stage.py | 33 |
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() |