summaryrefslogtreecommitdiffstats
path: root/setver
diff options
context:
space:
mode:
Diffstat (limited to 'setver')
-rwxr-xr-xsetver17
1 files changed, 17 insertions, 0 deletions
diff --git a/setver b/setver
new file mode 100755
index 0000000..14efac1
--- /dev/null
+++ b/setver
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -eu
+
+OPK_SOURCE="$(sed 's/ .*//; q;' changelog)"
+BASE_VERSION="${OPK_SOURCE#linux-libre-}"
+GIT=''
+[ -d .git/ ] && GIT='git'
+
+for pkg in *.pkg/; do
+ ${GIT} mv "${pkg}" "${pkg%-*.pkg/}-${BASE_VERSION}.pkg/"
+done
+
+printf 'VER = %s\n' "${BASE_VERSION}" 1>basever.mk
+mv substvars substvars~
+sed "s/^Base-Version:.*$/Base-Version: ${BASE_VERSION}/" substvars~ 1>substvars
+rm substvars~