mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-26 09:58:31 +01:00
Updated for gpg imported
This commit is contained in:
parent
d40ca44ebc
commit
a8b68904ff
1 changed files with 9 additions and 6 deletions
|
@ -58,16 +58,19 @@ class UpdateRepositories(Configs): # pylint: disable=[R0902]
|
|||
mirror (str): Repository GPG mirror key.
|
||||
"""
|
||||
if self.gpg_verification:
|
||||
gpg_key: str = f'{mirror}GPG-KEY'
|
||||
gpg_key: str = f'{mirror}GPG-KEYa'
|
||||
gpg_command: str = 'gpg --fetch-key'
|
||||
|
||||
process = subprocess.run(f'{gpg_command} {gpg_key}', shell=True, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT, encoding='utf-8', text=True, check=True)
|
||||
try:
|
||||
process = subprocess.run(f'{gpg_command} {gpg_key}', shell=True, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT, encoding='utf-8', text=True, check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f'Getting GPG key: {self.bred}Failed{self.endc}\n')
|
||||
raise SystemExit(2) from e
|
||||
|
||||
output: str = re.split(r"/|\s", process.stdout)
|
||||
|
||||
if 'imported:' in output:
|
||||
print(f'Getting GPG key from: {gpg_key}\n')
|
||||
if process.returncode == 0 and 'imported:' in output:
|
||||
print(f'Getting GPG key from: {mirror}\n')
|
||||
|
||||
def run_update(self) -> None:
|
||||
""" Update the repositories by category.
|
||||
|
|
Loading…
Reference in a new issue