diff --git a/mmdebstrap b/mmdebstrap index a8d940b..6d8aeab 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1696,6 +1696,11 @@ sub run_download() { # (essential variant) then we have to compute the package set ourselves. # Same if we want to install priority based variants. if (any { $_ eq $options->{variant} } ('extract', 'custom')) { + if (scalar @pkgs_to_install == 0) { + info "nothing to download -- skipping..."; + return ([], []); + } + if ($options->{dryrun}) { info "simulate downloading packages with apt..."; } else { @@ -1902,6 +1907,11 @@ sub run_extract() { return; } + if (scalar @{$essential_pkgs} == 0) { + info "nothing to extract -- skipping..."; + return; + } + info "extracting archives..."; print_progress 0.0; my $counter = 0; @@ -2137,6 +2147,11 @@ sub run_essential() { my $essential_pkgs = shift; my $chrootcmd = shift; + if (scalar @{$essential_pkgs} == 0) { + info "no essential packages -- skipping..."; + return; + } + if ($options->{mode} eq 'chrootless') { if ($options->{dryrun}) { info "simulate installing packages...";