From 551fe49161a7a21c6074de63f6891d15777346ce Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 4 Jun 2017 17:18:30 +0100 Subject: [PATCH] Avoid exiting early when parsing git hash See: https://github.com/Hexxeh/rpi-update/issues/245 --- rpi-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpi-update b/rpi-update index 2b9919d..a630816 100755 --- a/rpi-update +++ b/rpi-update @@ -356,7 +356,7 @@ function compare_hashes { function get_long_hash { # ask github for long version hash local REPO_API=${REPO_URI/github.com/api.github.com\/repos}/commits/$1 - eval curl -Ls ${GITHUB_AUTH_PARAM} ${REPO_API} | awk '{ if ($1 == "\"sha\":") { print substr($2, 2, 40); exit 0 } }' + eval curl -Ls ${GITHUB_AUTH_PARAM} ${REPO_API} | awk 'BEGIN {hash=""} { if (hash == "" && $1 == "\"sha\":") {hash=substr($2, 2, 40);} } END {print hash}' }