hplip/hplip-keyserver.patch

61 lines
2.3 KiB
Diff
Raw Normal View History

diff -up hplip-3.20.3/base/tui.py.keyserver hplip-3.20.3/base/tui.py
--- hplip-3.20.3/base/tui.py.keyserver 2020-03-10 09:01:53.000000000 +0100
+++ hplip-3.20.3/base/tui.py 2020-04-07 08:44:44.319710001 +0200
@@ -241,6 +241,7 @@ class ProgressMeter(object):
sys.stdout.write(y)
sys.stdout.flush()
+ sys.stdout.write('\n')
self.prev_length = len(y)
self.spinner_pos = (self.spinner_pos + 1) % 8
diff -up hplip-3.20.3/base/validation.py.keyserver hplip-3.20.3/base/validation.py
--- hplip-3.20.3/base/validation.py.keyserver 2020-03-10 09:01:53.000000000 +0100
+++ hplip-3.20.3/base/validation.py 2020-04-07 08:45:46.657132415 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# (c) Copyright 2015 HP Development Company, L.P.
@@ -42,8 +42,11 @@ class DigiSign_Verification(object):
class GPG_Verification(DigiSign_Verification):
- def __init__(self, pgp_site = 'pgp.mit.edu', key = 0x4ABA2F66DBD5A95894910E0673D770CDA59047B9):
- self.__pgp_site = pgp_site
+ def __init__(self, keyservers = ['pool.sks-keyservers.net',
+ 'keyserver.ubuntu.com',
+ 'sks-keyservers.net', 'pgp.mit.edu'],
+ key = 0x4ABA2F66DBD5A95894910E0673D770CDA59047B9):
+ self.__keyservers = keyservers
self.__key = key
self.__gpg = utils.which('gpg',True)
@@ -82,13 +85,18 @@ class GPG_Verification(DigiSign_Verifica
def __acquire_gpg_key(self):
-
- cmd = '%s --homedir %s --no-permission-warning --keyserver %s --recv-keys 0x%X' \
- % (self.__gpg, self.__gpg_dir, self.__pgp_site, self.__key)
-
- log.info("Receiving digital keys: %s" % cmd)
- status, output = utils.run(cmd)
- log.debug(output)
+ for kserver in self.__keyservers:
+ cmd = '%s --homedir %s --no-permission-warning --keyserver %s --recv-keys 0x%X' \
+ % (self.__gpg, self.__gpg_dir, kserver, self.__key)
+
+ log.info("Receiving digital keys: %s" % cmd)
+ status, output = utils.run(cmd)
+ log.debug(output)
+
+ if not status:
+ break
+ log.info("Receiving keys from {} failed, trying the next keyserver."
+ .format(kserver))
self.__change_owner(True)