Compare commits
	
		
			20 Commits
		
	
	
		
			v0.0.11
			...
			a785df1ec6
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| a785df1ec6 | |||
| 131f455eff | |||
| 1e52d30f4c | |||
| 40ec0ac6e1 | |||
| 443e481561 | |||
| c892310f69 | |||
| 750513b119 | |||
| ce1836b646 | |||
| 56b9f3211c | |||
| fae63e28f9 | |||
| c632ddb354 | |||
| 76234bf00d | |||
| f8c510ab9f | |||
| 849a08a791 | |||
| 952dd26f5f | |||
| 080c9f42ff | |||
| 3c3ee286ce | |||
| d0d8930491 | |||
| 93508647e0 | |||
| 6135e55f92 | 
							
								
								
									
										49
									
								
								.gitea/workflows/e2e-tests.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								.gitea/workflows/e2e-tests.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | |||||||
|  | # ALR - Any Linux Repository | ||||||
|  | # Copyright (C) 2025 The ALR Authors | ||||||
|  | # | ||||||
|  | # 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/>. | ||||||
|  |  | ||||||
|  | name: E2E | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: [ main ] | ||||||
|  |   pull_request: | ||||||
|  |  | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   tests: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |  | ||||||
|  |     container: | ||||||
|  |       image: altlinux.space/maks1ms/actions-container-runner:latest | ||||||
|  |  | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: https://github.com/actions/checkout@v4 | ||||||
|  |        | ||||||
|  |       - name: Set up Go | ||||||
|  |         uses: https://github.com/actions/setup-go@v5 | ||||||
|  |         with: | ||||||
|  |           go-version: '1.24' | ||||||
|  |  | ||||||
|  |       - name: Start Podman service | ||||||
|  |         run: nohup podman system service -t 0 unix:/tmp/podman.sock & | ||||||
|  |  | ||||||
|  |       - name: Run E2E tests | ||||||
|  |         env: | ||||||
|  |           DOCKER_HOST: unix:/tmp/podman.sock | ||||||
|  |           IGNORE_ROOT_CHECK: 1 | ||||||
|  |         run: | | ||||||
|  |           make e2e-test | ||||||
							
								
								
									
										49
									
								
								.gitea/workflows/pre-commit.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								.gitea/workflows/pre-commit.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | |||||||
|  | # ALR - Any Linux Repository | ||||||
|  | # Copyright (C) 2025 The ALR Authors | ||||||
|  | # | ||||||
|  | # 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/>. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | name: Pre-commit | ||||||
|  |  | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: [ main ] | ||||||
|  |   pull_request: | ||||||
|  |  | ||||||
|  |  | ||||||
|  | jobs: | ||||||
|  |   pre-commit: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |  | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout | ||||||
|  |         uses: https://github.com/actions/checkout@v4 | ||||||
|  |  | ||||||
|  |       - name: Set up Go | ||||||
|  |         uses: https://github.com/actions/setup-go@v5 | ||||||
|  |         with: | ||||||
|  |           go-version: '1.24' | ||||||
|  |        | ||||||
|  |       - name: Set up Python for pre-commit | ||||||
|  |         uses: https://github.com/actions/setup-python@v5 | ||||||
|  |         with: | ||||||
|  |           python-version: '3.12' | ||||||
|  |        | ||||||
|  |       - name: Install deps | ||||||
|  |         run: apt-get update && apt-get install -y gettext bc | ||||||
|  |  | ||||||
|  |       - run: pip install pre-commit | ||||||
|  |       - run: pre-commit install | ||||||
|  |       - run: pre-commit run --all-files | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| # ALR - Any Linux Repository | # ALR - Any Linux Repository | ||||||
| # Copyright (C) 2025 Евгений Храмов | # Copyright (C) 2025 The ALR Authors | ||||||
| # | # | ||||||
| # This program is free software: you can redistribute it and/or modify | # 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 | # it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
							
								
								
									
										118
									
								
								.goreleaser.yaml
									
									
									
									
									
								
							
							
						
						
									
										118
									
								
								.goreleaser.yaml
									
									
									
									
									
								
							| @@ -1,118 +0,0 @@ | |||||||
