X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=scripts%2Fgetver.sh;h=9175f411db8345ab420fdb1edcaf0d20f858f12f;hb=0bef8f8011d11c66f02551f16b7740c735f188d1;hp=e718485852d427300892f412dba320a494a1c23f;hpb=efdd3bf5fbab94b3f84e8a285e83ef36e39b3e8b;p=openwrt%2Fopenwrt.git diff --git a/scripts/getver.sh b/scripts/getver.sh index e718485852..9175f411db 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -33,14 +33,15 @@ try_git() { UPSTREAM_BASE="$(git merge-base $GET_REV $ORIGIN)" UPSTREAM_REV="$(git rev-list ${REBOOT}..$UPSTREAM_BASE | wc -l | awk '{print $1}')" else - UPSTREAM_REV=$REV + UPSTREAM_REV=0 fi if [ "$REV" -gt "$UPSTREAM_REV" ]; then REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))" fi - REV="${REV:+r$REV}" + REV="${REV:+r$REV-$(git log -n 1 --format="%h" $UPSTREAM_BASE)}" + ;; esac