forked from Plemya-x/ALR
Compare commits
No commits in common. "469a05105ac7038f6bc099fb27f75630baa219e5" and "fff8b777fea80b9cfc5aef58a003afd5063d26c7" have entirely different histories.
469a05105a
...
fff8b777fe
@ -1,40 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build e2e
|
||||
|
||||
package e2etests_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/alecthomas/assert/v2"
|
||||
"github.com/efficientgo/e2e"
|
||||
)
|
||||
|
||||
func TestE2EBashCompletion(t *testing.T) {
|
||||
dockerMultipleRun(
|
||||
t,
|
||||
"bash-completion",
|
||||
COMMON_SYSTEMS,
|
||||
func(t *testing.T, r e2e.Runnable) {
|
||||
err := r.Exec(e2e.NewCommand(
|
||||
"alr", "install", "--generate-bash-completion",
|
||||
))
|
||||
assert.NoError(t, err)
|
||||
},
|
||||
)
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build e2e
|
||||
|
||||
package e2etests_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/alecthomas/assert/v2"
|
||||
"github.com/efficientgo/e2e"
|
||||
)
|
||||
|
||||
func TestE2EIssue32Interactive(t *testing.T) {
|
||||
dockerMultipleRun(
|
||||
t,
|
||||
"issue-32-interactive",
|
||||
COMMON_SYSTEMS,
|
||||
func(t *testing.T, r e2e.Runnable) {
|
||||
err := r.Exec(e2e.NewCommand(
|
||||
"alr", "--interactive=false", "remove", "ca-certificates",
|
||||
))
|
||||
assert.NoError(t, err)
|
||||
},
|
||||
)
|
||||
}
|
13
install.go
13
install.go
@ -124,14 +124,8 @@ func InstallCmd() *cli.Command {
|
||||
},
|
||||
BashComplete: func(c *cli.Context) {
|
||||
cfg := config.New()
|
||||
err := cfg.Load()
|
||||
if err != nil {
|
||||
slog.Error(gotext.Get("Error loading config"), "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
db := database.New(cfg)
|
||||
err = db.Init(c.Context)
|
||||
err := db.Init(c.Context)
|
||||
if err != nil {
|
||||
slog.Error(gotext.Get("Error initialization database"), "err", err)
|
||||
os.Exit(1)
|
||||
@ -175,10 +169,7 @@ func RemoveCmd() *cli.Command {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
err := mgr.Remove(&manager.Opts{
|
||||
AsRoot: true,
|
||||
NoConfirm: !c.Bool("interactive"),
|
||||
}, c.Args().Slice()...)
|
||||
err := mgr.Remove(nil, c.Args().Slice()...)
|
||||
if err != nil {
|
||||
slog.Error(gotext.Get("Error removing packages"), "err", err)
|
||||
os.Exit(1)
|
||||
|
@ -162,15 +162,15 @@ msgstr ""
|
||||
msgid "Command install expected at least 1 argument, got %d"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:163
|
||||
#: install.go:157
|
||||
msgid "Remove an installed package"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:168
|
||||
#: install.go:162
|
||||
msgid "Command remove expected at least 1 argument, got %d"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:183
|
||||
#: install.go:174
|
||||
msgid "Error removing packages"
|
||||
msgstr ""
|
||||
|
||||
|
@ -170,15 +170,15 @@ msgstr "Установить новый пакет"
|
||||
msgid "Command install expected at least 1 argument, got %d"
|
||||
msgstr "Для команды install ожидался хотя бы 1 аргумент, получено %d"
|
||||
|
||||
#: install.go:163
|
||||
#: install.go:157
|
||||
msgid "Remove an installed package"
|
||||
msgstr "Удалить установленный пакет"
|
||||
|
||||
#: install.go:168
|
||||
#: install.go:162
|
||||
msgid "Command remove expected at least 1 argument, got %d"
|
||||
msgstr "Для команды remove ожидался хотя бы 1 аргумент, получено %d"
|
||||
|
||||
#: install.go:183
|
||||
#: install.go:174
|
||||
msgid "Error removing packages"
|
||||
msgstr "Ошибка при удалении пакетов"
|
||||
|
||||
|
@ -97,15 +97,14 @@ if [ -z "$noPkgMgr" ]; then
|
||||
echo "Полученный список файлов:"
|
||||
echo "$fileList"
|
||||
|
||||
if [ "$pkgMgr" == "pacman" ]; then
|
||||
latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*\.pkg\.tar\.zst' | sort -V | tail -n 1)
|
||||
elif [ "$pkgMgr" == "apt" ]; then
|
||||
latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*\.amd64\.deb' | sort -V | tail -n 1)
|
||||
elif [ "$pkgMgr" == "apt-get" ]; then
|
||||
latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*-alt[0-9]+\.x86_64\.rpm' | 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)
|
||||
fi
|
||||
if [ "$pkgMgr" == "pacman" ]; then
|
||||
latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*.pkg.tar.zst' | sort -V | tail -n 1)
|
||||
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' | 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 "Не поддерживаемый менеджер пакетов для автоматической установки"
|
||||
|
Loading…
Reference in New Issue
Block a user