chore: Use apt to install termscp on debian base to prevent broken deps

This commit is contained in:
Christian Visintin
2026-02-09 10:12:04 +01:00
parent b8115362f8
commit 4ca0865fe3
6 changed files with 61 additions and 10 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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