This commit is contained in:
2025-04-13 17:11:38 +03:00
parent a51a8ab963
commit 3603dc45a4
5 changed files with 73 additions and 64 deletions

View File

@ -74,39 +74,39 @@ msgstr ""
msgid "Attempt to fix problems with ALR"
msgstr ""
#: fix.go:42
#: fix.go:43
msgid "Can't drop privileges"
msgstr ""
#: fix.go:56
msgid "Removing cache directory"
#: fix.go:57
msgid "Clearing cache directory"
msgstr ""
#: fix.go:60
#: fix.go:62
msgid "Unable to open cache directory"
msgstr ""
#: fix.go:67
#: fix.go:69
msgid "Unable to read cache directory contents"
msgstr ""
#: fix.go:74
#: fix.go:76
msgid "Unable to remove cache item"
msgstr ""
#: fix.go:79
#: fix.go:81
msgid "Rebuilding cache"
msgstr ""
#: fix.go:83
#: fix.go:85
msgid "Unable to create new cache directory"
msgstr ""
#: fix.go:103
#: fix.go:105
msgid "Error pulling repos"
msgstr ""
#: fix.go:107
#: fix.go:109
msgid "Done"
msgstr ""
@ -316,7 +316,7 @@ msgid "ERROR"
msgstr ""
#: internal/utils/cmd.go:74
msgid "You need to be root"
msgid "You need to be root to perform this action"
msgstr ""
#: list.go:41
@ -435,31 +435,31 @@ msgstr ""
msgid "URL of the new repo"
msgstr ""
#: repo.go:89 repo.go:166
#: repo.go:92 repo.go:172
msgid "Error saving config"
msgstr ""
#: repo.go:119
#: repo.go:122
msgid "Remove an existing repository"
msgstr ""
#: repo.go:126
#: repo.go:129
msgid "Name of the repo to be deleted"
msgstr ""
#: repo.go:152
#: repo.go:158
msgid "Repo does not exist"
msgstr ""
#: repo.go:160
#: repo.go:166
msgid "Error removing repo directory"
msgstr ""
#: repo.go:177
#: repo.go:183
msgid "Error removing packages from database"
msgstr ""
#: repo.go:189
#: repo.go:195
msgid "Pull all repositories that have changed"
msgstr ""

View File

@ -84,42 +84,43 @@ msgstr "Ошибка при перемещении пакета"
msgid "Attempt to fix problems with ALR"
msgstr "Попытка устранить проблемы с ALR"
#: fix.go:42
#: fix.go:43
msgid "Can't drop privileges"
msgstr ""
#: fix.go:56
msgid "Removing cache directory"
#: fix.go:57
#, fuzzy
msgid "Clearing cache directory"
msgstr "Удаление каталога кэша"
#: fix.go:60
#: fix.go:62
#, fuzzy
msgid "Unable to open cache directory"
msgstr "Не удалось удалить каталог кэша"
#: fix.go:67
#: fix.go:69
#, fuzzy
msgid "Unable to read cache directory contents"
msgstr "Не удалось удалить каталог кэша"
#: fix.go:74
#: fix.go:76
#, fuzzy
msgid "Unable to remove cache item"
msgstr "Не удалось удалить каталог кэша"
#: fix.go:79
#: fix.go:81
msgid "Rebuilding cache"
msgstr "Восстановление кэша"
#: fix.go:83
#: fix.go:85
msgid "Unable to create new cache directory"
msgstr "Не удалось создать новый каталог кэша"
#: fix.go:103
#: fix.go:105
msgid "Error pulling repos"
msgstr "Ошибка при извлечении репозиториев"
#: fix.go:107
#: fix.go:109
msgid "Done"
msgstr "Сделано"
@ -330,7 +331,7 @@ msgid "ERROR"
msgstr "ОШИБКА"
#: internal/utils/cmd.go:74
msgid "You need to be root"
msgid "You need to be root to perform this action"
msgstr ""
#: list.go:41
@ -455,32 +456,32 @@ msgstr "Название нового репозитория"
msgid "URL of the new repo"
msgstr "URL-адрес нового репозитория"
#: repo.go:89 repo.go:166
#: repo.go:92 repo.go:172
#, fuzzy
msgid "Error saving config"
msgstr "Ошибка при кодировании конфигурации"
#: repo.go:119
#: repo.go:122
msgid "Remove an existing repository"
msgstr "Удалить существующий репозиторий"
#: repo.go:126
#: repo.go:129
msgid "Name of the repo to be deleted"
msgstr "Название репозитория удалён"
#: repo.go:152
#: repo.go:158
msgid "Repo does not exist"
msgstr "Репозитория не существует"
#: repo.go:160
#: repo.go:166
msgid "Error removing repo directory"
msgstr "Ошибка при удалении каталога репозитория"
#: repo.go:177
#: repo.go:183
msgid "Error removing packages from database"
msgstr "Ошибка при удалении пакетов из базы данных"
#: repo.go:189
#: repo.go:195
msgid "Pull all repositories that have changed"
msgstr "Скачать все изменённые репозитории"

View File

@ -17,13 +17,13 @@
package utils
import (
"log/slog"
"os"
"os/user"
"strconv"
"syscall"
"github.com/leonelquinteros/gotext"
"github.com/urfave/cli/v2"
)
func GetUidGidAlrUserString() (string, string, error) {
@ -69,9 +69,9 @@ func DropCapsToAlrUser() error {
return nil
}
func ExitIfNotRoot() {
func ExitIfNotRoot() error {
if os.Getuid() != 0 {
slog.Error(gotext.Get("You need to be root"))
os.Exit(1)
return cli.Exit(gotext.Get("You need to be root to perform this action"), 1)
}
return nil
}