From f868073b6edbf3ab7ad7a0794ff35ff0fd9ca316 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Tue, 17 Aug 2021 11:11:00 +0200 Subject: [PATCH] add --skip=setup, --skip=update and --skip=cleanup --- mmdebstrap | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index 1675e72..1752943 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1444,11 +1444,19 @@ sub setup { warning "cannot read $options->{apttrustedparts}"; } - run_setup($options); + if (any { $_ eq 'setup' } @{ $options->{skip} }) { + info "skipping setup as requested"; + } else { + run_setup($options); + } run_hooks('setup', $options); - run_update($options); + if (any { $_ eq 'update' } @{ $options->{skip} }) { + info "skipping update as requested"; + } else { + run_update($options); + } (my $pkgs_to_install, my $essential_pkgs, my $cached_debs) = run_download($options); @@ -1480,7 +1488,11 @@ sub setup { run_hooks('customize', $options); } - run_cleanup($options); + if (any { $_ eq 'cleanup' } @{ $options->{skip} }) { + info "skipping cleanup as requested"; + } else { + run_cleanup($options); + } return; } @@ -6614,7 +6626,7 @@ Upon startup, several checks are carried out, like: =item B -The following tasks are carried out: +The following tasks are carried out unless B<--skip=setup> is used: =over 4 @@ -6639,7 +6651,7 @@ Run B<--setup-hook> options and all F scripts in B<--hook-dir>. =item B Runs C using the temporary apt configuration file created in -the B step. +the B step. This can be disabled using B<--skip=update>. =item B @@ -6696,7 +6708,7 @@ This step is not carried out in B mode. =item B -Performs cleanup tasks like: +Performs cleanup tasks, unless B<--skip=cleanup> is used: =over 4