Compare commits

...

4 commits

5 changed files with 43 additions and 2 deletions

View file

@ -1,3 +1,8 @@
1.5.4 (2024-10-28)
------------------
- do not generate apt sources.list entry if SUITE is empty
1.5.3 (2024-09-13)
------------------

View file

@ -433,3 +433,5 @@ Modes: unshare
Test: zombie-reaping
Modes: unshare
Test: empty-suite

View file

@ -23,7 +23,7 @@
use strict;
use warnings;
our $VERSION = '1.5.3';
our $VERSION = '1.5.4';
use English;
use Getopt::Long;
@ -5265,6 +5265,10 @@ sub get_sourceslist_by_suite {
my $compstr = shift;
my $suite_by_vendor = shift;
if (!$suite) {
error "get_sourceslist_by_suite cannot operate with an empty suite";
}
my @debstable = keys %{ $suite_by_vendor->{'debian'} };
my @ubuntustable = keys %{ $suite_by_vendor->{'ubuntu'} };
my @tanglustable = keys %{ $suite_by_vendor->{'tanglu'} };
@ -6525,6 +6529,10 @@ sub main() {
};
}
} elsif ($arg =~ /:\/\//) {
if (!$options->{suite}) {
error( "cannot create sources.list entry for URI"
. "with empty suite");
}
my $content = join ' ',
(
"deb$signedby",
@ -6580,6 +6588,9 @@ sub main() {
error "invalid mirror: $arg";
}
}
} elsif (!length($options->{suite})) {
warning
"cannot guess apt sources.list entry with empty suite name";
} else {
my $sourceslist
= get_sourceslist_by_suite($options->{suite},
@ -8650,6 +8661,16 @@ Create a tarball for use with C<sbuild --chroot-mode=unshare>:
$ mmdebstrap --variant=buildd unstable ~/.cache/sbuild/unstable-amd64.tar
Create a buildd tarball for EOL distro:
$ mmdebstrap --include=apt --variant=buildd --aptopt \
'Apt::Key::gpgvcommand "/usr/libexec/mmdebstrap/gpgvnoexpkeysig"' \
--aptopt='Acquire::Check-Valid-Until "false"' \
--keyring=/usr/share/keyrings/debian-archive-removed-keys.gpg \
--hook-dir=/usr/share/mmdebstrap/hooks/maybe-jessie-or-older \
jessie ~/.cache/sbuild/jessie-arm64.tar \
http://archive.debian.org/debian
Instead of a tarball, a squashfs image can be created:
$ mmdebstrap unstable unstable-chroot.squashfs

View file

@ -109,7 +109,7 @@ if [ "{{ VARIANT }}" = "-" ]; then
rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/systemd/catalog/database
rm /tmp/debian-{{ DIST }}-mm/var/lib/systemd/catalog/database
case {{ DIST }} in oldstable | stable | testing)
case {{ DIST }} in oldstable | stable)
cap=$(chroot /tmp/debian-{{ DIST }}-debootstrap /sbin/getcap /bin/ping)
expected="/bin/ping cap_net_raw=ep"
if [ "$cap" != "$expected" ]; then

13
tests/empty-suite Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }}
trap "rm -f /tmp/debian-chroot.tar" EXIT INT TERM
{{ CMD }} --variant={{ VARIANT }} --verbose \
--setup-hook='echo deb {{ MIRROR }} {{ DIST }} main >> "$1"/etc/apt/sources.list' \
'' /tmp/debian-chroot.tar
cmp ./cache/mmdebstrap-{{ DIST }}-{{ VARIANT }}.tar /tmp/debian-chroot.tar \
|| diffoscope ./cache/mmdebstrap-{{ DIST }}-{{ VARIANT }}.tar /tmp/debian-chroot.tar