diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2014-12-18 13:32:06 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2014-12-18 15:52:45 -0800 |
commit | 08f1701e359073e4704489190e7708764cf8208a (patch) | |
tree | 4ab93387fff988221749a8ac28ad520b9c5fc59d /lib | |
parent | f1c5e64c23037a3dd7fa65794a1f917f9d5f812c (diff) | |
download | spack-08f1701e359073e4704489190e7708764cf8208a.tar.gz spack-08f1701e359073e4704489190e7708764cf8208a.tar.bz2 spack-08f1701e359073e4704489190e7708764cf8208a.tar.xz spack-08f1701e359073e4704489190e7708764cf8208a.zip |
Allow fake installations (just make the directory).
- Use for debugging.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/install.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/package.py | 20 |
2 files changed, 19 insertions, 7 deletions
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index 2374d02feb..2c2deb2803 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -44,6 +44,9 @@ def setup_parser(subparser): '-n', '--no-checksum', action='store_true', dest='no_checksum', help="Do not check packages against checksum") subparser.add_argument( + '--fake', action='store_true', dest='fake', + help="Fake install. Just remove the prefix and touch a fake file in it.") + subparser.add_argument( 'packages', nargs=argparse.REMAINDER, help="specs of packages to install") @@ -59,4 +62,5 @@ def install(parser, args): package = spack.db.get(spec) package.do_install(keep_prefix=args.keep_prefix, keep_stage=args.keep_stage, - ignore_deps=args.ignore_deps) + ignore_deps=args.ignore_deps, + fake=args.fake) diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index bb6180c521..9c67b0bb51 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -709,9 +709,10 @@ class Package(object): Package implementations should override install(). """ # whether to keep the prefix on failure. Default is to destroy it. - keep_prefix = kwargs.get('keep_prefix', False) - keep_stage = kwargs.get('keep_stage', False) - ignore_deps = kwargs.get('ignore_deps', False) + keep_prefix = kwargs.get('keep_prefix', False) + keep_stage = kwargs.get('keep_stage', False) + ignore_deps = kwargs.get('ignore_deps', False) + fake_install = kwargs.get('fake', False) if not self.spec.concrete: raise ValueError("Can only install concrete packages.") @@ -725,7 +726,8 @@ class Package(object): if not ignore_deps: self.do_install_dependencies() - self.do_patch() + if not fake_install: + self.do_patch() # Fork a child process to do the build. This allows each # package authors to have full control over their environment, @@ -750,8 +752,14 @@ class Package(object): build_env.set_build_environment_variables(self) build_env.set_module_variables_for_package(self) - # Subclasses implement install() to do the real work. - self.install(self.spec, self.prefix) + if fake_install: + mkdirp(self.prefix.bin) + touch(join_path(self.prefix.bin, 'fake')) + mkdirp(self.prefix.lib) + mkdirp(self.prefix.man1) + else: + # Subclasses implement install() to do the real work. + self.install(self.spec, self.prefix) # Ensure that something was actually installed. if not os.listdir(self.prefix): |