示例#1
0
    def setUp(self):
        super(InstallTest, self).setUp()

        self.stage = Stage('not_a_real_url')
        archive_dir = join_path(self.stage.path, dir_name)
        dummy_configure = join_path(archive_dir, 'configure')

        mkdirp(archive_dir)
        with closing(open(dummy_configure, 'w')) as configure:
            configure.write("#!/bin/sh\n"
                            "prefix=$(echo $1 | sed 's/--prefix=//')\n"
                            "cat > Makefile <<EOF\n"
                            "all:\n"
                            "\techo Building...\n\n"
                            "install:\n"
                            "\tmkdir -p $prefix\n"
                            "\ttouch $prefix/dummy_file\n"
                            "EOF\n")
        os.chmod(dummy_configure, 0755)

        with working_dir(self.stage.path):
            tar = which('tar')
            tar('-czf', archive_name, dir_name)

        # We use a fake package, so skip the checksum.
        spack.do_checksum = False

        # Use a fake install directory to avoid conflicts bt/w
        # installed pkgs and mock packages.
        self.tmpdir = tempfile.mkdtemp()
        self.orig_layout = spack.install_layout
        spack.install_layout = SpecHashDirectoryLayout(self.tmpdir)
示例#2
0
文件: install.py 项目: wnissen/spack
    def setUp(self):
        super(InstallTest, self).setUp()

        # create a simple installable package directory and tarball
        self.repo = MockArchive()

        # We use a fake package, so skip the checksum.
        spack.do_checksum = False

        # Use a fake install directory to avoid conflicts bt/w
        # installed pkgs and mock packages.
        self.tmpdir = tempfile.mkdtemp()
        self.orig_layout = spack.install_layout
        spack.install_layout = SpecHashDirectoryLayout(self.tmpdir)
示例#3
0
#
# Paths to mock files for testing.
#
mock_packages_path = join_path(var_path, "mock_packages")

mock_config_path = join_path(var_path, "mock_configs")
mock_site_config = join_path(mock_config_path, "site_spackconfig")
mock_user_config = join_path(mock_config_path, "user_spackconfig")

#
# This controls how spack lays out install prefixes and
# stage directories.
#
from spack.directory_layout import SpecHashDirectoryLayout
install_layout = SpecHashDirectoryLayout(install_path)

#
# This controls how things are concretized in spack.
# Replace it with a subclass if you want different
# policies.
#
from spack.concretize import DefaultConcretizer
concretizer = DefaultConcretizer()

# Version information
from spack.version import Version
spack_version = Version("0.8")

#
# Executables used by Spack
示例#4
0
 def setUp(self):
     self.tmpdir = tempfile.mkdtemp()
     self.layout = SpecHashDirectoryLayout(self.tmpdir)