From b6d3c300c1000142bc250b5d120a306a08dbfbb7 Mon Sep 17 00:00:00 2001 From: Georgi Georgiev <310867+chutzimir@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:15:35 +0900 Subject: If a file needs to be updated, we can throw away the local copy This prevents wget from making an extra request to the server to check if the file needs to be downloaded - we already know that we want to download it because the size is different. --- apt-mirror | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apt-mirror b/apt-mirror index 9d2bcbf..19e034c 100755 --- a/apt-mirror +++ b/apt-mirror @@ -793,6 +793,10 @@ sub need_update return 1 unless ($size); return 0 if $size_on_server == $size; + + if ( get_variable("unlink") == 1 ) + unlink $filename; + } return 1; } -- cgit v1.2.3