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.
This commit is contained in:
Daniel Baumann 2015-08-10 21:31:17 +02:00
parent 44ab759038
commit 421419c7fc
5 changed files with 25 additions and 22 deletions

View File

@ -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"

View File

@ -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)

View File

@ -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}"

View File

@ -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

View File

@ -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)