From ec053f7e6a5eb1cbcc2ffbc650add1376bd4ad05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=28=D0=A5?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D1=8B=D1=87=D0=AA=29=20=D0=A5=D1=80=D0=B0?= =?UTF-8?q?=D0=BC=D0=BE=D0=B2?= Date: Sun, 9 Feb 2025 12:44:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D1=81=D0=BA=D1=80=D0=B8?= =?UTF-8?q?=D0=BF=D1=82=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B2=D0=B8=D1=87=D0=BD?= =?UTF-8?q?=D0=BE=D0=B9=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=81=20=D1=83=D1=87=D1=91=D1=82=D0=BE=D0=BC=20ALT=20?= =?UTF-8?q?linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install.sh | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 59b87ca..1fd7a72 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,22 +1,3 @@ -# This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. -# It has been modified as part of "ALR - Any Linux Repository" by Евгений Храмов. -# -# ALR - Any Linux Repository -# Copyright (C) 2025 Евгений Храмов -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - info() { echo $'\x1b[32m[ИНФО]\x1b[0m' $@ } @@ -39,7 +20,7 @@ installPkg() { else warn "Не обнаружена команда повышения привилегий (например, sudo, doas)" fi - + case $1 in pacman) $rootCmd pacman --noconfirm -U ${@:2} ;; apk) $rootCmd apk add --allow-untrusted ${@:2} ;; @@ -78,6 +59,10 @@ elif command -v apk &>/dev/null; then info "Обнаружен apk" pkgFormat="apk" pkgMgr="apk" +elif command -v apt-get &>/dev/null; then + info "Обнаружен apt-get" + pkgFormat="rpm" + pkgMgr="apt-get" else warn "Не обнаружен поддерживаемый менеджер пакетов!" noPkgMgr=true @@ -98,7 +83,10 @@ if [ -z "$noPkgMgr" ]; then elif [ "$pkgMgr" == "apt" ]; then latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*.amd64.deb' | sort -V | tail -n 1) elif [[ "$pkgMgr" == "dnf" || "$pkgMgr" == "yum" || "$pkgMgr" == "zypper" ]]; then - latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*.x86_64.rpm' | sort -V | tail -n 1) + latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*\.x86_64\.rpm' | grep -v 'alt1' | sort -V | tail -n 1) + elif [[ "$pkgMgr" == "apt-get" ]]; then + latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*alt1.x86_64.rpm' | sort -V | tail -n 1) + else error "Не поддерживаемый менеджер пакетов для автоматической установки" fi