From b7d3dba7d25423fcd886e4c2077ca25ee625e1a6 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Mon, 26 Aug 2013 20:10:27 +0100 Subject: [PATCH] Replace usages of $FW_PATH/.firmware_revision with a $FW_REVFILE variable --- rpi-update | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpi-update b/rpi-update index 5825a1f..9a3ead9 100755 --- a/rpi-update +++ b/rpi-update @@ -24,6 +24,7 @@ FW_REPOLOCAL="${ROOT_PATH}/root/.rpi-firmware" FW_PATH="${BOOT_PATH}" FW_MODPATH="${ROOT_PATH}/lib/modules" FW_REV=${1:-""} +FW_REVFILE="${FW_PATH}/.firmware_revision" GITCMD="git --git-dir=\"${FW_REPOLOCAL}/.git\" --work-tree=\"${FW_REPOLOCAL}\"" [ "${RPI_UPDATE_UNSUPPORTED}" -ne 0 ] && echo -e "You appear to be trying to update firmware on an incompatible distribution. To force update, run the following:\nsudo -E RPI_UPDATE_UNSUPPORTED=0 ./rpi-update" && exit 1 @@ -107,9 +108,9 @@ function finalise { ldconfig -r "${ROOT_PATH}" if [[ ${FW_REV} == "" ]]; then echo " *** Storing current firmware revision" - eval ${GITCMD} rev-parse ${BRANCH} > "${FW_PATH}/.firmware_revision" + eval ${GITCMD} rev-parse ${BRANCH} > "${FW_REVFILE}" else - echo ${FW_REV} > "${FW_PATH}/.firmware_revision" + echo ${FW_REV} > "${FW_REVFILE}" fi echo " *** Syncing changes to disk" sync @@ -205,7 +206,7 @@ if [[ ${FW_REV} != "" ]]; then elif [[ -f "${FW_REPOLOCAL}/.git/config" ]]; then # ask git server version before spending time cloning GITREV=$(git ls-remote -h ${REPO_URI} refs/heads/${BRANCH} | awk '{print $1}') - if [[ -f "${FW_PATH}/.firmware_revision" ]] && [[ $(cat "${FW_PATH}/.firmware_revision") == "$GITREV" ]]; then + if [[ -f "${FW_REVFILE}" ]] && [[ $(cat "${FW_REVFILE}") == "$GITREV" ]]; then echo " *** Your firmware is already up to date" # no changes made, nothing to finalise # finalise