From 4ca0865fe31f18a044984a032f7cee1049a97f32 Mon Sep 17 00:00:00 2001 From: Christian Visintin Date: Mon, 9 Feb 2026 10:12:04 +0100 Subject: [PATCH] chore: Use apt to install termscp on debian base to prevent broken deps --- .github/workflows/build-artifacts.yml | 2 +- .github/workflows/install.yml | 14 +++++--- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- install.sh | 49 ++++++++++++++++++++++++++- 6 files changed, 61 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 1bec405..15ddaa7 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -35,7 +35,7 @@ jobs: runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable with: toolchain: stable diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 03b091f..745a108 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -11,13 +11,17 @@ env: jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: sudo apt update && sudo apt install -y curl wget libsmbclient + - uses: actions/checkout@v6 - name: Install termscp from script run: | - ./install.sh -v=0.12.3 -f + ./install.sh -f which termscp || exit 1 + termscp --version diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1f46a1e..5071011 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Install dependencies run: sudo apt update && sudo apt install -y libdbus-1-dev libsmbclient-dev - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3922f76..323d27a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,7 +17,7 @@ jobs: build: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable with: toolchain: stable diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index cc45cc1..e2eac00 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -18,7 +18,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable with: toolchain: stable diff --git a/install.sh b/install.sh index 6a3030b..eab19ba 100755 --- a/install.sh +++ b/install.sh @@ -217,6 +217,51 @@ install_with_brew() { fi } +install_on_debian() { + local pkg_manager + if has apt; then + pkg_manager="apt" + elif has apt-get; then + pkg_manager="apt-get" + elif has dpkg; then + pkg_manager="dpkg" + else + try_with_cargo "we couldn't find any suitable package manager on your debian distribution" && return $? ;; + fi + + case "${ARCH}" in + x86_64) DEB_URL="$DEB_URL_AMD64" ;; + aarch64) DEB_URL="$DEB_URL_AARCH64" ;; + *) try_with_cargo "we don't distribute packages for ${ARCH} at the moment" && return $? ;; + esac + info "Detected $pkg_manager on your system" + info "Installing ${GREEN}termscp${NO_COLOR} via Debian package" + archive=$(get_tmpfile "deb") + download "${archive}" "${DEB_URL}" + info "Downloaded debian package to ${archive}" + if test_writeable "/usr/bin"; then + sudo="" + msg="Installing ${GREEN}termscp${NO_COLOR}, please wait…" + else + warn "Root permissions are required to install ${GREEN}termscp${NO_COLOR}…" + elevate_priv + sudo="sudo" + msg="Installing ${GREEN}termscp${NO_COLOR} as root, please wait…" + fi + info "$msg" + + if [ "$pkg_manager" = "apt" ]; then + $sudo apt install -y "${archive}" + elif [ "$pkg_manager" = "apt-get" ]; then + $sudo dpkg -i "${archive}" + $sudo apt-get -f install + else + $sudo dpkg -i "${archive}" + fi + + rm -f ${archive} +} + install_on_linux() { local msg local sudo @@ -235,7 +280,7 @@ install_on_linux() { install_on_arch_linux pamac elif has pikaur; then install_on_arch_linux pikaur - elif has dpkg; then + elif has apt; then case "${ARCH}" in x86_64) DEB_URL="$DEB_URL_AMD64" ;; aarch64) DEB_URL="$DEB_URL_AARCH64" ;; @@ -258,6 +303,8 @@ install_on_linux() { info "$msg" $sudo dpkg -i "${archive}" rm -f ${archive} + elif has dpkg; then + install_on_debian elif has brew; then install_with_brew else