From de1026cf576d319ab193bb1c6fb4c2b6e927baf1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 21 Feb 2019 21:58:07 +0100 Subject: alpine: repair lastVersion.sh --- manualPorts/alpine/lastVersion.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/manualPorts/alpine/lastVersion.sh b/manualPorts/alpine/lastVersion.sh index 055b7e1..a811610 100755 --- a/manualPorts/alpine/lastVersion.sh +++ b/manualPorts/alpine/lastVersion.sh @@ -1,23 +1,31 @@ #!/bin/bash -git -C /usr/src/sonstiges/alpine pull >/dev/null 2>&1 - -if [ $# -eq 0 ]; then +git -C /usr/src/sonstiges/alpine fetch --all -p >/dev/null 2>&1 +release_version=$( sed -n ' /^VERSION\s*=/!d s/^.*=\s*// p ' /usr/src/sonstiges/alpine/Makefile - -else - - line=$( - sed -n ' - /^VERSION\s*=/ = - ' /usr/src/sonstiges/alpine/Makefile - ) +) +line=$( + sed -n ' + /^VERSION\s*=/ = + ' /usr/src/sonstiges/alpine/Makefile +) +release_commit=$( git -C /usr/src/sonstiges/alpine blame -L${line},${line} -- Makefile | \ awk '{print $1}' +) +head_rev=$( + git -C /usr/src/sonstiges/alpine rev-parse --short upstream/master +) +post_release_commits=$( + git -C /usr/src/sonstiges/alpine rev-list --count "${head_rev}" "^${release_commit}" +) -fi +printf '%s.r%s.%s\n' \ + "${release_version}" \ + "${post_release_commits}" \ + "${head_rev}" -- cgit v1.2.3-70-g09d2