make_mirror.sh: support FORCE_UPDATE=yes

This commit is contained in:
Johannes Schauer Marin Rodrigues 2023-09-27 07:42:12 +02:00
parent 8bf8da5e8e
commit 806ea4b35d
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -301,8 +301,9 @@ components=main
# by default, use the mmdebstrap executable in the current directory
: "${CMD:=./mmdebstrap}"
: "${USE_HOST_APT_CONFIG:=no}"
: "${FORCE_UPDATE:=no}"
if [ -e "$oldmirrordir/dists/$DEFAULT_DIST/InRelease" ]; then
if [ "$FORCE_UPDATE" != "yes" ] && [ -e "$oldmirrordir/dists/$DEFAULT_DIST/InRelease" ]; then
http_code=$(curl --output /dev/null --silent --location --head --time-cond "$oldmirrordir/dists/$DEFAULT_DIST/InRelease" --write-out '%{http_code}' "$mirror/dists/$DEFAULT_DIST/InRelease")
case "$http_code" in
200) ;; # need update