From 58004816d1df9ccad22f0f47e6d5fc179562ea00 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Fri, 21 Sep 2018 08:05:15 +0200 Subject: [PATCH] If nothing got downloaded, check if a file:// URI was maybe used and warn about it --- mmdebstrap | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mmdebstrap b/mmdebstrap index 199ed8f..c120d4e 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -666,7 +666,14 @@ sub setup { $? == 0 or die "tar --extract failed: $?"; } if ($num_essential == 0) { - die "nothing got downloaded. used file:// uri instead of copy://?"; + # check if a file:// URI was used + open(my $pipe_apt, '-|', 'apt-get', 'indextargets', '--format', '$(URI)', 'Created-By: Packages') or die "cannot start apt-get indextargets: $!"; + while (my $uri = <$pipe_apt>) { + if ($uri =~ /^file:\/\//) { + die "nothing got downloaded -- use copy:// instead of file://"; + } + } + die "nothing got downloaded"; } if ($options->{mode} eq 'fakechroot') {