use Dpkg::Vendor::Debian and Dpkg::Vendor::Ubuntu for keyring locations, if they are available

This commit is contained in:
Johannes 'josch' Schauer 2020-03-07 23:41:28 +01:00
parent 89e7dd6756
commit 3922851636
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -3285,6 +3285,14 @@ sub main() {
my $signedby = ''; my $signedby = '';
{ {
# try to guess the right keyring path for the given suite # try to guess the right keyring path for the given suite
my $debianvendor;
my $ubuntuvendor;
eval {
require Dpkg::Vendor::Debian;
require Dpkg::Vendor::Ubuntu;
$debianvendor = Dpkg::Vendor::Debian->new();
$ubuntuvendor = Dpkg::Vendor::Ubuntu->new();
};
my $keyring; my $keyring;
if ( if (
any { $_ eq $suite } ( any { $_ eq $suite } (
@ -3292,8 +3300,14 @@ sub main() {
'lenny', 'squeeze', 'wheezy' 'lenny', 'squeeze', 'wheezy'
) )
) { ) {
$keyring if (defined $debianvendor) {
= '/usr/share/keyrings/debian-archive-removed-keys.gpg'; $keyring = $debianvendor->run_hook(
'archive-keyrings-historic');
} else {
$keyring
= '/usr/share/keyrings/'
. 'debian-archive-removed-keys.gpg';
}
} elsif ( } elsif (
any { $_ eq $suite } any { $_ eq $suite }
('aequorea', 'bartholomea', 'chromodoris', 'dasyatis') ('aequorea', 'bartholomea', 'chromodoris', 'dasyatis')
@ -3311,16 +3325,26 @@ sub main() {
'cosmic' 'cosmic'
) )
) { ) {
$keyring if (defined $ubuntuvendor) {
= '/usr/share/keyrings/ubuntu-archive-keyring.gpg'; $keyring = $ubuntuvendor->run_hook('archive-keyrings');
} else {
$keyring
= '/usr/share/keyrings/'
. 'ubuntu-archive-keyring.gpg';
}
} elsif ( } elsif (
any { $_ eq $suite } ( any { $_ eq $suite } (
'unstable', 'stable', 'oldstable', 'jessie', 'unstable', 'stable', 'oldstable', 'jessie',
'stretch', 'buster', 'bullseye', 'bookworm' 'stretch', 'buster', 'bullseye', 'bookworm'
) )
) { ) {
$keyring if (defined $debianvendor) {
= '/usr/share/keyrings/debian-archive-keyring.gpg'; $keyring = $debianvendor->run_hook('archive-keyrings');
} else {
$keyring
= '/usr/share/keyrings/'
. 'debian-archive-keyring.gpg';
}
} else { } else {
last; last;
} }