summaryrefslogtreecommitdiffstats
path: root/debian/_buildscripts/local/internals/_build_common.sh
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2018-07-30 22:49:19 +0900
committerMichele Calgaro <[email protected]>2018-07-30 22:49:19 +0900
commit10a972bbd7ab75c6d3cd68ec3e30b8a70bf3b168 (patch)
tree93bac0bbb97f8907b4445d617e4046d6bb1050ea /debian/_buildscripts/local/internals/_build_common.sh
parent55d493de587a08b20eec26ada3cdad49c8329cf9 (diff)
downloadtde-packaging-10a972bbd7ab75c6d3cd68ec3e30b8a70bf3b168.tar.gz
tde-packaging-10a972bbd7ab75c6d3cd68ec3e30b8a70bf3b168.zip
DEB build scripts:
- fixed support for Devuan Jessie. - dropped Sarge, Etch, Lenny, Lucid from list of supported distros. - added auto detection of distro, distro name and architecture. Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'debian/_buildscripts/local/internals/_build_common.sh')
-rwxr-xr-xdebian/_buildscripts/local/internals/_build_common.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/debian/_buildscripts/local/internals/_build_common.sh b/debian/_buildscripts/local/internals/_build_common.sh
index 8b048a635..28f3fb2bf 100755
--- a/debian/_buildscripts/local/internals/_build_common.sh
+++ b/debian/_buildscripts/local/internals/_build_common.sh
@@ -54,6 +54,12 @@ function _set_path_variables()
{
# Set useful path variables
set -a
+
+ #-- get desired distribution and architecture
+ [[ "$DISTRO" = "" ]] && DISTRO=$(lsb_release -is | sed -e 's/\(.*\)/\L\1/')
+ [[ "$DISTRO_NAME" = "" ]] && DISTRO_NAME=$(lsb_release -cs | sed -e 's/\(.*\)/\L\1/')
+ [[ "$ARCHITECTURE" = "" ]] && ARCHITECTURE=$(dpkg --print-architecture)
+
REPO_DIR="$TDE_DIR/$CFG_GIT_DIR"
REPO_TDE="$TDE_DIR/$CFG_GIT_DIR/tde"
REPO_TDE_MAIN="$REPO_TDE/main"
@@ -111,6 +117,7 @@ function init_common()
# -- Need to use a "here string" otherwise if the DISTRO_FOUND value is modified
# -- inside the while loop, this would not remember after the loop.
DISTRO_FOUND="n"
+ OLD_IFS=$IFS && IFS=$' \t'
while read l_distro l_version l_name l_rel_suffix l_packaging_path; do
if [ "$l_distro" = "$DISTRO" -a "$l_name" = "$DISTRO_NAME" ]; then
DISTRO_FOUND="y"
@@ -124,6 +131,7 @@ function init_common()
break
fi
done <<< $(cat $DISTS_FILE | grep -E "^(\s*[^#\s]+\s+[^\s]+.*)$")
+ IFS=$OLD_IFS
if [ "$DISTRO_FOUND" != "y" ]; then
echo -e "${CLightRed} --- ERROR ---${CNone}"
echo -e "The specified distribution (${CYellow}$DISTRO $DISTRO_NAME${CNone}) is not supported."