summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOliver Breitwieser <oliver.breitwieser@kip.uni-heidelberg.de>2020-02-07 03:59:16 +0100
committerGitHub <noreply@github.com>2020-02-06 18:59:16 -0800
commit22c9f5cbd8b807c6ff101a2af30c5fc4cab2d13b (patch)
tree1ae90bebfb9661b080541fcb776dc43794f14b0c /lib
parent458c9a22bf16e7e3f9d4475074bcf5ac64c6907e (diff)
downloadspack-22c9f5cbd8b807c6ff101a2af30c5fc4cab2d13b.tar.gz
spack-22c9f5cbd8b807c6ff101a2af30c5fc4cab2d13b.tar.bz2
spack-22c9f5cbd8b807c6ff101a2af30c5fc4cab2d13b.tar.xz
spack-22c9f5cbd8b807c6ff101a2af30c5fc4cab2d13b.zip
Allow installing unsigned binary packages (#11107)
This commit introduces a `--no-check-signature` option for `spack install` so that unsigned packages can be installed. It is off by default (signatures required).
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/install.py7
-rw-r--r--lib/spack/spack/package.py7
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
index 8f1eab0eb3..9e13643920 100644
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -42,7 +42,8 @@ def update_kwargs_from_args(args, kwargs):
'use_cache': args.use_cache,
'cache_only': args.cache_only,
'explicit': True, # Always true for install command
- 'stop_at': args.until
+ 'stop_at': args.until,
+ 'unsigned': args.unsigned,
})
kwargs.update({
@@ -99,6 +100,10 @@ the dependencies"""
help="only install package from binary mirrors")
subparser.add_argument(
+ '--no-check-signature', action='store_true',
+ dest='unsigned', default=False,
+ help="do not check signatures of binary packages")
+ subparser.add_argument(
'--show-log-on-error', action='store_true',
help="print full build log to stderr if build fails")
subparser.add_argument(
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index d146be9af9..d67c017a70 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1508,7 +1508,7 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)):
message = '{s.name}@{s.version} : marking the package explicit'
tty.msg(message.format(s=self))
- def try_install_from_binary_cache(self, explicit):
+ def try_install_from_binary_cache(self, explicit, unsigned=False):
tty.msg('Searching for binary cache of %s' % self.name)
specs = binary_distribution.get_spec(spec=self.spec,
force=False)
@@ -1525,7 +1525,7 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)):
tty.msg('Installing %s from binary cache' % self.name)
binary_distribution.extract_tarball(
binary_spec, tarball, allow_root=False,
- unsigned=False, force=False)
+ unsigned=unsigned, force=False)
self.installed_from_binary_cache = True
spack.store.db.add(
self.spec, spack.store.layout, explicit=explicit)
@@ -1666,7 +1666,8 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)):
tty.msg(colorize('@*{Installing} @*g{%s}' % self.name))
if kwargs.get('use_cache', True):
- if self.try_install_from_binary_cache(explicit):
+ if self.try_install_from_binary_cache(
+ explicit, unsigned=kwargs.get('unsigned', False)):
tty.msg('Successfully installed %s from binary cache'
% self.name)
print_pkg(self.prefix)