From 0da6f103a11b4739fb99328f9b2ef67aaacfe545 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sat, 8 Jan 2022 08:31:26 +0100 Subject: [PATCH] hardcode 'stable' to use stable-security mirror --- mmdebstrap | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index cf0a46f..72849a8 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -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