| # 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 <http://www.gnu.org/licenses/>. |  | ||||||
|  |  | ||||||
| before: |  | ||||||
|   hooks: |  | ||||||
|     - go mod tidy |  | ||||||
| builds: |  | ||||||
|   - id: alr |  | ||||||
|     env: |  | ||||||
|       - CGO_ENABLED=0 |  | ||||||
|     binary: alr |  | ||||||
|     ldflags: |  | ||||||
|       - -X gitea.plemya-x.ru/xpamych/ALR/src/branch/master/internal/config.Version={{.Version}} |  | ||||||
|     goos: |  | ||||||
|       - linux |  | ||||||
|     goarch: |  | ||||||
|       - amd64 |  | ||||||
|       - 386 |  | ||||||
|       - arm64 |  | ||||||
|       - arm |  | ||||||
|       - riscv64 |  | ||||||
| archives: |  | ||||||
|   - name_template: >- |  | ||||||
|       {{- .ProjectName}}- |  | ||||||
|       {{- .Version}}- |  | ||||||
|       {{- .Os}}- |  | ||||||
|       {{- if .Arch | eq "amd64"}}x86_64 |  | ||||||
|       {{- else if .Arch | eq "386"}}i386 |  | ||||||
|       {{- else if .Arch | eq "arm64"}}aarch64 |  | ||||||
|       {{- else }}{{ .Arch }}{{ end -}} |  | ||||||
|     files: |  | ||||||
|       - scripts/completion/* |  | ||||||
| nfpms: |  | ||||||
|   - id: alr |  | ||||||
|     package_name: linux-user-repository |  | ||||||
|     file_name_template: >- |  | ||||||
|       {{- .PackageName}}- |  | ||||||
|       {{- .Version}}- |  | ||||||
|       {{- .Os}}- |  | ||||||
|       {{- if .Arch | eq "amd64"}}x86_64 |  | ||||||
|       {{- else if .Arch | eq "386"}}i386 |  | ||||||
|       {{- else if .Arch | eq "arm64"}}aarch64 |  | ||||||
|       {{- else }}{{ .Arch }}{{ end -}} |  | ||||||
|     description: "Any Linux Repository" |  | ||||||
|     homepage: 'https://gitea.plemya-x.ru/xpamych/ALR' |  | ||||||
|     maintainer: 'Евгений Храмов <xpamych@yandex.ru>' |  | ||||||
|     license: GPLv3 |  | ||||||
|     formats: |  | ||||||
|       - apk |  | ||||||
|       - deb |  | ||||||
|       - rpm |  | ||||||
|       - archlinux |  | ||||||
|     provides: |  | ||||||
|       - linux-user-repository |  | ||||||
|     conflicts: |  | ||||||
|       - linux-user-repository |  | ||||||
|     recommends: |  | ||||||
|       - aria2 |  | ||||||
|     contents: |  | ||||||
|       - src: scripts/completion/bash |  | ||||||
|         dst: /usr/share/bash-completion/completions/alr |  | ||||||
|       - src: scripts/completion/zsh |  | ||||||
|         dst: /usr/share/zsh/site-functions/_alr |  | ||||||
| aurs: |  | ||||||
|   - name: linux-user-repository-bin |  | ||||||
|     homepage: 'https://gitea.plemya-x.ru/xpamych/ALR' |  | ||||||
|     description: "Any Linux Repository" |  | ||||||
|     maintainers: |  | ||||||
|       - 'Евгений Храмов <xpamych@yandex.ru>' |  | ||||||
|     license: GPLv3 |  | ||||||
|     private_key: '{{ .Env.AUR_KEY }}' |  | ||||||
|     git_url: 'ssh://aur@aur.archlinux.org/linux-user-repository-bin.git' |  | ||||||
|     provides: |  | ||||||
|       - alr |  | ||||||
|     conflicts: |  | ||||||
|       - alr |  | ||||||
|     depends: |  | ||||||
|       - sudo |  | ||||||
|       - pacman |  | ||||||
|     optdepends: |  | ||||||
|       - 'aria2: for downloading torrent sources' |  | ||||||
|     package: |- |  | ||||||
|       # binaries |  | ||||||
|       install -Dm755 ./alr "${pkgdir}/usr/bin/alr" |  | ||||||
|  |  | ||||||
|       # completions |  | ||||||
|       install -Dm755 ./scripts/completion/bash ${pkgdir}/usr/share/bash-completion/completions/alr |  | ||||||
|       install -Dm755 ./scripts/completion/zsh ${pkgdir}/usr/share/zsh/site-functions/_alr |  | ||||||
| release: |  | ||||||
|   gitea: |  | ||||||
|     owner: alr |  | ||||||
|     name: alr |  | ||||||
| gitea_urls: |  | ||||||
|   api: 'https://gitea.elara.ws/api/v1/' |  | ||||||
|   download: 'https://gitea.elara.ws' |  | ||||||
|   skip_tls_verify: false |  | ||||||
| checksum: |  | ||||||
|   name_template: 'checksums.txt' |  | ||||||
| snapshot: |  | ||||||
|   name_template: "{{ incpatch .Version }}-next" |  | ||||||
| changelog: |  | ||||||
|   sort: asc |  | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| # ALR - Any Linux Repository | # ALR - Any Linux Repository | ||||||
| # Copyright (C) 2025 Евгений Храмов | # Copyright (C) 2025 The ALR Authors | ||||||
| # | # | ||||||
| # This program is free software: you can redistribute it and/or modify | # 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 | # it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,28 +0,0 @@ | |||||||
| # 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 <http://www.gnu.org/licenses/>. |  | ||||||
|  |  | ||||||
| platform: linux/amd64 |  | ||||||
| pipeline: |  | ||||||
|   release: |  | ||||||
|     image: goreleaser/goreleaser |  | ||||||
|     commands: |  | ||||||
|       - goreleaser release |  | ||||||
|     secrets: [ gitea_token, aur_key ] |  | ||||||
|     when: |  | ||||||
|       event: tag |  | ||||||
							
								
								
									
										11
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Makefile
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | |||||||
| NAME := alr | NAME := alr | ||||||
| GIT_VERSION = $(shell git describe --tags ) | GIT_VERSION = $(shell git describe --tags ) | ||||||
|  | IGNORE_ROOT_CHECK ?= 0 | ||||||
| DESTDIR ?= | DESTDIR ?= | ||||||
| PREFIX ?= /usr/local | PREFIX ?= /usr/local | ||||||
| BIN := ./$(NAME) | BIN := ./$(NAME) | ||||||
| @@ -24,8 +24,9 @@ $(BIN): | |||||||
| 	go build -ldflags="-X 'gitea.plemya-x.ru/Plemya-x/ALR/internal/config.Version=$(GIT_VERSION)'" -o $@ | 	go build -ldflags="-X 'gitea.plemya-x.ru/Plemya-x/ALR/internal/config.Version=$(GIT_VERSION)'" -o $@ | ||||||
|  |  | ||||||
| check-no-root: | check-no-root: | ||||||
| 	@if [[ "$$(whoami)" == 'root' ]]; then \ | 	@if [[ "$(IGNORE_ROOT_CHECK)" != "1" ]] && [[ "$$(whoami)" == 'root' ]]; then \ | ||||||
| 		echo "This target shouldn't run as root" 1>&2; \ | 		echo "This target shouldn't run as root" 1>&2; \ | ||||||
|  | 		echo "Set IGNORE_ROOT_CHECK=1 to override" 1>&2; \ | ||||||
| 		exit 1; \ | 		exit 1; \ | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| @@ -54,7 +55,7 @@ uninstall: | |||||||
| clean clear: | clean clear: | ||||||
| 	rm -f $(BIN) | 	rm -f $(BIN) | ||||||
|  |  | ||||||
| OLD_FILES=$$(< old-files) | OLD_FILES=$(shell cat old-files) | ||||||
| IGNORE_OLD_FILES := $(foreach file,$(shell cat old-files),-ignore $(file)) | IGNORE_OLD_FILES := $(foreach file,$(shell cat old-files),-ignore $(file)) | ||||||
| update-license: | update-license: | ||||||
| 	$(ADD_LICENSE_BIN) -v -f license-header-old-files.tmpl $(OLD_FILES) | 	$(ADD_LICENSE_BIN) -v -f license-header-old-files.tmpl $(OLD_FILES) | ||||||
| @@ -76,7 +77,9 @@ test-coverage: | |||||||
| update-deps-cve: | update-deps-cve: | ||||||
| 	bash scripts/update-deps-cve.sh | 	bash scripts/update-deps-cve.sh | ||||||
|  |  | ||||||
| e2e-test: clean build | prepare-for-e2e-test: clean build | ||||||
| 	rm -f ./e2e-tests/alr | 	rm -f ./e2e-tests/alr | ||||||
| 	cp alr e2e-tests | 	cp alr e2e-tests | ||||||
|  |  | ||||||
|  | e2e-test: prepare-for-e2e-test | ||||||
| 	go test -tags=e2e ./... | 	go test -tags=e2e ./... | ||||||
| @@ -11,7 +11,7 @@ | |||||||
|     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> |     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> | ||||||
|         <text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text> |         <text x="33.5" y="15" fill="#010101" fill-opacity=".3">coverage</text> | ||||||
|         <text x="33.5" y="14">coverage</text> |         <text x="33.5" y="14">coverage</text> | ||||||
|         <text x="86" y="15" fill="#010101" fill-opacity=".3">16.4%</text> |         <text x="86" y="15" fill="#010101" fill-opacity=".3">17.0%</text> | ||||||
|         <text x="86" y="14">16.4%</text> |         <text x="86" y="14">17.0%</text> | ||||||
|     </g> |     </g> | ||||||
| </svg> | </svg> | ||||||
|   | |||||||
| Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B | 
| @@ -12,7 +12,7 @@ | |||||||
|     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> |     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> | ||||||
|         <text x="37" y="15" fill="#010101" fill-opacity=".3">ru translate</text> |         <text x="37" y="15" fill="#010101" fill-opacity=".3">ru translate</text> | ||||||
|         <text x="37" y="14">ru translate</text> |         <text x="37" y="14">ru translate</text> | ||||||
|         <text x="100" y="15" fill="#010101" fill-opacity=".3">100.00%</text> |         <text x="100" y="15" fill="#010101" fill-opacity=".3">96.00%</text> | ||||||
|         <text x="100" y="14">100.00%</text> |         <text x="100" y="14">96.00%</text> | ||||||
|     </g> |     </g> | ||||||
| </svg> | </svg> | ||||||
|   | |||||||
| Before Width: | Height: | Size: 942 B After Width: | Height: | Size: 940 B | 
							
								
								
									
										10
									
								
								build.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								build.go
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -118,7 +118,11 @@ func BuildCmd() *cli.Command { | |||||||
| 					return cliutils.FormatCliExit(gotext.Get("Cannot get absolute script path"), err) | 					return cliutils.FormatCliExit(gotext.Get("Cannot get absolute script path"), err) | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				packages = append(packages, c.String("script-package")) | 				subpackage := c.String("subpackage") | ||||||
|  |  | ||||||
|  | 				if subpackage != "" { | ||||||
|  | 					packages = append(packages, subpackage) | ||||||
|  | 				} | ||||||
|  |  | ||||||
| 				scriptArgs = &build.BuildPackageFromScriptArgs{ | 				scriptArgs = &build.BuildPackageFromScriptArgs{ | ||||||
| 					Script:    script, | 					Script:    script, | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -175,6 +175,11 @@ func dockerMultipleRun(t *testing.T, name string, ids []string, f func(t *testin | |||||||
| 	}) | 	}) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | func simpleExec(t *testing.T, r e2e.Runnable, cmd string, args ...string) { | ||||||
|  | 	err := r.Exec(e2e.NewCommand(cmd, args...)) | ||||||
|  | 	assert.NoError(t, err) | ||||||
|  | } | ||||||
|  |  | ||||||
| func runTestCommands(t *testing.T, r e2e.Runnable, timeout time.Duration, expects []expect.Batcher) { | func runTestCommands(t *testing.T, r e2e.Runnable, timeout time.Duration, expects []expect.Batcher) { | ||||||
| 	exp, _, err, _ := e2eSpawn( | 	exp, _, err, _ := e2eSpawn( | ||||||
| 		r, | 		r, | ||||||
| @@ -188,3 +193,5 @@ func runTestCommands(t *testing.T, r e2e.Runnable, timeout time.Duration, expect | |||||||
| 	) | 	) | ||||||
| 	assert.NoError(t, err) | 	assert.NoError(t, err) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | const REPO_FOR_E2E_TESTS = "https://gitea.plemya-x.ru/Maks1mS/repo-for-tests.git" | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
							
								
								
									
										51
									
								
								e2e-tests/issue_72_install_with_deps_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								e2e-tests/issue_72_install_with_deps_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,51 @@ | |||||||
|  | // ALR - Any Linux Repository | ||||||
|  | // Copyright (C) 2025 The ALR Authors | ||||||
|  | // | ||||||
|  | // 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 TestE2EIssue72InstallWithDeps(t *testing.T) { | ||||||
|  | 	dockerMultipleRun( | ||||||
|  | 		t, | ||||||
|  | 		"issue-72-install-with-deps", | ||||||
|  | 		COMMON_SYSTEMS, | ||||||
|  | 		func(t *testing.T, r e2e.Runnable) { | ||||||
|  | 			err := r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", | ||||||
|  | 				"alr", | ||||||
|  | 				"addrepo", | ||||||
|  | 				"--name", | ||||||
|  | 				"alr-repo", | ||||||
|  | 				"--url", | ||||||
|  | 				"https://gitea.plemya-x.ru/Maks1mS/repo-for-tests.git", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 			err = r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", "alr", "in", "test-app-with-lib", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  | 		}, | ||||||
|  | 	) | ||||||
|  | } | ||||||
							
								
								
									
										50
									
								
								e2e-tests/issue_74_upgradable_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								e2e-tests/issue_74_upgradable_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | |||||||
|  | // ALR - Any Linux Repository | ||||||
|  | // Copyright (C) 2025 The ALR Authors | ||||||
|  | // | ||||||
|  | // 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/efficientgo/e2e" | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | func TestE2EIssue74Upgradable(t *testing.T) { | ||||||
|  | 	dockerMultipleRun( | ||||||
|  | 		t, | ||||||
|  | 		"issue-74-upgradable", | ||||||
|  | 		COMMON_SYSTEMS, | ||||||
|  | 		func(t *testing.T, r e2e.Runnable) { | ||||||
|  | 			simpleExec(t, r, "sudo", | ||||||
|  | 				"alr", | ||||||
|  | 				"addrepo", | ||||||
|  | 				"--name", | ||||||
|  | 				"alr-repo", | ||||||
|  | 				"--url", | ||||||
|  | 				REPO_FOR_E2E_TESTS, | ||||||
|  | 			) | ||||||
|  | 			simpleExec(t, r, "sudo", "sh", "-c", "sed -i 's/ref = .*/ref = \"bd26236cd7\"/' /etc/alr/alr.toml") | ||||||
|  | 			simpleExec(t, r, "alr", "ref") | ||||||
|  | 			simpleExec(t, r, "sudo", "alr", "in", "bar-pkg") | ||||||
|  | 			simpleExec(t, r, "sh", "-c", "test $(alr list -U | wc -l) -eq 0 || exit 1") | ||||||
|  | 			simpleExec(t, r, "sudo", "sh", "-c", "sed -i 's/ref = .*/ref = \"d9a3541561\"/' /etc/alr/alr.toml") | ||||||
|  | 			simpleExec(t, r, "sudo", "alr", "ref") | ||||||
|  | 			simpleExec(t, r, "sh", "-c", "test $(alr list -U | wc -l) -eq 1 || exit 1") | ||||||
|  | 		}, | ||||||
|  | 	) | ||||||
|  | } | ||||||
							
								
								
									
										62
									
								
								e2e-tests/issue_75_ref_specify_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								e2e-tests/issue_75_ref_specify_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,62 @@ | |||||||
