--- lib/installer.sh.orig 2025-12-08 01:43:38.693876124 -0600 +++ lib/installer.sh 2025-12-08 01:48:50.958815391 -0600 @@ -1,16 +1,7 @@ #!/bin/bash -# shellcheck disable=SC2034 -GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true) - __version() { - git describe --tags --dirty 2>/dev/null || sed -re's/v?(.*)/v\1/' "$(dirname "${BASH_SOURCE[0]}")/../VERSION" || { - echo >&2 "ERROR: If you install from a git repository, you may need to run" - echo >&2 "ERROR: sudo git config --global --add safe.directory \$PWD" - echo >&2 "ERROR: to trust this git checkout for the root user." - echo >&2 "ERROR: See https://github.com/atar-axis/xpadneo/issues/346" - exit 3 - } + sed -re's/v?(.*)/v\1/' "$(dirname "${BASH_SOURCE[0]}")/../VERSION" } __version_lte() { @@ -20,28 +11,4 @@ # shellcheck disable=SC2034 VERSION=$(__version) -DKMS_BIN=$(type -p dkms) - -# shellcheck disable=SC2086 -: ${DKMS_BIN:?Please install dkms to continue} - -get_dkms_versions_installed() { - ${DKMS_BIN} status 2>/dev/null | tr -s ':,/ ' ' ' | awk -- '$1 == "hid-xpadneo" { print $2 }' | sort -nu -} - -get_upstream_version_latest() { - curl -sI "https://github.com/atar-axis/xpadneo/releases/latest" | \ - awk -- 'BEGIN{IGNORECASE=1} /^location:/ { n = split($2, v, /\//); print v[n]; exit }' | \ - tr -d '[:space:]' -} - -cat_dkms_make_log() { - local last_error=$? - if [ -n "${V[*]}" ]; then - cat "/var/lib/dkms/hid-xpadneo/${VERSION}/build/make.log" || true - fi - exit ${last_error} -} - -# shellcheck disable=SC2034 -mapfile -t INSTALLED < <(get_dkms_versions_installed) +INSTALLED=()