summaryrefslogtreecommitdiff
path: root/manualPorts
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-01-21 06:24:13 +0100
committerErich Eckner <git@eckner.net>2020-01-21 06:24:13 +0100
commit7aed9980a24771925e138e42f3b0a86ebade1c88 (patch)
tree42df020144202005016b3a1f783dcc6156f813a0 /manualPorts
parent1d1bc320055d39560330620b02de2599c798ad74 (diff)
downloadcrux-ports-7aed9980a24771925e138e42f3b0a86ebade1c88.tar.xz
alpine: fix lastVersion.sh
Diffstat (limited to 'manualPorts')
-rwxr-xr-xmanualPorts/alpine/lastVersion.sh54
1 files changed, 27 insertions, 27 deletions
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}"