|  | // ALR - Any Linux Repository | ||||||
|  | // Copyright (C) 2025 The ALR Authors | ||||||
|  | // | ||||||
|  | // 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 TestE2EIssue75InstallWithDeps(t *testing.T) { | ||||||
|  | 	dockerMultipleRun( | ||||||
|  | 		t, | ||||||
|  | 		"issue-75-ref-specify", | ||||||
|  | 		COMMON_SYSTEMS, | ||||||
|  | 		func(t *testing.T, r e2e.Runnable) { | ||||||
|  | 			err := r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", | ||||||
|  | 				"alr", | ||||||
|  | 				"addrepo", | ||||||
|  | 				"--name", | ||||||
|  | 				"alr-repo", | ||||||
|  | 				"--url", | ||||||
|  | 				"https://gitea.plemya-x.ru/Maks1mS/repo-for-tests.git", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 			err = r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", "alr", "ref", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 			// TODO: replace with alr command when it be added | ||||||
|  | 			err = r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", "sh", "-c", "sed -i 's/ref = .*/ref = \"bd26236cd7\"/' /etc/alr/alr.toml", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 			err = r.Exec(e2e.NewCommand( | ||||||
|  | 				"sh", "-c", "test $(alr list | wc -l) -eq 2 || exit 1", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  | 		}, | ||||||
|  | 	) | ||||||
|  | } | ||||||
							
								
								
									
										59
									
								
								e2e-tests/issue_81_multiple_packages_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								e2e-tests/issue_81_multiple_packages_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | |||||||
