package_hash: add code to generate a hash for a package file
This will be included in the full hash of packages.
This commit is contained in:

committed by
Todd Gamblin

parent
db81d19ddd
commit
2379ed54b9
34
var/spack/repos/builtin.mock/packages/hash-test1/package.py
Normal file
34
var/spack/repos/builtin.mock/packages/hash-test1/package.py
Normal file
@@ -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())
|
@@ -0,0 +1 @@
|
||||
the contents of patch 1 (not a valid diff, but sufficient for testing)
|
@@ -0,0 +1 @@
|
||||
the contents of patch 2 (not a valid diff, but sufficient for testing)
|
28
var/spack/repos/builtin.mock/packages/hash-test2/package.py
Normal file
28
var/spack/repos/builtin.mock/packages/hash-test2/package.py
Normal file
@@ -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())
|
@@ -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)
|
Reference in New Issue
Block a user