Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apt-mirror/apt-mirror.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Georgiev <310867+chutzimir@users.noreply.github.com>2022-07-13 18:15:35 +0300
committerGeorgi Georgiev <310867+chutzimir@users.noreply.github.com>2022-10-17 17:41:23 +0300
commite7ae245a64f87ced9e33c8026ec6cdf80c4b0159 (patch)
treece21c2d547a27dc9516d80b46354f20c0fdab812
parentdde1257c2cebe628802d27e9471e288cd8dc12b5 (diff)
If a file needs to be updated, we better throw it away
This saves wget from making an extra request to the server to check if the file needs to be downloaded - we already checked that we want to download it.
-rwxr-xr-xapt-mirror3
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-mirror b/apt-mirror
index 8323893..635b5f9 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -785,6 +785,9 @@ sub need_update
return 1 unless ($size);
return 0 if $size_on_server == $size;
+
+ # The file is corrupted, throw it away so we can download it again
+ unlink $filename;
return 1;
}