hardcode 'stable' to use stable-security mirror

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-01-08 08:31:26 +01:00
parent 388c7980d3
commit 0da6f103a1
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -3951,19 +3951,25 @@ sub get_sourceslist_by_suite {
# the security mirror changes, starting with bullseye
# https://lists.debian.org/87r26wqr2a.fsf@43-1.org
my $bullseye_or_later = 0;
my $distro_info = '/usr/share/distro-info/debian.csv';
if (
any { $_ eq $suite }
('stable', 'bullseye', 'bookworm', 'trixie')
) {
$bullseye_or_later = 1;
}
my $distro_info = '/usr/share/distro-info/debian.csv';
# make $@ local, so we don't print "Can't locate Debian/DistroInfo.pm"
# in other parts where we evaluate $@
local $@ = '';
eval { require Debian::DistroInfo; };
if (!$@) {
# libdistro-info-perl is installed
debug "libdistro-info-perl is installed";
my $debinfo = DebianDistroInfo->new();
if ($debinfo->version($suite, 0) >= 11) {
$bullseye_or_later = 1;
}
} elsif (-f $distro_info) {
# distro-info-data is installed
debug "distro-info-data is installed";
open my $fh, '<', $distro_info
or error "cannot open $distro_info: $!";
my $i = 0;
@ -4010,13 +4016,7 @@ sub get_sourceslist_by_suite {
$bullseye_or_later = 1;
}
} else {
# neither libdistro-info-perl nor distro-info-data is installed
if (
any { $_ eq $suite }
('stable', 'bullseye', 'bookworm', 'trixie')
) {
$bullseye_or_later = 1;
}
debug "neither libdistro-info-perl nor distro-info-data installed";
}
if ($bullseye_or_later) {
# starting from bullseye use