From 7aed9980a24771925e138e42f3b0a86ebade1c88 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 21 Jan 2020 06:24:13 +0100 Subject: alpine: fix lastVersion.sh --- manualPorts/alpine/lastVersion.sh | 54 +++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'manualPorts') diff --git a/manualPorts/alpine/lastVersion.sh b/manualPorts/alpine/lastVersion.sh index 4055339..29b0e71 100755 --- a/manualPorts/alpine/lastVersion.sh +++ b/manualPorts/alpine/lastVersion.sh @@ -1,34 +1,34 @@ #!/bin/bash -git -C /usr/src/sonstiges/alpine fetch --all -p >/dev/null 2>&1 +GIT='git -C /usr/src/sonstiges/alpine' -release_version=$( - sed -n ' - /^\s*VERSION\s*=/!d - s/^.*=\s*// - s/['"'"'"]//g - /^\$/d - p - ' /usr/src/sonstiges/alpine/configure -) -line=$( - sed -n ' - /^\s*VERSION\s*=\s*['"'"'"]*\$/d - /^\s*VERSION\s*=/ = - ' /usr/src/sonstiges/alpine/configure -) -release_commit=$( - git -C /usr/src/sonstiges/alpine blame -L${line},${line} -- configure | \ - awk '{print $1}' +${GIT} fetch --all -p >/dev/null 2>&1 + +revision=$( + ${GIT} rev-parse --short master ) -head_rev=$( - git -C /usr/src/sonstiges/alpine rev-parse --short upstream/master +version=$( + ${GIT} archive "${revision}" -- configure | \ + tar -Ox | \ + sed -n ' + /^\s*VERSION\s*=/!d + = + s/^.*=\s*// + s/['"'"'"]//g + p + q + ' | \ + sed ' + N + s/\n/ / + ' ) -post_release_commits=$( - git -C /usr/src/sonstiges/alpine rev-list --count "${head_rev}" "^${release_commit}" +line=${version% *} +pkgver=${version#* } +rev_count=$( + ${GIT} rev-list "${revision}" ^$(${GIT} blame -L${line},${line} "${revision}" -- configure | cut -d' ' -f1) --count ) - printf '%s.r%s.%s\n' \ - "${release_version}" \ - "${post_release_commits}" \ - "${head_rev}" + "${pkgver}" \ + "${rev_count}" \ + "${revision}" -- cgit v1.2.3-70-g09d2