summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2020-04-23 17:00:19 +0200
committerRaphaël Hertzog <hertzog@debian.org>2020-04-23 17:00:19 +0200
commite71db2bd58d1abdc6658db82642d9c614e9de2ec (patch)
tree5dc4f72f2d32be341dc8ceb8ea6ddff201a95132
parent6f7446fa8924211db59f992936c2d56266ef4189 (diff)
downloadvyos-live-build-e71db2bd58d1abdc6658db82642d9c614e9de2ec.tar.gz
vyos-live-build-e71db2bd58d1abdc6658db82642d9c614e9de2ec.zip
Fix version computing when LIVE_BUILD is set
It used to rely on the $LIVE_BUILD/VERSION file which is now gone. Instead we now rely on the debian/changelog file just like we do in the Makefile.
-rwxr-xr-xfunctions/common.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/functions/common.sh b/functions/common.sh
index 3071c9a73..edfd4ef58 100755
--- a/functions/common.sh
+++ b/functions/common.sh
@@ -11,10 +11,8 @@
PROGRAM_NAME="live-build"
PROGRAM="lb"
-VERSION="$(if [ -e ${LIVE_BUILD}/VERSION ]; then cat ${LIVE_BUILD}/VERSION; else cat /usr/share/live/build/VERSION; fi)"
-CONFIG_VERSION="$(echo ${VERSION} | awk -F- '{ print $1 }')"
+VERSION="$(if [ -e ${LIVE_BUILD}/debian/changelog ]; then sed -e 's/.*(\(.*\)).*/\1/; s/^[0-9]://; q' ${LIVE_BUILD}/debian/changelog; else cat /usr/share/live/build/VERSION; fi)"
-# FIXME
-LIVE_BUILD_VERSION="${CONFIG_VERSION}"
+LIVE_BUILD_VERSION="${VERSION}"
PATH="${PWD}/local/bin:${PATH}"