mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-20 21:13:38 +08:00
Merge pull request #72 from Churten/master
Ask git server about head revision before downloading
This commit is contained in:
@@ -197,11 +197,14 @@ if [[ ${FW_REV} != "" ]]; then
|
|||||||
download_rev
|
download_rev
|
||||||
do_update "updated to revision ${FW_REV}"
|
do_update "updated to revision ${FW_REV}"
|
||||||
elif [[ -f "${FW_REPOLOCAL}/.git/config" ]]; then
|
elif [[ -f "${FW_REPOLOCAL}/.git/config" ]]; then
|
||||||
update_repo
|
# ask git server version before spending time cloning
|
||||||
if [[ -f "${FW_PATH}/.firmware_revision" ]] && [[ $(cat "${FW_PATH}/.firmware_revision") == $(eval ${GITCMD} rev-parse master) ]]; then
|
GITREV=$(git ls-remote -h ${REPO_URI} refs/heads/master | awk '{print $1}')
|
||||||
|
if [[ -f "${FW_PATH}/.firmware_revision" ]] && [[ $(cat "${FW_PATH}/.firmware_revision") == "$GITREV" ]]; then
|
||||||
echo " *** Your firmware is already up to date"
|
echo " *** Your firmware is already up to date"
|
||||||
finalise
|
# no changes made, nothing to finalise
|
||||||
|
# finalise
|
||||||
else
|
else
|
||||||
|
update_repo
|
||||||
do_update "updated"
|
do_update "updated"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user