|  | // ALR - Any Linux Repository | ||||||
|  | // Copyright (C) 2025 The ALR Authors | ||||||
|  | // | ||||||
|  | // 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/efficientgo/e2e" | ||||||
|  | 	"github.com/stretchr/testify/assert" | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | func TestE2EIssue81MultiplePackages(t *testing.T) { | ||||||
|  | 	dockerMultipleRun( | ||||||
|  | 		t, | ||||||
|  | 		"issue-81-multiple-packages", | ||||||
|  | 		COMMON_SYSTEMS, | ||||||
|  | 		func(t *testing.T, r e2e.Runnable) { | ||||||
|  | 			err := r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", | ||||||
|  | 				"alr", | ||||||
|  | 				"addrepo", | ||||||
|  | 				"--name", | ||||||
|  | 				"alr-repo", | ||||||
|  | 				"--url", | ||||||
|  | 				REPO_FOR_E2E_TESTS, | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 			err = r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", "alr", "ref", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 			err = r.Exec(e2e.NewCommand( | ||||||
|  | 				"sudo", "alr", "in", "first-package-with-dashes", | ||||||
|  | 			)) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  |  | ||||||
|  | 			err = r.Exec(e2e.NewCommand("cat", "/opt/first-package")) | ||||||
|  | 			assert.NoError(t, err) | ||||||
|  | 		}, | ||||||
|  | 	) | ||||||
|  | } | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								fix.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								fix.go
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								gen.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								gen.go
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								info.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								info.go
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
							
								
								
									
										22
									
								
								install.go
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								install.go
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -46,11 +46,7 @@ func InstallCmd() *cli.Command { | |||||||
| 				Usage:   gotext.Get("Build package from scratch even if there's an already built package available"), | 				Usage:   gotext.Get("Build package from scratch even if there's an already built package available"), | ||||||
| 			}, | 			}, | ||||||
| 		}, | 		}, | ||||||
| 		Action: func(c *cli.Context) error { | 		Action: utils.RootNeededAction(func(c *cli.Context) error { | ||||||
| 			if err := utils.ExitIfNotRoot(); err != nil { |  | ||||||
| 				return err |  | ||||||
| 			} |  | ||||||
|  |  | ||||||
| 			args := c.Args() | 			args := c.Args() | ||||||
| 			if args.Len() < 1 { | 			if args.Len() < 1 { | ||||||
| 				return cliutils.FormatCliExit(gotext.Get("Command install expected at least 1 argument, got %d", args.Len()), nil) | 				return cliutils.FormatCliExit(gotext.Get("Command install expected at least 1 argument, got %d", args.Len()), nil) | ||||||
| @@ -115,11 +111,11 @@ func InstallCmd() *cli.Command { | |||||||
| 				args.Slice(), | 				args.Slice(), | ||||||
| 			) | 			) | ||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				return cliutils.FormatCliExit(gotext.Get("Error parsing os release"), err) | 				return cliutils.FormatCliExit(gotext.Get("Error when installing the package"), err) | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			return nil | 			return nil | ||||||
| 		}, | 		}), | ||||||
| 		BashComplete: cliutils.BashCompleteWithError(func(c *cli.Context) error { | 		BashComplete: cliutils.BashCompleteWithError(func(c *cli.Context) error { | ||||||
| 			if err := utils.ExitIfCantDropCapsToAlrUser(); err != nil { | 			if err := utils.ExitIfCantDropCapsToAlrUser(); err != nil { | ||||||
| 				return err | 				return err | ||||||
| @@ -213,11 +209,7 @@ func RemoveCmd() *cli.Command { | |||||||
|  |  | ||||||
| 			return nil | 			return nil | ||||||
| 		}), | 		}), | ||||||
| 		Action: func(c *cli.Context) error { | 		Action: utils.RootNeededAction(func(c *cli.Context) error { | ||||||
| 			if err := utils.ExitIfNotRoot(); err != nil { |  | ||||||
| 				return err |  | ||||||
| 			} |  | ||||||
|  |  | ||||||
| 			args := c.Args() | 			args := c.Args() | ||||||
| 			if args.Len() < 1 { | 			if args.Len() < 1 { | ||||||
| 				return cliutils.FormatCliExit(gotext.Get("Command remove expected at least 1 argument, got %d", args.Len()), nil) | 				return cliutils.FormatCliExit(gotext.Get("Command remove expected at least 1 argument, got %d", args.Len()), nil) | ||||||
| @@ -239,6 +231,6 @@ func RemoveCmd() *cli.Command { | |||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			return nil | 			return nil | ||||||
| 		}, | 		}), | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -21,6 +21,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"log/slog" | 	"log/slog" | ||||||
|  |  | ||||||
|  | 	"github.com/leonelquinteros/gotext" | ||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| @@ -61,3 +62,11 @@ func FormatCliExitWithCode(msg string, err error, exitCode int) cli.ExitCoder { | |||||||
| 	} | 	} | ||||||
| 	return cli.Exit(fmt.Errorf("%s: %w", msg, err), exitCode) | 	return cli.Exit(fmt.Errorf("%s: %w", msg, err), exitCode) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | func WarnLegacyCommand(newSyntax string) { | ||||||
|  | 	slog.Warn( | ||||||
|  | 		gotext.Get( | ||||||
|  | 			"This command is deprecated and would be removed in the future, use \"%s\" instead!", newSyntax, | ||||||
|  | 		), | ||||||
|  | 	) | ||||||
|  | } | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -39,6 +39,7 @@ type ALRConfig struct { | |||||||
|  |  | ||||||
| var defaultConfig = &types.Config{ | var defaultConfig = &types.Config{ | ||||||
| 	RootCmd:          "sudo", | 	RootCmd:          "sudo", | ||||||
|  | 	UseRootCmd:       true, | ||||||
| 	PagerStyle:       "native", | 	PagerStyle:       "native", | ||||||
| 	IgnorePkgUpdates: []string{}, | 	IgnorePkgUpdates: []string{}, | ||||||
| 	AutoPull:         true, | 	AutoPull:         true, | ||||||
| @@ -142,6 +143,10 @@ func (c *ALRConfig) LogLevel() string { | |||||||
| 	return c.cfg.LogLevel | 	return c.cfg.LogLevel | ||||||
| } | } | ||||||
|  |  | ||||||
|  | func (c *ALRConfig) UseRootCmd() bool { | ||||||
|  | 	return c.cfg.UseRootCmd | ||||||
|  | } | ||||||
|  |  | ||||||
| func (c *ALRConfig) GetPaths() *Paths { | func (c *ALRConfig) GetPaths() *Paths { | ||||||
| 	return c.paths | 	return c.paths | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -104,7 +104,7 @@ func Resolve(info *distro.OSRelease, opts *Opts) ([]string, error) { | |||||||
| 	out = append(out, opts.Name) | 	out = append(out, opts.Name) | ||||||
|  |  | ||||||
| 	for index, item := range out { | 	for index, item := range out { | ||||||
| 		out[index] = strings.TrimPrefix(strings.ReplaceAll(item, "-", "_"), "_") | 		out[index] = strings.TrimPrefix(item, "_") | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return out, nil | 	return out, nil | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -38,23 +38,23 @@ msgstr "" | |||||||
| msgid "Cannot get absolute script path" | msgid "Cannot get absolute script path" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: build.go:148 | #: build.go:152 | ||||||
| msgid "Package not found" | msgid "Package not found" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: build.go:161 | #: build.go:165 | ||||||
| msgid "Nothing to build" | msgid "Nothing to build" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: build.go:218 | #: build.go:222 | ||||||
| msgid "Error building package" | msgid "Error building package" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: build.go:225 | #: build.go:229 | ||||||
| msgid "Error moving the package" | msgid "Error moving the package" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: build.go:229 | #: build.go:233 | ||||||
| msgid "Done" | msgid "Done" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| @@ -154,27 +154,27 @@ msgstr "" | |||||||
| msgid "Install a new package" | msgid "Install a new package" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: install.go:56 | #: install.go:52 | ||||||
| msgid "Command install expected at least 1 argument, got %d" | msgid "Command install expected at least 1 argument, got %d" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: install.go:118 | #: install.go:114 | ||||||
| msgid "Error parsing os release" | msgid "Error when installing the package" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: install.go:163 | #: install.go:159 | ||||||
| msgid "Remove an installed package" | msgid "Remove an installed package" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: install.go:182 | #: install.go:178 | ||||||
| msgid "Error listing installed packages" | msgid "Error listing installed packages" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: install.go:223 | #: install.go:215 | ||||||
| msgid "Command remove expected at least 1 argument, got %d" | msgid "Command remove expected at least 1 argument, got %d" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: install.go:238 | #: install.go:230 | ||||||
| msgid "Error removing packages" | msgid "Error removing packages" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| @@ -190,6 +190,10 @@ msgstr "" | |||||||
| msgid "Error pulling repositories" | msgid "Error pulling repositories" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | #: internal/cliutils/app_builder/builder.go:152 | ||||||
|  | msgid "Error parsing os release" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| #: internal/cliutils/app_builder/builder.go:165 | #: internal/cliutils/app_builder/builder.go:165 | ||||||
| msgid "Unable to detect a supported package manager on the system" | msgid "Unable to detect a supported package manager on the system" | ||||||
| msgstr "" | msgstr "" | ||||||
| @@ -274,6 +278,12 @@ msgstr "" | |||||||
| msgid "OPTIONS" | msgid "OPTIONS" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | #: internal/cliutils/utils.go:69 | ||||||
|  | msgid "" | ||||||
|  | "This command is deprecated and would be removed in the future, use \"%s\" " | ||||||
|  | "instead!" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| #: internal/db/db.go:137 | #: internal/db/db.go:137 | ||||||
| msgid "Database version mismatch; resetting" | msgid "Database version mismatch; resetting" | ||||||
| msgstr "" | msgstr "" | ||||||
| @@ -311,22 +321,42 @@ msgstr "" | |||||||
| msgid "ERROR" | msgid "ERROR" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: internal/utils/cmd.go:95 | #: internal/utils/cmd.go:97 | ||||||
| msgid "Error on dropping capabilities" | msgid "Error on dropping capabilities" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: internal/utils/cmd.go:123 | #: internal/utils/cmd.go:164 | ||||||
| msgid "You need to be root to perform this action" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: internal/utils/cmd.go:165 |  | ||||||
| msgid "You need to be a %s member to perform this action" | msgid "You need to be a %s member to perform this action" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: list.go:41 | #: internal/utils/cmd.go:200 | ||||||
|  | msgid "You need to be root to perform this action" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: list.go:43 | ||||||
| msgid "List ALR repo packages" | msgid "List ALR repo packages" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | #: list.go:57 | ||||||
|  | msgid "Format output using a Go template" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: list.go:89 | ||||||
|  | msgid "Error getting packages for upgrade" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: list.go:92 | ||||||
|  | msgid "No packages for upgrade" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: list.go:102 list.go:187 | ||||||
|  | msgid "Error parsing format template" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: list.go:108 list.go:191 | ||||||
|  | msgid "Error executing template" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| #: main.go:45 | #: main.go:45 | ||||||
| msgid "Print the current ALR version and exit" | msgid "Print the current ALR version and exit" | ||||||
| msgstr "" | msgstr "" | ||||||
| @@ -339,11 +369,11 @@ msgstr "" | |||||||
| msgid "Enable interactive questions and prompts" | msgid "Enable interactive questions and prompts" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: main.go:145 | #: main.go:146 | ||||||
| msgid "Show help" | msgid "Show help" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: main.go:149 | #: main.go:150 | ||||||
| msgid "Error while running app" | msgid "Error while running app" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| @@ -393,82 +423,94 @@ msgstr "" | |||||||
| msgid "AutoReq is not implemented for this package format, so it's skipped" | msgid "AutoReq is not implemented for this package format, so it's skipped" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:237 | #: pkg/build/script_executor.go:241 | ||||||
| msgid "Building package metadata" | msgid "Building package metadata" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:368 | #: pkg/build/script_executor.go:372 | ||||||
| msgid "Executing prepare()" | msgid "Executing prepare()" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:377 | #: pkg/build/script_executor.go:381 | ||||||
| msgid "Executing build()" | msgid "Executing build()" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:406 pkg/build/script_executor.go:426 | #: pkg/build/script_executor.go:410 pkg/build/script_executor.go:430 | ||||||
| msgid "Executing %s()" | msgid "Executing %s()" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:79 | #: pkg/repos/pull.go:77 | ||||||
| msgid "Pulling repository" | msgid "Pulling repository" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:103 | #: pkg/repos/pull.go:113 | ||||||
| msgid "Repository up to date" | msgid "Repository up to date" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:160 | #: pkg/repos/pull.go:204 | ||||||
| msgid "Git repository does not appear to be a valid ALR repo" | msgid "Git repository does not appear to be a valid ALR repo" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:176 | #: pkg/repos/pull.go:220 | ||||||
| msgid "" | msgid "" | ||||||
| "ALR repo's minimum ALR version is greater than the current version. Try " | "ALR repo's minimum ALR version is greater than the current version. Try " | ||||||
| "updating ALR if something doesn't work." | "updating ALR if something doesn't work." | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | #: refresh.go:30 | ||||||
|  | msgid "Pull all repositories that have changed" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:39 | #: repo.go:39 | ||||||
| msgid "Add a new repository" | msgid "Manage repos" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:46 | #: repo.go:50 repo.go:220 | ||||||
| msgid "Name of the new repo" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: repo.go:52 |  | ||||||
| msgid "URL of the new repo" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: repo.go:79 |  | ||||||
| msgid "Repo \"%s\" already exists" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: repo.go:90 repo.go:167 |  | ||||||
| msgid "Error saving config" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: repo.go:116 |  | ||||||
| msgid "Remove an existing repository" | msgid "Remove an existing repository" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:123 | #: repo.go:52 | ||||||
| msgid "Name of the repo to be deleted" | msgid "<name>" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:156 | #: repo.go:82 | ||||||
| msgid "Repo \"%s\" does not exist" | msgid "Repo \"%s\" does not exist" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:163 | #: repo.go:89 | ||||||
| msgid "Error removing repo directory" | msgid "Error removing repo directory" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:186 | #: repo.go:93 repo.go:160 | ||||||
|  | msgid "Error saving config" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: repo.go:112 | ||||||
| msgid "Error removing packages from database" | msgid "Error removing packages from database" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
|  | #: repo.go:123 repo.go:190 | ||||||
|  | msgid "Add a new repository" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: repo.go:124 | ||||||
|  | msgid "<name> <url>" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: repo.go:149 | ||||||
|  | msgid "Repo \"%s\" already exists" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:197 | #: repo.go:197 | ||||||
| msgid "Pull all repositories that have changed" | msgid "Name of the new repo" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: repo.go:203 | ||||||
|  | msgid "URL of the new repo" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: repo.go:227 | ||||||
|  | msgid "Name of the repo to be deleted" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: search.go:40 | #: search.go:40 | ||||||
| @@ -491,30 +533,18 @@ msgstr "" | |||||||
| msgid "Search by provides" | msgid "Search by provides" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: search.go:71 |  | ||||||
| msgid "Format output using a Go template" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: search.go:130 | #: search.go:130 | ||||||
| msgid "Error while executing search" | msgid "Error while executing search" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: search.go:138 |  | ||||||
| msgid "Error parsing format template" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: search.go:153 |  | ||||||
| msgid "Error executing template" |  | ||||||
| msgstr "" |  | ||||||
|  |  | ||||||
| #: upgrade.go:47 | #: upgrade.go:47 | ||||||
| msgid "Upgrade all installed packages" | msgid "Upgrade all installed packages" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: upgrade.go:109 upgrade.go:126 | #: upgrade.go:105 upgrade.go:122 | ||||||
| msgid "Error checking for updates" | msgid "Error checking for updates" | ||||||
| msgstr "" | msgstr "" | ||||||
|  |  | ||||||
| #: upgrade.go:129 | #: upgrade.go:125 | ||||||
| msgid "There is nothing to do." | msgid "There is nothing to do." | ||||||
| msgstr "" | msgstr "" | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ | |||||||
| msgid "" | msgid "" | ||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: unnamed project\n" | "Project-Id-Version: unnamed project\n" | ||||||
| "PO-Revision-Date: 2025-04-18 07:38+0300\n" | "PO-Revision-Date: 2025-05-13 23:24+0300\n" | ||||||
| "Last-Translator: Maxim Slipenko <maks1ms@alt-gnome.ru>\n" | "Last-Translator: Maxim Slipenko <maks1ms@alt-gnome.ru>\n" | ||||||
| "Language-Team: Russian\n" | "Language-Team: Russian\n" | ||||||
| "Language: ru\n" | "Language: ru\n" | ||||||
| @@ -45,23 +45,23 @@ msgstr "Ошибка при получении рабочего каталога | |||||||
| msgid "Cannot get absolute script path" | msgid "Cannot get absolute script path" | ||||||
| msgstr "Невозможно получить абсолютный путь к скрипту" | msgstr "Невозможно получить абсолютный путь к скрипту" | ||||||
|  |  | ||||||
| #: build.go:148 | #: build.go:152 | ||||||
| msgid "Package not found" | msgid "Package not found" | ||||||
| msgstr "Пакет не найден" | msgstr "Пакет не найден" | ||||||
|  |  | ||||||
| #: build.go:161 | #: build.go:165 | ||||||
| msgid "Nothing to build" | msgid "Nothing to build" | ||||||
| msgstr "Нечего собирать" | msgstr "Нечего собирать" | ||||||
|  |  | ||||||
| #: build.go:218 | #: build.go:222 | ||||||
| msgid "Error building package" | msgid "Error building package" | ||||||
| msgstr "Ошибка при сборке пакета" | msgstr "Ошибка при сборке пакета" | ||||||
|  |  | ||||||
| #: build.go:225 | #: build.go:229 | ||||||
| msgid "Error moving the package" | msgid "Error moving the package" | ||||||
| msgstr "Ошибка при перемещении пакета" | msgstr "Ошибка при перемещении пакета" | ||||||
|  |  | ||||||
| #: build.go:229 | #: build.go:233 | ||||||
| msgid "Done" | msgid "Done" | ||||||
| msgstr "Сделано" | msgstr "Сделано" | ||||||
|  |  | ||||||
| @@ -161,27 +161,27 @@ msgstr "Ошибка кодирования переменных скрита" | |||||||
| msgid "Install a new package" | msgid "Install a new package" | ||||||
| msgstr "Установить новый пакет" | msgstr "Установить новый пакет" | ||||||
|  |  | ||||||
| #: install.go:56 | #: install.go:52 | ||||||
| msgid "Command install expected at least 1 argument, got %d" | msgid "Command install expected at least 1 argument, got %d" | ||||||
| msgstr "Для команды install ожидался хотя бы 1 аргумент, получено %d" | msgstr "Для команды install ожидался хотя бы 1 аргумент, получено %d" | ||||||
|  |  | ||||||
| #: install.go:118 | #: install.go:114 | ||||||
| msgid "Error parsing os release" | msgid "Error when installing the package" | ||||||
| msgstr "Ошибка при разборе файла выпуска операционной системы" | msgstr "Ошибка при установке пакета" | ||||||
|  |  | ||||||
| #: install.go:163 | #: install.go:159 | ||||||
| msgid "Remove an installed package" | msgid "Remove an installed package" | ||||||
| msgstr "Удалить установленный пакет" | msgstr "Удалить установленный пакет" | ||||||
|  |  | ||||||
| #: install.go:182 | #: install.go:178 | ||||||
| msgid "Error listing installed packages" | msgid "Error listing installed packages" | ||||||
| msgstr "Ошибка при составлении списка установленных пакетов" | msgstr "Ошибка при составлении списка установленных пакетов" | ||||||
|  |  | ||||||
| #: install.go:223 | #: install.go:215 | ||||||
| msgid "Command remove expected at least 1 argument, got %d" | msgid "Command remove expected at least 1 argument, got %d" | ||||||
| msgstr "Для команды remove ожидался хотя бы 1 аргумент, получено %d" | msgstr "Для команды remove ожидался хотя бы 1 аргумент, получено %d" | ||||||
|  |  | ||||||
| #: install.go:238 | #: install.go:230 | ||||||
| msgid "Error removing packages" | msgid "Error removing packages" | ||||||
| msgstr "Ошибка при удалении пакетов" | msgstr "Ошибка при удалении пакетов" | ||||||
|  |  | ||||||
| @@ -197,6 +197,10 @@ msgstr "Ошибка инициализации базы данных" | |||||||
| msgid "Error pulling repositories" | msgid "Error pulling repositories" | ||||||
| msgstr "Ошибка при извлечении репозиториев" | msgstr "Ошибка при извлечении репозиториев" | ||||||
|  |  | ||||||
|  | #: internal/cliutils/app_builder/builder.go:152 | ||||||
|  | msgid "Error parsing os release" | ||||||
|  | msgstr "Ошибка при разборе файла выпуска операционной системы" | ||||||
|  |  | ||||||
| #: internal/cliutils/app_builder/builder.go:165 | #: internal/cliutils/app_builder/builder.go:165 | ||||||
| msgid "Unable to detect a supported package manager on the system" | msgid "Unable to detect a supported package manager on the system" | ||||||
| msgstr "Не удалось обнаружить поддерживаемый менеджер пакетов в системе" | msgstr "Не удалось обнаружить поддерживаемый менеджер пакетов в системе" | ||||||
| @@ -281,6 +285,12 @@ msgstr "КАТЕГОРИЯ" | |||||||
| msgid "OPTIONS" | msgid "OPTIONS" | ||||||
| msgstr "ПАРАМЕТРЫ" | msgstr "ПАРАМЕТРЫ" | ||||||
|  |  | ||||||
|  | #: internal/cliutils/utils.go:69 | ||||||
|  | msgid "" | ||||||
|  | "This command is deprecated and would be removed in the future, use \"%s\" " | ||||||
|  | "instead!" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
| #: internal/db/db.go:137 | #: internal/db/db.go:137 | ||||||
| msgid "Database version mismatch; resetting" | msgid "Database version mismatch; resetting" | ||||||
| msgstr "Несоответствие версий базы данных; сброс настроек" | msgstr "Несоответствие версий базы данных; сброс настроек" | ||||||
| @@ -319,22 +329,42 @@ msgstr "%s %s загружается — %s/с\n" | |||||||
| msgid "ERROR" | msgid "ERROR" | ||||||
| msgstr "ОШИБКА" | msgstr "ОШИБКА" | ||||||
|  |  | ||||||
| #: internal/utils/cmd.go:95 | #: internal/utils/cmd.go:97 | ||||||
| msgid "Error on dropping capabilities" | msgid "Error on dropping capabilities" | ||||||
| msgstr "Ошибка при понижении привилегий" | msgstr "Ошибка при понижении привилегий" | ||||||
|  |  | ||||||
| #: internal/utils/cmd.go:123 | #: internal/utils/cmd.go:164 | ||||||
| msgid "You need to be root to perform this action" |  | ||||||
| msgstr "Вы должны быть root чтобы выполнить это" |  | ||||||
|  |  | ||||||
| #: internal/utils/cmd.go:165 |  | ||||||
| msgid "You need to be a %s member to perform this action" | msgid "You need to be a %s member to perform this action" | ||||||
| msgstr "Вы должны быть членом %s чтобы выполнить это" | msgstr "Вы должны быть членом %s чтобы выполнить это" | ||||||
|  |  | ||||||
| #: list.go:41 | #: internal/utils/cmd.go:200 | ||||||
|  | msgid "You need to be root to perform this action" | ||||||
|  | msgstr "Вы должны быть root чтобы выполнить это" | ||||||
|  |  | ||||||
|  | #: list.go:43 | ||||||
| msgid "List ALR repo packages" | msgid "List ALR repo packages" | ||||||
| msgstr "Список пакетов репозитория ALR" | msgstr "Список пакетов репозитория ALR" | ||||||
|  |  | ||||||
|  | #: list.go:57 | ||||||
|  | msgid "Format output using a Go template" | ||||||
|  | msgstr "Формат выходных данных с использованием шаблона Go" | ||||||
|  |  | ||||||
|  | #: list.go:89 | ||||||
|  | msgid "Error getting packages for upgrade" | ||||||
|  | msgstr "Ошибка при получении пакетов для обновления" | ||||||
|  |  | ||||||
|  | #: list.go:92 | ||||||
|  | msgid "No packages for upgrade" | ||||||
|  | msgstr "Нет пакетов к обновлению" | ||||||
|  |  | ||||||
|  | #: list.go:102 list.go:187 | ||||||
|  | msgid "Error parsing format template" | ||||||
|  | msgstr "Ошибка при разборе шаблона" | ||||||
|  |  | ||||||
|  | #: list.go:108 list.go:191 | ||||||
|  | msgid "Error executing template" | ||||||
|  | msgstr "Ошибка при выполнении шаблона" | ||||||
|  |  | ||||||
| #: main.go:45 | #: main.go:45 | ||||||
| msgid "Print the current ALR version and exit" | msgid "Print the current ALR version and exit" | ||||||
| msgstr "Показать текущую версию ALR и выйти" | msgstr "Показать текущую версию ALR и выйти" | ||||||
| @@ -347,11 +377,11 @@ msgstr "Аргументы, которые будут переданы мене | |||||||
| msgid "Enable interactive questions and prompts" | msgid "Enable interactive questions and prompts" | ||||||
| msgstr "Включение интерактивных вопросов и запросов" | msgstr "Включение интерактивных вопросов и запросов" | ||||||
|  |  | ||||||
| #: main.go:145 | #: main.go:146 | ||||||
| msgid "Show help" | msgid "Show help" | ||||||
| msgstr "Показать справку" | msgstr "Показать справку" | ||||||
|  |  | ||||||
| #: main.go:149 | #: main.go:150 | ||||||
| msgid "Error while running app" | msgid "Error while running app" | ||||||
| msgstr "Ошибка при запуске приложения" | msgstr "Ошибка при запуске приложения" | ||||||
|  |  | ||||||
| @@ -405,35 +435,35 @@ msgid "AutoReq is not implemented for this package format, so it's skipped" | |||||||
| msgstr "" | msgstr "" | ||||||
| "AutoReq не реализовано для этого формата пакета, поэтому будет пропущено" | "AutoReq не реализовано для этого формата пакета, поэтому будет пропущено" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:237 | #: pkg/build/script_executor.go:241 | ||||||
| msgid "Building package metadata" | msgid "Building package metadata" | ||||||
| msgstr "Сборка метаданных пакета" | msgstr "Сборка метаданных пакета" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:368 | #: pkg/build/script_executor.go:372 | ||||||
| msgid "Executing prepare()" | msgid "Executing prepare()" | ||||||
| msgstr "Выполнение prepare()" | msgstr "Выполнение prepare()" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:377 | #: pkg/build/script_executor.go:381 | ||||||
| msgid "Executing build()" | msgid "Executing build()" | ||||||
| msgstr "Выполнение build()" | msgstr "Выполнение build()" | ||||||
|  |  | ||||||
| #: pkg/build/script_executor.go:406 pkg/build/script_executor.go:426 | #: pkg/build/script_executor.go:410 pkg/build/script_executor.go:430 | ||||||
| msgid "Executing %s()" | msgid "Executing %s()" | ||||||
| msgstr "Выполнение %s()" | msgstr "Выполнение %s()" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:79 | #: pkg/repos/pull.go:77 | ||||||
| msgid "Pulling repository" | msgid "Pulling repository" | ||||||
| msgstr "Скачивание репозитория" | msgstr "Скачивание репозитория" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:103 | #: pkg/repos/pull.go:113 | ||||||
| msgid "Repository up to date" | msgid "Repository up to date" | ||||||
| msgstr "Репозиторий уже обновлён" | msgstr "Репозиторий уже обновлён" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:160 | #: pkg/repos/pull.go:204 | ||||||
| msgid "Git repository does not appear to be a valid ALR repo" | msgid "Git repository does not appear to be a valid ALR repo" | ||||||
| msgstr "Репозиторий Git не поддерживается репозиторием ALR" | msgstr "Репозиторий Git не поддерживается репозиторием ALR" | ||||||
|  |  | ||||||
| #: pkg/repos/pull.go:176 | #: pkg/repos/pull.go:220 | ||||||
| msgid "" | msgid "" | ||||||
| "ALR repo's minimum ALR version is greater than the current version. Try " | "ALR repo's minimum ALR version is greater than the current version. Try " | ||||||
| "updating ALR if something doesn't work." | "updating ALR if something doesn't work." | ||||||
| @@ -441,49 +471,61 @@ msgstr "" | |||||||
| "Минимальная версия ALR для ALR-репозитория выше текущей версии. Попробуйте " | "Минимальная версия ALR для ALR-репозитория выше текущей версии. Попробуйте " | ||||||
| "обновить ALR, если что-то не работает." | "обновить ALR, если что-то не работает." | ||||||
|  |  | ||||||
|  | #: refresh.go:30 | ||||||
|  | msgid "Pull all repositories that have changed" | ||||||
|  | msgstr "Скачать все изменённые репозитории" | ||||||
|  |  | ||||||
| #: repo.go:39 | #: repo.go:39 | ||||||
| msgid "Add a new repository" | msgid "Manage repos" | ||||||
| msgstr "Добавить новый репозиторий" | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:46 | #: repo.go:50 repo.go:220 | ||||||
| msgid "Name of the new repo" |  | ||||||
| msgstr "Название нового репозитория" |  | ||||||
|  |  | ||||||
| #: repo.go:52 |  | ||||||
| msgid "URL of the new repo" |  | ||||||
| msgstr "URL-адрес нового репозитория" |  | ||||||
|  |  | ||||||
| #: repo.go:79 |  | ||||||
| msgid "Repo \"%s\" already exists" |  | ||||||
| msgstr "Репозиторий \"%s\" уже существует" |  | ||||||
|  |  | ||||||
| #: repo.go:90 repo.go:167 |  | ||||||
| msgid "Error saving config" |  | ||||||
| msgstr "Ошибка при сохранении конфигурации" |  | ||||||
|  |  | ||||||
| #: repo.go:116 |  | ||||||
| msgid "Remove an existing repository" | msgid "Remove an existing repository" | ||||||
| msgstr "Удалить существующий репозиторий" | msgstr "Удалить существующий репозиторий" | ||||||
|  |  | ||||||
| #: repo.go:123 | #: repo.go:52 | ||||||
| msgid "Name of the repo to be deleted" | msgid "<name>" | ||||||
| msgstr "Название репозитория  удалён" | msgstr "" | ||||||
|  |  | ||||||
| #: repo.go:156 | #: repo.go:82 | ||||||
| msgid "Repo \"%s\" does not exist" | msgid "Repo \"%s\" does not exist" | ||||||
| msgstr "Репозитория \"%s\" не существует" | msgstr "Репозитория \"%s\" не существует" | ||||||
|  |  | ||||||
| #: repo.go:163 | #: repo.go:89 | ||||||
| msgid "Error removing repo directory" | msgid "Error removing repo directory" | ||||||
| msgstr "Ошибка при удалении каталога репозитория" | msgstr "Ошибка при удалении каталога репозитория" | ||||||
|  |  | ||||||
| #: repo.go:186 | #: repo.go:93 repo.go:160 | ||||||
|  | msgid "Error saving config" | ||||||
|  | msgstr "Ошибка при сохранении конфигурации" | ||||||
|  |  | ||||||
|  | #: repo.go:112 | ||||||
| msgid "Error removing packages from database" | msgid "Error removing packages from database" | ||||||
| msgstr "Ошибка при удалении пакетов из базы данных" | msgstr "Ошибка при удалении пакетов из базы данных" | ||||||
|  |  | ||||||
|  | #: repo.go:123 repo.go:190 | ||||||
|  | msgid "Add a new repository" | ||||||
|  | msgstr "Добавить новый репозиторий" | ||||||
|  |  | ||||||
|  | #: repo.go:124 | ||||||
|  | msgid "<name> <url>" | ||||||
|  | msgstr "" | ||||||
|  |  | ||||||
|  | #: repo.go:149 | ||||||
|  | msgid "Repo \"%s\" already exists" | ||||||
|  | msgstr "Репозиторий \"%s\" уже существует" | ||||||
|  |  | ||||||
| #: repo.go:197 | #: repo.go:197 | ||||||
| msgid "Pull all repositories that have changed" | msgid "Name of the new repo" | ||||||
| msgstr "Скачать все изменённые репозитории" | msgstr "Название нового репозитория" | ||||||
|  |  | ||||||
|  | #: repo.go:203 | ||||||
|  | msgid "URL of the new repo" | ||||||
|  | msgstr "URL-адрес нового репозитория" | ||||||
|  |  | ||||||
|  | #: repo.go:227 | ||||||
|  | msgid "Name of the repo to be deleted" | ||||||
|  | msgstr "Название репозитория  удалён" | ||||||
|  |  | ||||||
| #: search.go:40 | #: search.go:40 | ||||||
| msgid "Search packages" | msgid "Search packages" | ||||||
| @@ -505,31 +547,19 @@ msgstr "Искать по репозиторию" | |||||||
| msgid "Search by provides" | msgid "Search by provides" | ||||||
| msgstr "Иcкать по provides" | msgstr "Иcкать по provides" | ||||||
|  |  | ||||||
| #: search.go:71 |  | ||||||
| msgid "Format output using a Go template" |  | ||||||
| msgstr "Формат выходных данных с использованием шаблона Go" |  | ||||||
|  |  | ||||||
| #: search.go:130 | #: search.go:130 | ||||||
| msgid "Error while executing search" | msgid "Error while executing search" | ||||||
| msgstr "Ошибка при выполнении поиска" | msgstr "Ошибка при выполнении поиска" | ||||||
|  |  | ||||||
| #: search.go:138 |  | ||||||
| msgid "Error parsing format template" |  | ||||||
| msgstr "Ошибка при разборе шаблона" |  | ||||||
|  |  | ||||||
| #: search.go:153 |  | ||||||
| msgid "Error executing template" |  | ||||||
| msgstr "Ошибка при выполнении шаблона" |  | ||||||
|  |  | ||||||
| #: upgrade.go:47 | #: upgrade.go:47 | ||||||
| msgid "Upgrade all installed packages" | msgid "Upgrade all installed packages" | ||||||
| msgstr "Обновить все установленные пакеты" | msgstr "Обновить все установленные пакеты" | ||||||
|  |  | ||||||
| #: upgrade.go:109 upgrade.go:126 | #: upgrade.go:105 upgrade.go:122 | ||||||
| msgid "Error checking for updates" | msgid "Error checking for updates" | ||||||
| msgstr "Ошибка при проверке обновлений" | msgstr "Ошибка при проверке обновлений" | ||||||
|  |  | ||||||
| #: upgrade.go:129 | #: upgrade.go:125 | ||||||
| msgid "There is nothing to do." | msgid "There is nothing to do." | ||||||
| msgstr "Здесь нечего делать." | msgstr "Здесь нечего делать." | ||||||
|  |  | ||||||
| @@ -576,9 +606,6 @@ msgstr "Здесь нечего делать." | |||||||
| #~ msgid "Error installing native packages" | #~ msgid "Error installing native packages" | ||||||
| #~ msgstr "Ошибка при установке нативных пакетов" | #~ msgstr "Ошибка при установке нативных пакетов" | ||||||
|  |  | ||||||
| #~ msgid "Error installing package" |  | ||||||
| #~ msgstr "Ошибка при установке пакета" |  | ||||||
|  |  | ||||||
| #~ msgid "Error opening config file, using defaults" | #~ msgid "Error opening config file, using defaults" | ||||||
| #~ msgstr "" | #~ msgstr "" | ||||||
| #~ "Ошибка при открытии конфигурационного файла, используются значения по " | #~ "Ошибка при открытии конфигурационного файла, используются значения по " | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -22,6 +22,7 @@ package types | |||||||
| // Config represents the ALR configuration file | // Config represents the ALR configuration file | ||||||
| type Config struct { | type Config struct { | ||||||
| 	RootCmd          string   `toml:"rootCmd" env:"ALR_ROOT_CMD"` | 	RootCmd          string   `toml:"rootCmd" env:"ALR_ROOT_CMD"` | ||||||
|  | 	UseRootCmd       bool     `toml:"useRootCmd"` | ||||||
| 	PagerStyle       string   `toml:"pagerStyle" env:"ALR_PAGER_STYLE"` | 	PagerStyle       string   `toml:"pagerStyle" env:"ALR_PAGER_STYLE"` | ||||||
| 	IgnorePkgUpdates []string `toml:"ignorePkgUpdates"` | 	IgnorePkgUpdates []string `toml:"ignorePkgUpdates"` | ||||||
| 	Repos            []Repo   `toml:"repo"` | 	Repos            []Repo   `toml:"repo"` | ||||||
| @@ -33,4 +34,5 @@ type Config struct { | |||||||
| type Repo struct { | type Repo struct { | ||||||
| 	Name string `toml:"name"` | 	Name string `toml:"name"` | ||||||
| 	URL  string `toml:"url"` | 	URL  string `toml:"url"` | ||||||
|  | 	Ref  string `toml:"ref"` | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -19,6 +19,7 @@ package utils | |||||||
| import ( | import ( | ||||||
| 	"errors" | 	"errors" | ||||||
| 	"os" | 	"os" | ||||||
|  | 	"os/exec" | ||||||
| 	"os/user" | 	"os/user" | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"syscall" | 	"syscall" | ||||||
| @@ -27,6 +28,7 @@ import ( | |||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
|  |  | ||||||
| 	"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils" | 	"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils" | ||||||
|  | 	appbuilder "gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils/app_builder" | ||||||
| 	"gitea.plemya-x.ru/Plemya-x/ALR/internal/constants" | 	"gitea.plemya-x.ru/Plemya-x/ALR/internal/constants" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| @@ -118,11 +120,8 @@ func ExitIfCantDropCapsToAlrUserNoPrivs() cli.ExitCoder { | |||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
| func ExitIfNotRoot() error { | func IsNotRoot() bool { | ||||||
| 	if os.Getuid() != 0 { | 	return os.Getuid() != 0 | ||||||
| 		return cli.Exit(gotext.Get("You need to be root to perform this action"), 1) |  | ||||||
| 	} |  | ||||||
| 	return nil |  | ||||||
| } | } | ||||||
|  |  | ||||||
| func EnsureIsAlrUser() error { | func EnsureIsAlrUser() error { | ||||||
| @@ -184,3 +183,33 @@ func EscalateToRoot() error { | |||||||
| 	} | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
|  | func RootNeededAction(f cli.ActionFunc) cli.ActionFunc { | ||||||
|  | 	return func(ctx *cli.Context) error { | ||||||
|  | 		deps, err := appbuilder. | ||||||
|  | 			New(ctx.Context). | ||||||
|  | 			WithConfig(). | ||||||
|  | 			Build() | ||||||
|  | 		if err != nil { | ||||||
|  | 			return err | ||||||
|  | 		} | ||||||
|  | 		defer deps.Defer() | ||||||
|  |  | ||||||
|  | 		if IsNotRoot() { | ||||||
|  | 			if !deps.Cfg.UseRootCmd() { | ||||||
|  | 				return cli.Exit(gotext.Get("You need to be root to perform this action"), 1) | ||||||
|  | 			} | ||||||
|  | 			executable, err := os.Executable() | ||||||
|  | 			if err != nil { | ||||||
|  | 				return cliutils.FormatCliExit("failed to get executable path", err) | ||||||
|  | 			} | ||||||
|  | 			args := append([]string{executable}, os.Args[1:]...) | ||||||
|  | 			cmd := exec.Command(deps.Cfg.RootCmd(), args...) | ||||||
|  | 			cmd.Stdin = os.Stdin | ||||||
|  | 			cmd.Stdout = os.Stdout | ||||||
|  | 			cmd.Stderr = os.Stderr | ||||||
|  | 			return cmd.Run() | ||||||
|  | 		} | ||||||
|  | 		return f(ctx) | ||||||
|  | 	} | ||||||
|  | } | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | 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 Евгений Храмов. | It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
|  |  | ||||||
| ALR - Any Linux Repository | ALR - Any Linux Repository | ||||||
| Copyright (C) {{ .Year }} Евгений Храмов | Copyright (C) {{ .Year }} The ALR Authors | ||||||
|  |  | ||||||
| This program is free software: you can redistribute it and/or modify | 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 | it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| ALR - Any Linux Repository | ALR - Any Linux Repository | ||||||
| Copyright (C) {{ .Year }} Евгений Храмов | Copyright (C) {{ .Year }} The ALR Authors | ||||||
|  |  | ||||||
| This program is free software: you can redistribute it and/or modify | 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 | it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
							
								
								
									
										76
									
								
								list.go
									
									
									
									
									
								
							
							
						
						
									
										76
									
								
								list.go
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -22,10 +22,12 @@ package main | |||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"log/slog" | 	"log/slog" | ||||||
|  | 	"os" | ||||||
|  | 	"slices" | ||||||
|  | 	"text/template" | ||||||
|  |  | ||||||
| 	"github.com/leonelquinteros/gotext" | 	"github.com/leonelquinteros/gotext" | ||||||
| 	"github.com/urfave/cli/v2" | 	"github.com/urfave/cli/v2" | ||||||
| 	"golang.org/x/exp/slices" |  | ||||||
|  |  | ||||||
| 	"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils" | 	"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils" | ||||||
| 	appbuilder "gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils/app_builder" | 	appbuilder "gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils/app_builder" | ||||||
| @@ -45,6 +47,15 @@ func ListCmd() *cli.Command { | |||||||
| 				Name:    "installed", | 				Name:    "installed", | ||||||
| 				Aliases: []string{"I"}, | 				Aliases: []string{"I"}, | ||||||
| 			}, | 			}, | ||||||
|  | 			&cli.BoolFlag{ | ||||||
|  | 				Name:    "upgradable", | ||||||
|  | 				Aliases: []string{"U"}, | ||||||
|  | 			}, | ||||||
|  | 			&cli.StringFlag{ | ||||||
|  | 				Name:    "format", | ||||||
|  | 				Aliases: []string{"f"}, | ||||||
|  | 				Usage:   gotext.Get("Format output using a Go template"), | ||||||
|  | 			}, | ||||||
| 		}, | 		}, | ||||||
| 		Action: func(c *cli.Context) error { | 		Action: func(c *cli.Context) error { | ||||||
| 			if err := utils.ExitIfCantDropCapsToAlrUserNoPrivs(); err != nil { | 			if err := utils.ExitIfCantDropCapsToAlrUserNoPrivs(); err != nil { | ||||||
| @@ -57,8 +68,10 @@ func ListCmd() *cli.Command { | |||||||
| 				New(ctx). | 				New(ctx). | ||||||
| 				WithConfig(). | 				WithConfig(). | ||||||
| 				WithDB(). | 				WithDB(). | ||||||
|  | 				WithManager(). | ||||||
| 				// autoPull only | 				// autoPull only | ||||||
| 				WithRepos(). | 				WithRepos(). | ||||||
|  | 				WithDistroInfo(). | ||||||
| 				Build() | 				Build() | ||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				return err | 				return err | ||||||
| @@ -67,6 +80,39 @@ func ListCmd() *cli.Command { | |||||||
|  |  | ||||||
| 			cfg := deps.Cfg | 			cfg := deps.Cfg | ||||||
| 			db := deps.DB | 			db := deps.DB | ||||||
|  | 			mgr := deps.Manager | ||||||
|  | 			info := deps.Info | ||||||
|  |  | ||||||
|  | 			if c.Bool("upgradable") { | ||||||
|  | 				updates, err := checkForUpdates(ctx, mgr, db, info) | ||||||
|  | 				if err != nil { | ||||||
|  | 					return cliutils.FormatCliExit(gotext.Get("Error getting packages for upgrade"), err) | ||||||
|  | 				} | ||||||
|  | 				if len(updates) == 0 { | ||||||
|  | 					slog.Info(gotext.Get("No packages for upgrade")) | ||||||
|  | 					return nil | ||||||
|  | 				} | ||||||
|  |  | ||||||
|  | 				format := c.String("format") | ||||||
|  | 				if format == "" { | ||||||
|  | 					format = "{{.Package.Repository}}/{{.Package.Name}} {{.FromVersion}} -> {{.ToVersion}}\n" | ||||||
|  | 				} | ||||||
|  | 				tmpl, err := template.New("format").Parse(format) | ||||||
|  | 				if err != nil { | ||||||
|  | 					return cliutils.FormatCliExit(gotext.Get("Error parsing format template"), err) | ||||||
|  | 				} | ||||||
|  |  | ||||||
|  | 				for _, updateInfo := range updates { | ||||||
|  | 					err = tmpl.Execute(os.Stdout, updateInfo) | ||||||
|  | 					if err != nil { | ||||||
|  | 						return cliutils.FormatCliExit(gotext.Get("Error executing template"), err) | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
|  |  | ||||||
|  | 				return nil | ||||||
|  | 			} | ||||||
|  |  | ||||||
|  | 			// TODO: refactor code below | ||||||
|  |  | ||||||
| 			where := "true" | 			where := "true" | ||||||
| 			args := []any(nil) | 			args := []any(nil) | ||||||
| @@ -115,17 +161,35 @@ func ListCmd() *cli.Command { | |||||||
| 					continue | 					continue | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				version := pkg.Version | 				type packageInfo struct { | ||||||
|  | 					Package *database.Package | ||||||
|  | 					Version string | ||||||
|  | 				} | ||||||
|  |  | ||||||
|  | 				pkgInfo := &packageInfo{} | ||||||
|  | 				pkgInfo.Package = &pkg | ||||||
|  | 				pkgInfo.Version = pkg.Version | ||||||
| 				if c.Bool("installed") { | 				if c.Bool("installed") { | ||||||
| 					instVersion, ok := installedAlrPackages[fmt.Sprintf("%s/%s", pkg.Repository, pkg.Name)] | 					instVersion, ok := installedAlrPackages[fmt.Sprintf("%s/%s", pkg.Repository, pkg.Name)] | ||||||
| 					if !ok { | 					if !ok { | ||||||
| 						continue | 						continue | ||||||
| 					} else { | 					} else { | ||||||
| 						version = instVersion | 						pkgInfo.Version = instVersion | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				fmt.Printf("%s/%s %s\n", pkg.Repository, pkg.Name, version) | 				format := c.String("format") | ||||||
|  | 				if format == "" { | ||||||
|  | 					format = "{{.Package.Repository}}/{{.Package.Name}} {{.Version}}\n" | ||||||
|  | 				} | ||||||
|  | 				tmpl, err := template.New("format").Parse(format) | ||||||
|  | 				if err != nil { | ||||||
|  | 					return cliutils.FormatCliExit(gotext.Get("Error parsing format template"), err) | ||||||
|  | 				} | ||||||
|  | 				err = tmpl.Execute(os.Stdout, pkgInfo) | ||||||
|  | 				if err != nil { | ||||||
|  | 					return cliutils.FormatCliExit(gotext.Get("Error executing template"), err) | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			return nil | 			return nil | ||||||
|   | |||||||
							
								
								
									
										9
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								main.go
									
									
									
									
									
								
							| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -74,14 +74,15 @@ func GetApp() *cli.App { | |||||||
| 			InfoCmd(), | 			InfoCmd(), | ||||||
| 			ListCmd(), | 			ListCmd(), | ||||||
| 			BuildCmd(), | 			BuildCmd(), | ||||||
| 			AddRepoCmd(), | 			LegacyAddRepoCmd(), | ||||||
| 			RemoveRepoCmd(), | 			LegacyRemoveRepoCmd(), | ||||||
| 			RefreshCmd(), | 			RefreshCmd(), | ||||||
| 			FixCmd(), | 			FixCmd(), | ||||||
| 			GenCmd(), | 			GenCmd(), | ||||||
| 			HelperCmd(), | 			HelperCmd(), | ||||||
| 			VersionCmd(), | 			VersionCmd(), | ||||||
| 			SearchCmd(), | 			SearchCmd(), | ||||||
|  | 			RepoCmd(), | ||||||
| 			// Internal commands | 			// Internal commands | ||||||
| 			InternalBuildCmd(), | 			InternalBuildCmd(), | ||||||
| 			InternalInstallCmd(), | 			InternalInstallCmd(), | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| // This file was originally part of the project "LURE - Linux User REpository", created by Elara Musayelyan. | // 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 Евгений Храмов. | // It has been modified as part of "ALR - Any Linux Repository" by the ALR Authors. | ||||||
| // | // | ||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -439,7 +439,7 @@ func (b *Builder) BuildPackage( | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	slog.Debug("BuildALRDeps") | 	slog.Debug("BuildALRDeps") | ||||||
| 	_, builtNames, repoDeps, err := b.BuildALRDeps(ctx, input, depends) | 	builtPaths, builtNames, repoDeps, err := b.BuildALRDeps(ctx, input, depends) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return nil, err | 		return nil, err | ||||||
| 	} | 	} | ||||||
| @@ -481,8 +481,8 @@ func (b *Builder) BuildPackage( | |||||||
| 		return nil, err | 		return nil, err | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	pkgPaths := removeDuplicates(res.BuiltPaths) | 	pkgPaths := removeDuplicates(append(builtPaths, res.BuiltPaths...)) | ||||||
| 	pkgNames := removeDuplicates(res.BuiltNames) | 	pkgNames := removeDuplicates(append(builtNames, res.BuiltNames...)) | ||||||
|  |  | ||||||
| 	return &BuildResult{ | 	return &BuildResult{ | ||||||
| 		PackagePaths: pkgPaths, | 		PackagePaths: pkgPaths, | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -237,6 +237,7 @@ func GetSafeScriptExecutor() (ScriptExecutor, func(), error) { | |||||||
| 		UnixSocketConfig: &plugin.UnixSocketConfig{ | 		UnixSocketConfig: &plugin.UnixSocketConfig{ | ||||||
| 			Group: "alr", | 			Group: "alr", | ||||||
| 		}, | 		}, | ||||||
|  | 		SyncStderr: os.Stderr, | ||||||
| 	}) | 	}) | ||||||
| 	rpcClient, err := client.Client() | 	rpcClient, err := client.Client() | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
| @@ -73,7 +73,7 @@ func (e *LocalScriptExecutor) ExecuteFirstPass(ctx context.Context, input *Build | |||||||
|  |  | ||||||
| 	runner, err := interp.New( | 	runner, err := interp.New( | ||||||
| 		interp.Env(expand.ListEnviron(env...)),                               // Устанавливаем окружение | 		interp.Env(expand.ListEnviron(env...)),                               // Устанавливаем окружение | ||||||
| 		interp.StdIO(os.Stdin, os.Stdout, os.Stderr),                         // Устанавливаем стандартный ввод-вывод | 		interp.StdIO(os.Stdin, os.Stderr, os.Stderr),                         // Устанавливаем стандартный ввод-вывод | ||||||
| 		interp.ExecHandler(helpers.Restricted.ExecHandler(handlers.NopExec)), // Ограничиваем выполнение | 		interp.ExecHandler(helpers.Restricted.ExecHandler(handlers.NopExec)), // Ограничиваем выполнение | ||||||
| 		interp.ReadDirHandler2(handlers.RestrictedReadDir(scriptDir)),        // Ограничиваем чтение директорий | 		interp.ReadDirHandler2(handlers.RestrictedReadDir(scriptDir)),        // Ограничиваем чтение директорий | ||||||
| 		interp.StatHandler(handlers.RestrictedStat(scriptDir)),               // Ограничиваем доступ к статистике файлов | 		interp.StatHandler(handlers.RestrictedStat(scriptDir)),               // Ограничиваем доступ к статистике файлов | ||||||
| @@ -118,16 +118,20 @@ func (e *LocalScriptExecutor) ExecuteFirstPass(ctx context.Context, input *Build | |||||||
| 		return vars.Name, varsOfPackages, nil | 		return vars.Name, varsOfPackages, nil | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if len(input.packages) == 0 { | 	var pkgNames []string | ||||||
| 		return "", nil, errors.New("script has multiple packages but package is not specified") |  | ||||||
|  | 	if len(input.packages) != 0 { | ||||||
|  | 		pkgNames = input.packages | ||||||
|  | 	} else { | ||||||
|  | 		pkgNames = pkgs.Names | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	for _, pkgName := range input.packages { | 	for _, pkgName := range pkgNames { | ||||||
| 		var preVars types.BuildVarsPre | 		var preVars types.BuildVarsPre | ||||||
| 		funcName := fmt.Sprintf("meta_%s", pkgName) | 		funcName := fmt.Sprintf("meta_%s", pkgName) | ||||||
| 		meta, ok := dec.GetFuncWithSubshell(funcName) | 		meta, ok := dec.GetFuncWithSubshell(funcName) | ||||||
| 		if !ok { | 		if !ok { | ||||||
| 			return "", nil, errors.New("func is missing") | 			return "", nil, fmt.Errorf("func %s is missing", funcName) | ||||||
| 		} | 		} | ||||||
| 		r, err := meta(ctx) | 		r, err := meta(ctx) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| @@ -193,7 +197,7 @@ func (e *LocalScriptExecutor) ExecuteSecondPass( | |||||||
| 	fakeroot := handlers.FakerootExecHandler(2 * time.Second) | 	fakeroot := handlers.FakerootExecHandler(2 * time.Second) | ||||||
| 	runner, err := interp.New( | 	runner, err := interp.New( | ||||||
| 		interp.Env(expand.ListEnviron(env...)),       // Устанавливаем окружение | 		interp.Env(expand.ListEnviron(env...)),       // Устанавливаем окружение | ||||||
| 		interp.StdIO(os.Stdin, os.Stdout, os.Stderr), // Устанавливаем стандартный ввод-вывод | 		interp.StdIO(os.Stdin, os.Stderr, os.Stderr), // Устанавливаем стандартный ввод-вывод | ||||||
| 		interp.ExecHandlers(func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc { | 		interp.ExecHandlers(func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc { | ||||||
| 			return helpers.Helpers.ExecHandler(fakeroot) | 			return helpers.Helpers.ExecHandler(fakeroot) | ||||||
| 		}), // Обрабатываем выполнение через fakeroot | 		}), // Обрабатываем выполнение через fakeroot | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| // ALR - Any Linux Repository | // ALR - Any Linux Repository | ||||||
| // Copyright (C) 2025 Евгений Храмов | // Copyright (C) 2025 The ALR Authors | ||||||
| // | // | ||||||
| // This program is free software: you can redistribute it and/or modify | // 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 | // it under the terms of the GNU General Public License as published by | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user