mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
Skip asking github for latest hash, if we're requesting a specific hash
Means one less call to curl in that scenario
This commit is contained in:
@@ -376,17 +376,17 @@ command -v readelf >/dev/null 2>&1 || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [[ "${FW_REV}" == "" ]]; then
|
||||
# ask github for latest version hash
|
||||
REPO_API=${REPO_URI/github.com/api.github.com\/repos}/git/refs/heads/${BRANCH}
|
||||
GITREV=$(curl -Ls ${REPO_API} | awk '{ if ($1 == "\"sha\":") { print substr($2, 2, 40) } }')
|
||||
FW_REV=${FW_REV:-${GITREV}}
|
||||
|
||||
FW_REV=$(curl -Ls ${REPO_API} | awk '{ if ($1 == "\"sha\":") { print substr($2, 2, 40) } }')
|
||||
if [[ "${FW_REV}" == "" ]]; then
|
||||
echo " *** No hash received from github: ${REPO_API}"
|
||||
# run again with errors not suppressed
|
||||
curl -L ${REPO_API}
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f "${FW_REVFILE}" ]]; then
|
||||
echo " *** We're running for the first time"
|
||||
|
||||
Reference in New Issue
Block a user