# By Todd Gamblin
# Via Todd Gamblin
* commit 'b813b40c4fdccd593118024083f1e42b472f4e32':
Clean up commands and get rid of inconsistent --dirty options
Fix SPACK-17: Remove install prefix if install() fails
- checksum --dirty and create --dirty now changed to --keep-stage
- install --dirty is now --keep-prefix
- uninstall --force now works properly
- commands use keyword args instead of package instance vars
where possible (less weird package state)
- except clause now catches anything, not just exception
- sys.exit() changed to os._exit() to avoid interfering with unit tests
and to avoid raising SystemExit exception when child processes quit.
- this allows each install to have full control over its environment,
and over spack.
- build process can do whatever it wants and doesn't affect main Spack
process.
- Consolidated build environment stuff from package.py into
build_environment.py
- package.py calls build_environment.py functions just before calling
install(), in do_install()
- Organization is better b/c SPACK_xxxx environment variables are now
in build_environment, the only place they're used. Were previously
cluttering globals.py.
The dependency hash wasn't being generated in a consistent way: when
read from .spec file in the install directory, the spec DAG was not
normalized, but when generated on install, it was. Thus the same
spec can have two possible hashes, which is obviously not good.
In this commit:
- Added a dep_hash function to spec, which should be used to get the
dependency hash in all cases. This function normalizes the spec
before generating the hash.
- removed sha1 functions from Spec and DependencyHash. The one on
Spec is not needed and is confusing (it hashed the whole spec, not
just hash the deps) and the one on DependencyHash wasn't guaranteed
to be safe because it can't normalize its parent spec before
hashing.
Hopefully this makes things consistent and easy.
- Packages now live in <package_name>/package.py
- spack.packages refactored to use a PackageDB object instead of
monolithic module.
- Implementation of mock_packages_test.py is greatly simplified
- Added test to exercise install/uninstall code because that wasn't
covered by existing tests and kept breaking.