skip running apt-get update if we are very sure that it was already run
This commit is contained in:
parent
644ac62ecd
commit
9945e65701
1 changed files with 13 additions and 2 deletions
11
mmdebstrap
11
mmdebstrap
|
@ -2275,8 +2275,19 @@ sub run_update() {
|
|||
CHDIR => $options->{root},
|
||||
};
|
||||
|
||||
# Maybe "apt-get update" was already run in the setup hook? If yes, skip
|
||||
# running it here. We are overly strict on purpose because better to run it
|
||||
# twice on accident than not at all.
|
||||
if ( !-d "$options->{root}/var/lib/apt/lists/auxfiles"
|
||||
|| !-d "$options->{root}/var/lib/apt/lists/partial"
|
||||
|| !-e "$options->{root}/var/lib/apt/lists/lock"
|
||||
|| !-e "$options->{root}/var/cache/apt/pkgcache.bin"
|
||||
|| !-e "$options->{root}/var/cache/apt/srcpkgcache.bin") {
|
||||
info "running apt-get update...";
|
||||
run_apt_progress($aptopts);
|
||||
} else {
|
||||
info "skipping apt-get update because it was already run";
|
||||
}
|
||||
|
||||
# check if anything was downloaded at all
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue