summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-08-10 21:31:17 +0200
committerDaniel Baumann <mail@daniel-baumann.ch>2015-08-10 21:31:21 +0200
commit421419c7fc96df18c422102a52879dd6860725a6 (patch)
tree3edd25d85befdd16b36916e098e52a035c04b781
parent44ab7590386050c06b828a1b37bbbc8d1c45f5ae (diff)
downloadvyos-live-build-421419c7fc96df18c422102a52879dd6860725a6.tar.gz
vyos-live-build-421419c7fc96df18c422102a52879dd6860725a6.zip
Getting rid of hard-coded release numbers and using /etc/os-release instead (Closes: #790860).
Unfortunately VERSION_ID on testing/unstable is currently not included in /etc/os-release, see #795124.
-rwxr-xr-xfunctions/releases.sh18
-rwxr-xr-xscripts/build/binary_disk8
-rwxr-xr-xscripts/build/binary_syslinux7
-rwxr-xr-xscripts/build/installer_debian-installer6
-rwxr-xr-xscripts/build/source_disk8
5 files changed, 25 insertions, 22 deletions
diff --git a/functions/releases.sh b/functions/releases.sh
deleted file mode 100755
index 771413357..000000000
--- a/functions/releases.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-## live-build(7) - System Build Scripts
-## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
-##
-## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-## This is free software, and you are welcome to redistribute it
-## under certain conditions; see COPYING for details.
-
-
-# Debian releases
-RELEASE_jessie="8"
-RELEASE_stretch="9"
-RELEASE_sid="unstable"
-
-# Progress Linux releases
-RELEASE_baureo="2"
-RELEASE_cairon="3"
diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk
index 4f444b0be..7175a543a 100755
--- a/scripts/build/binary_disk
+++ b/scripts/build/binary_disk
@@ -51,7 +51,13 @@ mkdir -p binary/.disk
ARCHITECTURE="$(echo ${LB_ARCHITECTURES} | sed -e 's| |/|g')"
DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')"
DISTRIBUTION="${DISTRIBUTION}$(echo ${LB_DISTRIBUTION} | cut -b 2-)"
-eval VERSION="$`echo RELEASE_${LB_DISTRIBUTION}`"
+
+if [ -e chroot/etc/os-release ]
+then
+ VERSION="$(. chroot/etc/os-release && echo ${VERSION_ID})"
+fi
+
+VERSION="${VERSION:-none}"
case "${LB_MODE}" in
debian)
diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux
index 42203297b..41d7feccb 100755
--- a/scripts/build/binary_syslinux
+++ b/scripts/build/binary_syslinux
@@ -229,7 +229,12 @@ then
esac
fi
-eval _VERSION="$`echo RELEASE_${LB_DISTRIBUTION}`"
+if [ -e chroot/etc/os-release ]
+then
+ _VERSION="$(. chroot/etc/os-release && echo ${VERSION_ID})"
+fi
+
+_VERSION="${VERSION:-none}"
_DISTRIBUTION="${LB_DISTRIBUTION}"
_ARCHITECTURE="${LB_ARCHITECTURES}"
diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer
index 84726ceae..5445753da 100755
--- a/scripts/build/installer_debian-installer
+++ b/scripts/build/installer_debian-installer
@@ -663,7 +663,11 @@ then
# Generating release file
mv binary chroot/root
- eval _VERSION="$`echo RELEASE_${LB_PARENT_DISTRIBUTION}`"
+ if [ -e chroot/etc/os-release ]
+ then
+ _VERSION="$(. chroot/etc/os-release && echo ${VERSION_ID})"
+ fi
+
if [ -n "${_VERSION}" ]; then
_LB_APT_VERSION_OPT='-o APT::FTPArchive::Release::Version="'"${_VERSION}"'"'
fi
diff --git a/scripts/build/source_disk b/scripts/build/source_disk
index 6cf99e0c0..eaaf7d2dd 100755
--- a/scripts/build/source_disk
+++ b/scripts/build/source_disk
@@ -51,7 +51,13 @@ mkdir -p source/.disk
DISTRIBUTION="$(echo ${LB_DISTRIBUTION} | cut -b 1 | tr '[a-z]' '[A-Z]')"
DISTRIBUTION="${DISTRIBUTION}$(echo ${LB_DISTRIBUTION} | cut -b 2-)"
-eval VERSION="$`echo RELEASE_${LB_DISTRIBUTION}`"
+
+if [ -e chroot/etc/os-release ]
+then
+ VERSION="$(. chroot/etc/os-release && echo ${VERSION_ID})"
+fi
+
+VERSION="${VERSION:-none}"
case "${LB_MODE}" in
debian)