Merge branch 'features/postgresql' into develop

- add spack cd command.
- Fix bug in modules hook

Conflicts:
	lib/spack/spack/cmd/stage.py
	lib/spack/spack/hooks/dotkit.py
	share/spack/setup-env.bash
This commit is contained in:
Todd Gamblin
2014-08-21 22:59:39 -07:00
8 changed files with 115 additions and 27 deletions

View File

@@ -22,20 +22,6 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
#
# When packages call 'from spack import *', this is what is brought in.
#
# Spack internal code calls 'import spack' and accesses other
# variables (spack.db, paths, etc.) directly.
#
# TODO: maybe this should be separated out and should go in build_environment.py?
# TODO: it's not clear where all the stuff that needs to be included in packages
# should live. This file is overloaded for spack core vs. for packages.
__all__ = ['Package', 'when', 'provides', 'depends_on', 'version',
'patch', 'Version', 'working_dir', 'which', 'Executable',
'filter_file', 'change_sed_delimiter']
import os
import tempfile
from llnl.util.filesystem import *
@@ -140,11 +126,30 @@
#
sys_type = None
#
# Extra imports that should be generally usable from package.py files.
# When packages call 'from spack import *', this extra stuff is brought in.
#
from llnl.util.filesystem import working_dir
# Spack internal code should call 'import spack' and accesses other
# variables (spack.db, paths, etc.) directly.
#
# TODO: maybe this should be separated out and should go in build_environment.py?
# TODO: it's not clear where all the stuff that needs to be included in packages
# should live. This file is overloaded for spack core vs. for packages.
#
__all__ = ['Package', 'Version', 'when']
from spack.package import Package
from spack.relations import *
from spack.multimethod import when
from spack.version import Version
from spack.multimethod import when
import llnl.util.filesystem
from llnl.util.filesystem import *
__all__ += llnl.util.filesystem.__all__
import spack.relations
from spack.relations import *
__all__ += spack.relations.__all__
import spack.util.executable
from spack.util.executable import *
__all__ += spack.util.executable.__all__

View File

@@ -22,8 +22,10 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
import os
from external import argparse
import llnl.util.tty as tty
import spack
import spack.cmd
@@ -33,18 +35,45 @@ def setup_parser(subparser):
subparser.add_argument(
'-n', '--no-checksum', action='store_true', dest='no_checksum',
help="Do not check downloaded packages against checksum")
dir_parser = subparser.add_mutually_exclusive_group()
dir_parser.add_argument(
'-d', '--print-stage-dir', action='store_const', dest='print_dir',
const='print_stage', help="Prints out the stage directory for a spec.")
dir_parser.add_argument(
'-b', '--print-build-dir', action='store_const', dest='print_dir',
const='print_build', help="Prints out the expanded archive path for a spec.")
subparser.add_argument(
'packages', nargs=argparse.REMAINDER, help="specs of packages to stage")
'specs', nargs=argparse.REMAINDER, help="specs of packages to stage")
def stage(parser, args):
if not args.packages:
if not args.specs:
tty.die("stage requires at least one package argument")
if args.no_checksum:
spack.do_checksum = False
specs = spack.cmd.parse_specs(args.packages, concretize=True)
for spec in specs:
package = spack.db.get(spec)
package.do_stage()
specs = spack.cmd.parse_specs(args.specs, concretize=True)
if args.print_dir:
if len(specs) != 1:
tty.die("--print-stage-dir and --print-build-dir options only take one spec.")
spec = specs[0]
pkg = spack.db.get(spec)
if args.print_dir == 'print_stage':
print pkg.stage.path
elif args.print_dir == 'print_build':
if not os.listdir(pkg.stage.path):
tty.die("Stage directory is empty. Run this first:",
"spack stage " + " ".join(args.specs))
print pkg.stage.expanded_archive_path
else:
for spec in specs:
package = spack.db.get(spec)
package.do_stage()

View File

@@ -26,10 +26,10 @@
def post_install(pkg):
dk = spack.modules.TclModule(pkg)
dk = spack.modules.TclModule(pkg.spec)
dk.write()
def post_uninstall(pkg):
dk = spack.modules.TclModule(pkg)
dk = spack.modules.TclModule(pkg.spec)
dk.remove()