Switch installer source; fix package install (#12824) (#12829)

* switch installer to new distri

* re-generate script

* fix change capitaisation behaviour

* fix installer

(cherry picked from commit 04b5b69b69)
This commit is contained in:
Matthias Mair
2026-09-09 09:34:00 +10:00
committed by GitHub
parent 0cfc1f5b2d
commit 718aed27ee
4 changed files with 42 additions and 21 deletions
+28 -10
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# This script was generated by bashly 1.3.3 (https://bashly.dev)
# This script was generated by bashly 1.4.0 (https://bashly.dev)
# Modifying it manually is not recommended
if ((BASH_VERSINFO[0] < 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] < 2))); then
@@ -15,7 +15,7 @@ root_command() {
no_call=${args[--no-call]}
dry_run=${args[--dry-run]}
REQS="wget apt-transport-https curl gpg"
REQS="curl"
function do_call() {
if [[ $dry_run ]]; then
@@ -56,6 +56,7 @@ root_command() {
get_distribution
echo "### Detected distribution: $OS $VER"
SUPPORTED=true # is this OS supported?
OLD_VERSION=false # is this an old OS that is no longer supported?
DIST_OS=${OS,,}
DIST_VER=$VER
@@ -64,21 +65,30 @@ root_command() {
Ubuntu)
if [[ $VER == "24.04" ]]; then
SUPPORTED=true
elif [[ $VER == "22.04" ]]; then
elif [[ $VER == "26.04" ]]; then
SUPPORTED=true
elif [[ $VER == "20.04" ]]; then
SUPPORTED=true
SUPPORTED=false
OLD_VERSION=true
elif [[ $VER == "22.04" ]]; then
SUPPORTED=false
OLD_VERSION=true
else
SUPPORTED=false
fi
;;
"Debian GNU/Linux" | "debian gnu/linux" | Raspbian)
if [[ $VER == "12" ]]; then
if [[ $VER == "13" ]]; then
SUPPORTED=true
elif [[ $VER == "12" ]]; then
SUPPORTED=false
OLD_VERSION=true
elif [[ $VER == "11" ]]; then
SUPPORTED=true
SUPPORTED=false
OLD_VERSION=true
elif [[ $VER == "10" ]]; then
SUPPORTED=true
SUPPORTED=false
OLD_VERSION=true
else
SUPPORTED=false
fi
@@ -92,6 +102,11 @@ root_command() {
if [[ $SUPPORTED != "true" ]]; then
echo "This OS is currently not supported."
if [[ $OLD_VERSION == "true" ]]; then
echo "The detected version ($OS $VER) is no longer supported but a newer version is."
fi
echo "Please install manually using https://docs.inventree.org/en/stable/start/install/"
echo "or check https://github.com/inventree/InvenTree/issues/3836 for packaging for your OS."
echo "If you think this is a bug please file an issue at"
@@ -110,10 +125,11 @@ root_command() {
done
echo "### Getting and adding key"
curl -fsSL https://dl.packager.io/srv/$publisher/InvenTree/key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-inventree.gpg > /dev/null
sudo curl -fsSL "https://go.packager.io/srv/deb/$publisher/InvenTree/gpg-key.gpg" -o /usr/share/keyrings/InvenTree.gpg
echo "### Adding package source"
SOURCE_URL="deb [signed-by=/etc/apt/trusted.gpg.d/pkgr-inventree.gpg] https://dl.packager.io/srv/deb/$publisher/InvenTree/$source_url/$DIST_OS $DIST_VER main"
echo "$SOURCE_URL" | tee /etc/apt/sources.list.d/inventree.list > /dev/null
SOURCE_URL="https://go.packager.io/srv/$publisher/InvenTree/$source_url/installer/$DIST_OS/$DIST_VER.list"
sudo curl -fsSL "$SOURCE_URL" > /etc/apt/sources.list.d/inventree.list
echo "### Updating package lists"
do_call "sudo apt-get update"
@@ -144,6 +160,7 @@ install.sh_usage() {
echo
if [[ -n "$long_usage" ]]; then
printf "%s\n" "Options:"
printf " %s\n" "--no-call, -n"
@@ -214,6 +231,7 @@ normalize_input() {
}
parse_requirements() {
local key
while [[ $# -gt 0 ]]; do
key="$1"