summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-21 21:58:07 +0100
committerErich Eckner <git@eckner.net>2019-02-21 21:58:07 +0100
commitde1026cf576d319ab193bb1c6fb4c2b6e927baf1 (patch)
tree7303b9c324c47fc1ed3578e2156ec0d8850fd2fd
parent55527d3ed60d32083d422ee7cb59df8cf6a4a10c (diff)
downloadcrux-ports-de1026cf576d319ab193bb1c6fb4c2b6e927baf1.tar.xz
alpine: repair lastVersion.sh
-rwxr-xr-xmanualPorts/alpine/lastVersion.sh32
1 files 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}"