summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-02-27 15:01:17 +0100
committerJonathan Bauer2018-02-27 15:01:17 +0100
commit0691dac218d6e678f193ea159fd8f3f9d7fd5807 (patch)
tree6d97040a137559cd6d02350920be038956b61153
parent[kernel-vanilla] add libssl-dev (diff)
downloadmltk-0691dac218d6e678f193ea159fd8f3f9d7fd5807.tar.gz
mltk-0691dac218d6e678f193ea159fd8f3f9d7fd5807.tar.xz
mltk-0691dac218d6e678f193ea159fd8f3f9d7fd5807.zip
add '--force-sys-version' option
used to test on new distro versions by overriding lsb_release output (e.g. test ubuntu 17.10's configs on 18.04)
-rw-r--r--core/includes/distribution.inc6
-rwxr-xr-xmltk9
2 files changed, 14 insertions, 1 deletions
diff --git a/core/includes/distribution.inc b/core/includes/distribution.inc
index 57bafdf2..e64ace1f 100644
--- a/core/includes/distribution.inc
+++ b/core/includes/distribution.inc
@@ -26,7 +26,11 @@ detect_distribution () {
;;
esac
# Get version - we mangle this quite a bit. first make sure it has no spaces, then split version at period (.), underscore (_) and dash (-)
- SYS_VERSION=$(lsb_release -rs | tolower)
+ if [ -n "$FORCE_SYS_VERSION" ]; then
+ SYS_VERSION="$FORCE_SYS_VERSION"
+ else
+ SYS_VERSION=$(lsb_release -rs | tolower)
+ fi
SYS_CODENAME=$(lsb_release -c|cut -f 2) # Codename: eg. Ubuntu raring, openSuse: Dartmouth etc.
local VERSION=$(echo $SYS_VERSION | sed -r 's/\s//g;s/[\._]/ /g;s/-//g')
local STRTMP=""
diff --git a/mltk b/mltk
index b31ac518..43cf525a 100755
--- a/mltk
+++ b/mltk
@@ -202,6 +202,15 @@ read_params() {
REMOTE_EXPORT="1"
continue
;;
+ --force-sys-version)
+ if [ -z "$1" ]; then
+ perror "--force-sys-version requires an argument, e.g. '18.04'."
+ else
+ FORCE_SYS_VERSION="$1"
+ shift
+ fi
+ continue
+ ;;
*)
pwarning "Unknown flag to target: $PARAM"
print_usage