mirror of
https://github.com/veeso/termscp.git
synced 2026-06-08 14:18:41 +02:00
chore: Use apt to install termscp on debian base to prevent broken deps
This commit is contained in:
2
.github/workflows/build-artifacts.yml
vendored
2
.github/workflows/build-artifacts.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
|
|
||||||
runs-on: ${{ matrix.platform.os }}
|
runs-on: ${{ matrix.platform.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v6
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|||||||
14
.github/workflows/install.yml
vendored
14
.github/workflows/install.yml
vendored
@@ -11,13 +11,17 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v6
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt update && sudo apt install -y curl wget libsmbclient
|
|
||||||
- name: Install termscp from script
|
- name: Install termscp from script
|
||||||
run: |
|
run: |
|
||||||
./install.sh -v=0.12.3 -f
|
./install.sh -f
|
||||||
which termscp || exit 1
|
which termscp || exit 1
|
||||||
|
termscp --version
|
||||||
|
|||||||
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v6
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt update && sudo apt install -y libdbus-1-dev libsmbclient-dev
|
run: sudo apt update && sudo apt install -y libdbus-1-dev libsmbclient-dev
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|||||||
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v6
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|||||||
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v6
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|||||||
49
install.sh
49
install.sh
@@ -217,6 +217,51 @@ install_with_brew() {
|
|||||||
fi
|
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() {
|
install_on_linux() {
|
||||||
local msg
|
local msg
|
||||||
local sudo
|
local sudo
|
||||||
@@ -235,7 +280,7 @@ install_on_linux() {
|
|||||||
install_on_arch_linux pamac
|
install_on_arch_linux pamac
|
||||||
elif has pikaur; then
|
elif has pikaur; then
|
||||||
install_on_arch_linux pikaur
|
install_on_arch_linux pikaur
|
||||||
elif has dpkg; then
|
elif has apt; then
|
||||||
case "${ARCH}" in
|
case "${ARCH}" in
|
||||||
x86_64) DEB_URL="$DEB_URL_AMD64" ;;
|
x86_64) DEB_URL="$DEB_URL_AMD64" ;;
|
||||||
aarch64) DEB_URL="$DEB_URL_AARCH64" ;;
|
aarch64) DEB_URL="$DEB_URL_AARCH64" ;;
|
||||||
@@ -258,6 +303,8 @@ install_on_linux() {
|
|||||||
info "$msg"
|
info "$msg"
|
||||||
$sudo dpkg -i "${archive}"
|
$sudo dpkg -i "${archive}"
|
||||||
rm -f ${archive}
|
rm -f ${archive}
|
||||||
|
elif has dpkg; then
|
||||||
|
install_on_debian
|
||||||
elif has brew; then
|
elif has brew; then
|
||||||
install_with_brew
|
install_with_brew
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user