diff options
author | Scott Wittenburg <scott.wittenburg@kitware.com> | 2018-08-09 10:00:49 -0600 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-08-09 09:00:49 -0700 |
commit | 2278c65d0a40c2d49ed161a27ab987ca34199517 (patch) | |
tree | df1c76cbebe7e3b3a7fa51c161cb6b3b4df140df /lib | |
parent | bbcb2bb8ca37236b559bcaae9eb7b55970fc769c (diff) | |
download | spack-2278c65d0a40c2d49ed161a27ab987ca34199517.tar.gz spack-2278c65d0a40c2d49ed161a27ab987ca34199517.tar.bz2 spack-2278c65d0a40c2d49ed161a27ab987ca34199517.tar.xz spack-2278c65d0a40c2d49ed161a27ab987ca34199517.zip |
spec: make full_hash look like dag_hash (#8911)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/spec.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index cd12a46b60..2d92d68d66 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -1440,8 +1440,13 @@ class Spec(object): self.to_node_dict(hash_function=lambda s: s.full_hash()), default_flow_style=True, width=maxint) package_hash = self.package.content_hash() - sha = hashlib.sha256(yaml_text.encode('utf-8') + package_hash) - self._full_hash = base64.b32encode(sha.digest()).lower() + sha = hashlib.sha1(yaml_text.encode('utf-8') + package_hash) + + b32_hash = base64.b32encode(sha.digest()).lower() + if sys.version_info[0] >= 3: + b32_hash = b32_hash.decode('utf-8') + + self._full_hash = b32_hash return self._full_hash[:length] |