diff options
-rw-r--r-- | core/includes/distribution.inc | 6 | ||||
-rwxr-xr-x | mltk | 9 |
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="" @@ -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 |