summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2018-02-06 10:48:58 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2018-03-20 00:29:54 -0700
commit2379ed54b9e8183bec8487c08d66e5f4c51eeb64 (patch)
tree3f104fa7e8ccaadaff837c62f447ffc7bf8365d1 /var
parentdb81d19ddd38914d8149d1a6d8b6bcd459b20c87 (diff)
downloadspack-2379ed54b9e8183bec8487c08d66e5f4c51eeb64.tar.gz
spack-2379ed54b9e8183bec8487c08d66e5f4c51eeb64.tar.bz2
spack-2379ed54b9e8183bec8487c08d66e5f4c51eeb64.tar.xz
spack-2379ed54b9e8183bec8487c08d66e5f4c51eeb64.zip
package_hash: add code to generate a hash for a package file
This will be included in the full hash of packages.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/hash-test1/package.py34
-rw-r--r--var/spack/repos/builtin.mock/packages/hash-test1/patch1.patch1
-rw-r--r--var/spack/repos/builtin.mock/packages/hash-test1/patch2.patch1
-rw-r--r--var/spack/repos/builtin.mock/packages/hash-test2/package.py28
-rw-r--r--var/spack/repos/builtin.mock/packages/hash-test2/patch1.patch2
5 files changed, 66 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/hash-test1/package.py b/var/spack/repos/builtin.mock/packages/hash-test1/package.py
new file mode 100644
index 0000000000..60c7fbe32b
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/hash-test1/package.py
@@ -0,0 +1,34 @@
+from spack import *
+
+import os
+
+
+class HashTest1(Package):
+ """Used to test package hashing
+ """
+
+ homepage = "http://www.hashtest1.org"
+ url = "http://www.hashtest1.org/downloads/hashtest1-1.1.tar.bz2"
+
+ version('1.1', 'a' * 32)
+ version('1.2', 'b' * 32)
+ version('1.3', 'c' * 32)
+ version('1.4', 'd' * 32)
+
+ patch('patch1.patch', when="@1.1")
+ patch('patch2.patch', when="@1.4")
+
+ variant('variantx', default=False, description='Test variant X')
+ variant('varianty', default=False, description='Test variant Y')
+
+ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
+ pass
+
+ @when('@:1.4')
+ def install(self, spec, prefix):
+ print("install 1")
+ os.listdir(os.getcwd())
+
+ @when('@1.5')
+ def install(self, spec, prefix):
+ os.listdir(os.getcwd())
diff --git a/var/spack/repos/builtin.mock/packages/hash-test1/patch1.patch b/var/spack/repos/builtin.mock/packages/hash-test1/patch1.patch
new file mode 100644
index 0000000000..a333c82dfd
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/hash-test1/patch1.patch
@@ -0,0 +1 @@
+the contents of patch 1 (not a valid diff, but sufficient for testing)
diff --git a/var/spack/repos/builtin.mock/packages/hash-test1/patch2.patch b/var/spack/repos/builtin.mock/packages/hash-test1/patch2.patch
new file mode 100644
index 0000000000..9e292a10fe
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/hash-test1/patch2.patch
@@ -0,0 +1 @@
+the contents of patch 2 (not a valid diff, but sufficient for testing)
diff --git a/var/spack/repos/builtin.mock/packages/hash-test2/package.py b/var/spack/repos/builtin.mock/packages/hash-test2/package.py
new file mode 100644
index 0000000000..3c4c2addf2
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/hash-test2/package.py
@@ -0,0 +1,28 @@
+from spack import *
+
+import os
+
+
+class HashTest2(Package):
+ """Used to test package hashing
+ """
+
+ homepage = "http://www.hashtest2.org"
+ url = "http://www.hashtest1.org/downloads/hashtest2-1.1.tar.bz2"
+
+ version('1.1', 'a' * 32)
+ version('1.2', 'b' * 32)
+ version('1.3', 'c' * 31 + 'x') # Source hash differs from hash-test1@1.3
+ version('1.4', 'd' * 32)
+
+ patch('patch1.patch', when="@1.1")
+
+ variant('variantx', default=False, description='Test variant X')
+ variant('varianty', default=False, description='Test variant Y')
+
+ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
+ pass
+
+ def install(self, spec, prefix):
+ print("install 1")
+ os.listdir(os.getcwd())
diff --git a/var/spack/repos/builtin.mock/packages/hash-test2/patch1.patch b/var/spack/repos/builtin.mock/packages/hash-test2/patch1.patch
new file mode 100644
index 0000000000..bbfa868935
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/hash-test2/patch1.patch
@@ -0,0 +1,2 @@
+the different contents of patch 1 (not a valid diff, but sufficient for testing,
+and different from patch 1 of hash-test1)