Merge pull request #85410 from matthewbauer/skip-post-fetch-in-hashed-mirrors
fetchurl: don’t run ‘postFetch’ on hashed-mirrors
This commit is contained in:
commit
ba160ab741
|
@ -47,13 +47,18 @@ tryDownload() {
|
||||||
|
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
|
local skipPostFetch="$1"
|
||||||
|
|
||||||
set +o noglob
|
set +o noglob
|
||||||
|
|
||||||
if [[ $executable == "1" ]]; then
|
if [[ $executable == "1" ]]; then
|
||||||
chmod +x $downloadedFile
|
chmod +x $downloadedFile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
runHook postFetch
|
if [ -z "$skipPostFetch" ]; then
|
||||||
|
runHook postFetch
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +74,13 @@ tryHashedMirrors() {
|
||||||
--fail --silent --show-error --head "$url" \
|
--fail --silent --show-error --head "$url" \
|
||||||
--write-out "%{http_code}" --output /dev/null > code 2> log; then
|
--write-out "%{http_code}" --output /dev/null > code 2> log; then
|
||||||
tryDownload "$url"
|
tryDownload "$url"
|
||||||
if test -n "$success"; then finish; fi
|
|
||||||
|
# We skip postFetch here, because hashed-mirrors are
|
||||||
|
# already content addressed. So if $outputHash is in the
|
||||||
|
# hashed-mirror, changes from ‘postFetch’ would already be
|
||||||
|
# made. So, running postFetch will end up applying the
|
||||||
|
# change /again/, which we don’t want.
|
||||||
|
if test -n "$success"; then finish skipPostFetch; fi
|
||||||
else
|
else
|
||||||
# Be quiet about 404 errors, which we interpret as the file
|
# Be quiet about 404 errors, which we interpret as the file
|
||||||
# not being present on this particular mirror.
|
# not being present on this particular mirror.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user