From 89d38f11bd4b34479040736e5cf2f520d7996fbf Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 14 May 2022 11:46:30 +0200 Subject: [PATCH] refactor(klipper.sh): rename package `python-dev` to `python2-dev` (fixes #195) On more modern linux distros like Ubuntu 22, the package `python-dev` was renamed to `python2-dev` resulting in `E: Package 'python-dev' has no installation candidate` Signed-off-by: Dominik Willner th33xitus@gmail.com --- scripts/klipper.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/klipper.sh b/scripts/klipper.sh index 88b5dff..857a98b 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -146,16 +146,24 @@ function klipper_setup_dialog(){ function install_klipper_packages(){ local packages python_version="${1}" - local install_script="${HOME}/klipper/scripts/install-octopi.sh" + local install_script="${HOME}/klipper/scripts/install-debian.sh" status_msg "Reading dependencies..." # shellcheck disable=SC2016 packages=$(grep "PKGLIST=" "${install_script}" | cut -d'"' -f2 | sed 's/\${PKGLIST}//g' | tr -d '\n') - ### replace python-dev with python3-dev if python3 was selected - [ "${python_version}" == "python3" ] && packages="${packages//python-dev/python3-dev}" + ### add dfu-util for octopi-images + packages+=" dfu-util" ### add dbus requirement for DietPi distro [ -e "/boot/dietpi/.version" ] && packages+=" dbus" + if [[ "${python_version}" == "python3" ]]; then + ### replace python-dev with python3-dev if python3 was selected + packages="${packages//python-dev/python3-dev}" + else + ### package name 'python-dev' is deprecated (-> no installation candidate) on more modern linux distros + packages="${packages//python-dev/python2-dev}" + fi + echo "${cyan}${packages}${white}" | tr '[:space:]' '\n' read -r -a packages <<< "${packages}"