Compare commits
56 Commits
v0.0.11
...
65ab4de561
| Author | SHA1 | Date | |
|---|---|---|---|
| 65ab4de561 | |||
| 1cdab8dfed | |||
| 237e2c338d | |||
| 703ab8e8c4 | |||
| 06fcab4ce7 | |||
| 7741c7368b | |||
| 69f4af0a4d | |||
| bcf627f176 | |||
| 6ec95e4bd9 | |||
| 578da7ff52 | |||
| c51caf5c52 | |||
| 09dba577c6 | |||
| ca82bf3024 | |||
| c0023db6cd | |||
| 152e5077ec | |||
| 15ba8700e8 | |||
| a8aefc0524 | |||
| 9540030579 | |||
| 4f9d4260b8 | |||
| 38b5e6f581 | |||
| 408bd12302 | |||
| fb83d544de | |||
| 2cb963d4b2 | |||
| e74d74cdf6 | |||
| 5b3d53d253 | |||
| 36e704f735 | |||
| 07356d5e55 | |||
| 52bd6aca93 | |||
| 2f1770b43b | |||
| 9d5b5b51ff | |||
| c88478a450 | |||
| 3e61fec67c | |||
| 6f484a1169 | |||
| dddcb9b7b0 | |||
| b03d94e48b | |||
| f92bd7089a | |||
| eb2356458c | |||
| 131f455eff | |||
| 1e52d30f4c | |||
| 40ec0ac6e1 | |||
| 443e481561 | |||
| c892310f69 | |||
| 750513b119 | |||
| ce1836b646 | |||
| 56b9f3211c | |||
| fae63e28f9 | |||
| c632ddb354 | |||
| 76234bf00d | |||
| f8c510ab9f | |||
| 849a08a791 | |||
| 952dd26f5f | |||
| 080c9f42ff | |||
| 3c3ee286ce | |||
| d0d8930491 | |||
| 93508647e0 | |||
| 6135e55f92 |
56
.gitea/workflows/e2e-tests.yaml
Normal file
56
.gitea/workflows/e2e-tests.yaml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# 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
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: https://github.com/actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.24'
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
# - name: Cache Podman images
|
||||||
|
# uses: actions/cache@v4
|
||||||
|
# with:
|
||||||
|
# path: |
|
||||||
|
# ~/.local/share/containers/storage
|
||||||
|
# /var/lib/containers/storage
|
||||||
|
# key: ${{ runner.os }}-primes
|
||||||
|
|
||||||
|
- name: Run E2E tests
|
||||||
|
env:
|
||||||
|
IGNORE_ROOT_CHECK: 1
|
||||||
|
run: |
|
||||||
|
make e2e-test
|
||||||
51
.gitea/workflows/pre-commit.yaml
Normal file
51
.gitea/workflows/pre-commit.yaml
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/>.
|
||||||
|
|
||||||
|
|
||||||
|
name: Pre-commit
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: docker.gitea.com/runner-images: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
|
||||||
120
.gitea/workflows/release.yaml
Normal file
120
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
# 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: Create Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
changelog:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout this repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.24'
|
||||||
|
|
||||||
|
- name: Get Changes between Tags
|
||||||
|
id: changes
|
||||||
|
uses: simbo/changes-between-tags-action@v1
|
||||||
|
|
||||||
|
- name: Set version
|
||||||
|
run: |
|
||||||
|
version=$(echo "${GITHUB_REF##*/}" | sed 's/^v//')
|
||||||
|
echo "Version - $version"
|
||||||
|
echo "VERSION=$version" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Prepare for install
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y libcap2-bin bindfs
|
||||||
|
|
||||||
|
- name: Build alr
|
||||||
|
env:
|
||||||
|
IGNORE_ROOT_CHECK: 1
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
|
|
||||||
|
- name: Create tar.gz
|
||||||
|
run: |
|
||||||
|
mkdir -p ./out/completion
|
||||||
|
cp alr ./out
|
||||||
|
cp scripts/completion/bash ./out/completion/alr
|
||||||
|
cp scripts/completion/zsh ./out/completion/_alr
|
||||||
|
|
||||||
|
( cd out && tar -czvf ../alr-${{ env.VERSION }}-linux-x86_64.tar.gz * )
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: akkuman/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
body: ${{ steps.changes.outputs.changes }}
|
||||||
|
files: |-
|
||||||
|
alr-${{ env.VERSION }}-linux-x86_64.tar.gz
|
||||||
|
|
||||||
|
- name: Checkout alr-default repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: Plemya-x/alr-default
|
||||||
|
token: ${{ secrets.GITEAPUBLIC }}
|
||||||
|
path: alr-default
|
||||||
|
|
||||||
|
- name: Update version in alr-bin
|
||||||
|
run: |
|
||||||
|
# Замените значения в файле с конфигурацией
|
||||||
|
sed -i "s/version='[0-9]\+\.[0-9]\+\.[0-9]\+'/version='${{ env.VERSION }}'/g" alr-default/alr-bin/alr.sh
|
||||||
|
sed -i "s/release='[0-9]\+'/release='1'/g" alr-default/alr-bin/alr.sh
|
||||||
|
|
||||||
|
- name: Install alr
|
||||||
|
run: |
|
||||||
|
make install
|
||||||
|
|
||||||
|
# temporary fix
|
||||||
|
groupadd wheel
|
||||||
|
usermod -aG wheel root
|
||||||
|
|
||||||
|
- name: Build packages
|
||||||
|
run: |
|
||||||
|
SCRIPT_PATH=alr-default/alr-bin/alr.sh
|
||||||
|
ALR_DISTRO=altlinux ALR_PKG_FORMAT=rpm alr build -s "$SCRIPT_PATH"
|
||||||
|
ALR_PKG_FORMAT=rpm alr build -s "$SCRIPT_PATH"
|
||||||
|
ALR_PKG_FORMAT=deb alr build -s "$SCRIPT_PATH"
|
||||||
|
ALR_PKG_FORMAT=archlinux alr build -s "$SCRIPT_PATH"
|
||||||
|
|
||||||
|
- name: Upload assets
|
||||||
|
uses: akkuman/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
body: ${{ steps.changes.outputs.changes }}
|
||||||
|
files: |-
|
||||||
|
alr-bin+alr-default_${{ env.VERSION }}-1.red80_amd64.deb \
|
||||||
|
alr-bin+alr-default-${{ env.VERSION }}-1-x86_64.pkg.tar.zst \
|
||||||
|
alr-bin+alr-default-${{ env.VERSION }}-1.red80.x86_64.rpm \
|
||||||
|
alr-bin+alr-default-${{ env.VERSION }}-alt1.x86_64.rpm
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
run: |
|
||||||
|
cd alr-default
|
||||||
|
git config user.name "gitea"
|
||||||
|
git config user.email "admin@plemya-x.ru"
|
||||||
|
git add .
|
||||||
|
git commit -m "Обновление версии до ${{ env.VERSION }}"
|
||||||
|
git push
|
||||||
@@ -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
|
|
||||||
17
Makefile
17
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
|
||||||
|
|
||||||
@@ -38,6 +39,12 @@ install: \
|
|||||||
$(INSTALED_BIN): $(BIN)
|
$(INSTALED_BIN): $(BIN)
|
||||||
install -Dm755 $< $@
|
install -Dm755 $< $@
|
||||||
setcap cap_setuid,cap_setgid+ep $(INSTALED_BIN)
|
setcap cap_setuid,cap_setgid+ep $(INSTALED_BIN)
|
||||||
|
@if id alr >/dev/null 2>&1; then \
|
||||||
|
echo "User 'alr' already exists. Skipping."; \
|
||||||
|
else \
|
||||||
|
useradd -r -s /usr/sbin/nologin alr; \
|
||||||
|
fi
|
||||||
|
install -d -o alr -g alr -m 755 /var/cache/alr /etc/alr
|
||||||
|
|
||||||
$(INSTALLED_BASH_COMPLETION): $(BASH_COMPLETION)
|
$(INSTALLED_BASH_COMPLETION): $(BASH_COMPLETION)
|
||||||
install -Dm755 $< $@
|
install -Dm755 $< $@
|
||||||
@@ -54,7 +61,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 +83,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 ./...
|
||||||
16
README.md
16
README.md
@@ -20,10 +20,10 @@ ALR написан на чистом Go и после сборки не имее
|
|||||||
Установочный скрипт автоматически загрузит и установит соответствующий пакет ALR в вашей системе. Чтобы использовать его, просто выполните следующую команду:
|
Установочный скрипт автоматически загрузит и установит соответствующий пакет ALR в вашей системе. Чтобы использовать его, просто выполните следующую команду:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL plemya-x.ru/alr/install.sh | bash
|
curl -fsSL https://gitea.plemya-x.ru/Plemya-x/ALR/raw/branch/master/scripts/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
**ВАЖНО**: При этом скрипт будет загружен и запущен с <https://plemya-x.ru/alr/install.sh>. Пожалуйста, просматривайте любые скрипты, которые вы скачиваете из Интернета (включая этот), прежде чем запускать их.
|
**ВАЖНО**: При этом скрипт будет загружен и запущен [скрипт](https://gitea.plemya-x.ru/Plemya-x/ALR/src/branch/master/scripts/install.sh). Пожалуйста, просматривайте любые скрипты, которые вы скачиваете из Интернета (включая этот), прежде чем запускать их.
|
||||||
|
|
||||||
### Сборка из исходного кода
|
### Сборка из исходного кода
|
||||||
|
|
||||||
@@ -52,9 +52,17 @@ ALR был создан потому, что упаковка программн
|
|||||||
|
|
||||||
Репозитории alr - это git-хранилища, которые содержат каталог для каждого пакета с файлом `alr.sh` внутри. Файл `alr.sh` содержит все инструкции по сборке пакета и информацию о нем. Скрипты `alr.sh` аналогичны скриптам Aur PKGBUILD.
|
Репозитории alr - это git-хранилища, которые содержат каталог для каждого пакета с файлом `alr.sh` внутри. Файл `alr.sh` содержит все инструкции по сборке пакета и информацию о нем. Скрипты `alr.sh` аналогичны скриптам Aur PKGBUILD.
|
||||||
|
|
||||||
Например, репозиторий [Plemya-x/alr-repo](https://gitea.plemya-x.ru/Plemya-x/alr-repo.git) можно подключить так:
|
Например, репозиторий с ALR [Plemya-x/alr-default](https://gitea.plemya-x.ru/Plemya-x/alr-default.git)
|
||||||
```
|
```
|
||||||
alr addrepo --name alr-repo --url https://gitea.plemya-x.ru/Plemya-x/alr-repo.git
|
alr repo add alr-default https://gitea.plemya-x.ru/Plemya-x/alr-default.git
|
||||||
|
```
|
||||||
|
Репозиторий пакетов [Plemya-x/alr-repo](https://gitea.plemya-x.ru/Plemya-x/alr-repo.git) можно подключить так:
|
||||||
|
```
|
||||||
|
alr repo add alr-repo https://gitea.plemya-x.ru/Plemya-x/alr-repo.git
|
||||||
|
```
|
||||||
|
Репозиторий Linux-Gaming [Plemya-x/alr-LG](https://gitea.plemya-x.ru/Plemya-x/alr-LG.git) можно подключить так:
|
||||||
|
```
|
||||||
|
alr repo add alr-LG https://gitea.plemya-x.ru/Plemya-x/alr-LG.git
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -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">16.7%</text>
|
||||||
<text x="86" y="14">16.4%</text>
|
<text x="86" y="14">16.7%</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B |
22
build.go
22
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
|
||||||
@@ -28,12 +28,12 @@ import (
|
|||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/build"
|
||||||
"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"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/osutils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/osutils"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/utils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/utils"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/build"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BuildCmd() *cli.Command {
|
func BuildCmd() *cli.Command {
|
||||||
@@ -97,7 +97,7 @@ func BuildCmd() *cli.Command {
|
|||||||
var script string
|
var script string
|
||||||
var packages []string
|
var packages []string
|
||||||
|
|
||||||
var res *build.BuildResult
|
var res []*build.BuiltDep
|
||||||
|
|
||||||
var scriptArgs *build.BuildPackageFromScriptArgs
|
var scriptArgs *build.BuildPackageFromScriptArgs
|
||||||
var dbArgs *build.BuildPackageFromDbArgs
|
var dbArgs *build.BuildPackageFromDbArgs
|
||||||
@@ -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,
|
||||||
@@ -218,9 +222,9 @@ func BuildCmd() *cli.Command {
|
|||||||
return cliutils.FormatCliExit(gotext.Get("Error building package"), err)
|
return cliutils.FormatCliExit(gotext.Get("Error building package"), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, pkgPath := range res.PackagePaths {
|
for _, pkg := range res {
|
||||||
name := filepath.Base(pkgPath)
|
name := filepath.Base(pkg.Path)
|
||||||
err = osutils.Move(pkgPath, filepath.Join(wd, name))
|
err = osutils.Move(pkg.Path, filepath.Join(wd, name))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cliutils.FormatCliExit(gotext.Get("Error moving the package"), err)
|
return cliutils.FormatCliExit(gotext.Get("Error moving the package"), 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
|
||||||
|
|||||||
@@ -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,7 +21,6 @@ package e2etests_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alecthomas/assert/v2"
|
|
||||||
"github.com/efficientgo/e2e"
|
"github.com/efficientgo/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,10 +30,7 @@ func TestE2EBashCompletion(t *testing.T) {
|
|||||||
"bash-completion",
|
"bash-completion",
|
||||||
COMMON_SYSTEMS,
|
COMMON_SYSTEMS,
|
||||||
func(t *testing.T, r e2e.Runnable) {
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
err := r.Exec(e2e.NewCommand(
|
execShouldNoError(t, r, "alr", "install", "--generate-bash-completion")
|
||||||
"alr", "install", "--generate-bash-completion",
|
|
||||||
))
|
|
||||||
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
|
||||||
@@ -25,7 +25,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -121,29 +120,6 @@ var COMMON_SYSTEMS []string = []string{
|
|||||||
"ubuntu-24.04",
|
"ubuntu-24.04",
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
|
||||||
for _, id := range ALL_SYSTEMS {
|
|
||||||
buildAlrTestImage(id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func buildAlrTestImage(id string) {
|
|
||||||
cmd := exec.Command(
|
|
||||||
"docker",
|
|
||||||
"build",
|
|
||||||
"-t", fmt.Sprintf("alr-testimage-%s", id),
|
|
||||||
"-f", fmt.Sprintf("images/Dockerfile.%s", id),
|
|
||||||
".",
|
|
||||||
)
|
|
||||||
cmd.Stdout = os.Stdout
|
|
||||||
cmd.Stderr = os.Stderr
|
|
||||||
err := cmd.Run()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Error:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func dockerMultipleRun(t *testing.T, name string, ids []string, f func(t *testing.T, runnable e2e.Runnable)) {
|
func dockerMultipleRun(t *testing.T, name string, ids []string, f func(t *testing.T, runnable e2e.Runnable)) {
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
@@ -158,23 +134,39 @@ func dockerMultipleRun(t *testing.T, name string, ids []string, f func(t *testin
|
|||||||
e, err := e2e.New(e2e.WithVerbose(), e2e.WithName(fmt.Sprintf("alr-%s", truncatedHash)))
|
e, err := e2e.New(e2e.WithVerbose(), e2e.WithName(fmt.Sprintf("alr-%s", truncatedHash)))
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
t.Cleanup(e.Close)
|
t.Cleanup(e.Close)
|
||||||
imageId := fmt.Sprintf("alr-testimage-%s", id)
|
imageId := fmt.Sprintf("ghcr.io/maks1ms/alr-e2e-test-image-%s", id)
|
||||||
runnable := e.Runnable(dockerName).Init(
|
runnable := e.Runnable(dockerName).Init(
|
||||||
e2e.StartOptions{
|
e2e.StartOptions{
|
||||||
Image: imageId,
|
Image: imageId,
|
||||||
Volumes: []string{
|
Volumes: []string{
|
||||||
// "./alr:/usr/bin/alr",
|
"./alr:/tmp/alr",
|
||||||
},
|
},
|
||||||
Privileged: true,
|
Privileged: true,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
assert.NoError(t, e2e.StartAndWaitReady(runnable))
|
assert.NoError(t, e2e.StartAndWaitReady(runnable))
|
||||||
|
err = runnable.Exec(e2e.NewCommand("/bin/alr-test-setup", "alr-install"))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
err = runnable.Exec(e2e.NewCommand("/bin/alr-test-setup", "passwordless-sudo-setup"))
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
f(t, runnable)
|
f(t, runnable)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func execShouldNoError(t *testing.T, r e2e.Runnable, cmd string, args ...string) {
|
||||||
|
assert.NoError(t, r.Exec(e2e.NewCommand(cmd, args...)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func execShouldError(t *testing.T, r e2e.Runnable, cmd string, args ...string) {
|
||||||
|
assert.Error(t, r.Exec(e2e.NewCommand(cmd, args...)))
|
||||||
|
}
|
||||||
|
|
||||||
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 +180,23 @@ func runTestCommands(t *testing.T, r e2e.Runnable, timeout time.Duration, expect
|
|||||||
)
|
)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const REPO_NAME_FOR_E2E_TESTS = "alr-repo"
|
||||||
|
const REPO_URL_FOR_E2E_TESTS = "https://gitea.plemya-x.ru/Plemya-x/repo-for-tests.git"
|
||||||
|
|
||||||
|
func defaultPrepare(t *testing.T, r e2e.Runnable) {
|
||||||
|
execShouldNoError(t, r,
|
||||||
|
"sudo",
|
||||||
|
"alr",
|
||||||
|
"repo",
|
||||||
|
"add",
|
||||||
|
REPO_NAME_FOR_E2E_TESTS,
|
||||||
|
REPO_URL_FOR_E2E_TESTS,
|
||||||
|
)
|
||||||
|
|
||||||
|
execShouldNoError(t, r,
|
||||||
|
"sudo",
|
||||||
|
"alr",
|
||||||
|
"ref",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
@@ -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,7 +21,6 @@ package e2etests_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alecthomas/assert/v2"
|
|
||||||
"github.com/efficientgo/e2e"
|
"github.com/efficientgo/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,26 +30,9 @@ func TestE2EGroupAndSummaryField(t *testing.T) {
|
|||||||
"group-and-summary-field",
|
"group-and-summary-field",
|
||||||
RPM_SYSTEMS,
|
RPM_SYSTEMS,
|
||||||
func(t *testing.T, r e2e.Runnable) {
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
err := r.Exec(e2e.NewCommand(
|
defaultPrepare(t, r)
|
||||||
"sudo",
|
execShouldNoError(t, r, "sh", "-c", "alr search --name test-group-and-summary --format \"{{.Group}}\" | grep ^System/Base$")
|
||||||
"alr",
|
execShouldNoError(t, r, "sh", "-c", "alr search --name test-group-and-summary --format \"{{.Summary}}\" | grep \"^Custom summary$\"")
|
||||||
"addrepo",
|
|
||||||
"--name",
|
|
||||||
"alr-repo",
|
|
||||||
"--url",
|
|
||||||
"https://gitea.plemya-x.ru/Maks1mS/repo-for-tests.git",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"sh", "-c", "alr search --name test-group-and-summary --format \"{{.Group}}\" | grep ^System/Base$",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"sh", "-c", "alr search --name test-group-and-summary --format \"{{.Summary}}\" | grep \"^Custom summary$\"",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM alpine:latest
|
|
||||||
RUN adduser -s /bin/bash alr-user
|
|
||||||
USER alr-user
|
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
FROM registry.altlinux.org/sisyphus/alt:latest
|
|
||||||
RUN apt-get update && apt-get install -y ca-certificates rpm-build
|
|
||||||
RUN useradd -m -s /bin/bash alr-user
|
|
||||||
USER alr-user
|
|
||||||
WORKDIR /home/alr-user
|
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM archlinux:latest
|
|
||||||
RUN useradd -m -s /bin/bash alr-user
|
|
||||||
USER alr-user
|
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
FROM fedora:41
|
|
||||||
RUN dnf install -y ca-certificates sudo rpm-build bindfs
|
|
||||||
RUN <<EOF
|
|
||||||
useradd -m -s /bin/bash -G wheel user
|
|
||||||
echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user
|
|
||||||
chmod 0440 /etc/sudoers.d/user
|
|
||||||
|
|
||||||
useradd -m -s /bin/bash alr
|
|
||||||
mkdir -p /var/cache/alr /etc/alr
|
|
||||||
chown alr:alr /var/cache/alr /etc/alr
|
|
||||||
EOF
|
|
||||||
COPY ./alr /usr/bin
|
|
||||||
RUN <<EOF
|
|
||||||
setcap cap_setuid,cap_setgid+ep /usr/bin/alr
|
|
||||||
EOF
|
|
||||||
USER user
|
|
||||||
WORKDIR /home/user
|
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM opensuse/leap:latest
|
|
||||||
RUN useradd -m -s /bin/bash alr-user
|
|
||||||
USER alr-user
|
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM registry.red-soft.ru/ubi8/ubi:latest
|
|
||||||
RUN useradd -m -s /bin/bash alr-user
|
|
||||||
USER alr-user
|
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
FROM ubuntu:24.10
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates sudo libcap2-bin
|
|
||||||
RUN <<EOF
|
|
||||||
useradd -m -s /bin/bash user
|
|
||||||
echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user
|
|
||||||
chmod 0440 /etc/sudoers.d/user
|
|
||||||
|
|
||||||
useradd -m -s /bin/bash alr
|
|
||||||
mkdir -p /var/cache/alr /etc/alr
|
|
||||||
chown alr:alr /var/cache/alr /etc/alr
|
|
||||||
EOF
|
|
||||||
COPY ./alr /usr/bin
|
|
||||||
RUN <<EOF
|
|
||||||
setcap cap_setuid,cap_setgid+ep /usr/bin/alr
|
|
||||||
EOF
|
|
||||||
USER user
|
|
||||||
ENTRYPOINT ["tail", "-f", "/dev/null"]
|
|
||||||
@@ -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,7 +21,6 @@ package e2etests_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alecthomas/assert/v2"
|
|
||||||
"github.com/efficientgo/e2e"
|
"github.com/efficientgo/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,21 +30,11 @@ func TestE2EIssue32Interactive(t *testing.T) {
|
|||||||
"issue-32-interactive",
|
"issue-32-interactive",
|
||||||
COMMON_SYSTEMS,
|
COMMON_SYSTEMS,
|
||||||
func(t *testing.T, r e2e.Runnable) {
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
assert.NoError(t, r.Exec(e2e.NewCommand(
|
execShouldNoError(t, r, "alr", "--interactive=false", "remove", "ca-certificates")
|
||||||
"sudo", "alr", "--interactive=false", "remove", "ca-certificates",
|
execShouldNoError(t, r, "sudo", "alr", "--interactive=false", "remove", "openssl")
|
||||||
)))
|
execShouldNoError(t, r, "alr", "fix")
|
||||||
|
execShouldNoError(t, r, "sudo", "apt-get", "update")
|
||||||
assert.NoError(t, r.Exec(e2e.NewCommand(
|
execShouldNoError(t, r, "sudo", "alr", "--interactive=false", "install", "ca-certificates")
|
||||||
"sudo", "alr", "--interactive=false", "remove", "openssl",
|
|
||||||
)))
|
|
||||||
|
|
||||||
assert.NoError(t, r.Exec(e2e.NewCommand(
|
|
||||||
"alr", "fix",
|
|
||||||
)))
|
|
||||||
|
|
||||||
assert.NoError(t, r.Exec(e2e.NewCommand(
|
|
||||||
"sudo", "alr", "--interactive=false", "install", "ca-certificates",
|
|
||||||
)))
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,7 +21,6 @@ package e2etests_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alecthomas/assert/v2"
|
|
||||||
"github.com/efficientgo/e2e"
|
"github.com/efficientgo/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,51 +30,11 @@ func TestE2EIssue41AutoreqSkiplist(t *testing.T) {
|
|||||||
"issue-41-autoreq-skiplist",
|
"issue-41-autoreq-skiplist",
|
||||||
AUTOREQ_AUTOPROV_SYSTEMS,
|
AUTOREQ_AUTOPROV_SYSTEMS,
|
||||||
func(t *testing.T, r e2e.Runnable) {
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
err := r.Exec(e2e.NewCommand(
|
defaultPrepare(t, r)
|
||||||
"sudo",
|
execShouldNoError(t, r, "alr", "build", "-p", "alr-repo/test-autoreq-autoprov")
|
||||||
"alr",
|
execShouldNoError(t, r, "sh", "-c", "rpm -qp --requires *.rpm | grep \"^/bin/sh$\"")
|
||||||
"addrepo",
|
execShouldError(t, r, "sh", "-c", "rpm -qp --requires *.rpm | grep \"^/bin/bash$\"")
|
||||||
"--name",
|
execShouldError(t, r, "sh", "-c", "rpm -qp --requires *.rpm | grep \"^/bin/zsh$\"")
|
||||||
"alr-repo",
|
|
||||||
"--url",
|
|
||||||
"https://gitea.plemya-x.ru/Maks1mS/repo-for-tests.git",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"alr",
|
|
||||||
"ref",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"alr",
|
|
||||||
"build",
|
|
||||||
"-p",
|
|
||||||
"alr-repo/test-autoreq-autoprov",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"sh",
|
|
||||||
"-c",
|
|
||||||
"rpm -qp --requires *.rpm | grep \"^/bin/sh$\"",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"sh",
|
|
||||||
"-c",
|
|
||||||
"rpm -qp --requires *.rpm | grep \"^/bin/bash$\"",
|
|
||||||
))
|
|
||||||
assert.Error(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"sh",
|
|
||||||
"-c",
|
|
||||||
"rpm -qp --requires *.rpm | grep \"^/bin/zsh$\"",
|
|
||||||
))
|
|
||||||
assert.Error(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
|
||||||
@@ -21,7 +21,6 @@ package e2etests_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alecthomas/assert/v2"
|
|
||||||
"github.com/efficientgo/e2e"
|
"github.com/efficientgo/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,26 +30,10 @@ func TestE2EIssue50InstallMultiple(t *testing.T) {
|
|||||||
"issue-50-install-multiple",
|
"issue-50-install-multiple",
|
||||||
COMMON_SYSTEMS,
|
COMMON_SYSTEMS,
|
||||||
func(t *testing.T, r e2e.Runnable) {
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
err := r.Exec(e2e.NewCommand(
|
defaultPrepare(t, r)
|
||||||
"sudo",
|
execShouldNoError(t, r, "sudo", "alr", "in", "foo-pkg", "bar-pkg")
|
||||||
"alr",
|
execShouldNoError(t, r, "cat", "/opt/foo")
|
||||||
"addrepo",
|
execShouldNoError(t, r, "cat", "/opt/bar")
|
||||||
"--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", "foo-pkg", "bar-pkg",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand("cat", "/opt/foo"))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
err = r.Exec(e2e.NewCommand("cat", "/opt/bar"))
|
|
||||||
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
|
||||||
@@ -21,7 +21,6 @@ package e2etests_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alecthomas/assert/v2"
|
|
||||||
"github.com/efficientgo/e2e"
|
"github.com/efficientgo/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,23 +30,8 @@ func TestE2EIssue53LcAllCInfo(t *testing.T) {
|
|||||||
"issue-53-lc-all-c-info",
|
"issue-53-lc-all-c-info",
|
||||||
COMMON_SYSTEMS,
|
COMMON_SYSTEMS,
|
||||||
func(t *testing.T, r e2e.Runnable) {
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
err := r.Exec(e2e.NewCommand(
|
defaultPrepare(t, r)
|
||||||
"sudo",
|
execShouldNoError(t, r, "bash", "-c", "LANG=C alr info foo-pkg")
|
||||||
"alr",
|
|
||||||
"addrepo",
|
|
||||||
"--name",
|
|
||||||
"alr-repo",
|
|
||||||
"--url",
|
|
||||||
"https://gitea.plemya-x.ru/Plemya-x/alr-repo.git",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand(
|
|
||||||
"bash",
|
|
||||||
"-c",
|
|
||||||
"LANG=C alr info alr-bin",
|
|
||||||
))
|
|
||||||
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
|
||||||
@@ -21,7 +21,6 @@ package e2etests_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/alecthomas/assert/v2"
|
|
||||||
"github.com/efficientgo/e2e"
|
"github.com/efficientgo/e2e"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -31,28 +30,11 @@ func TestE2EIssue59RmCompletion(t *testing.T) {
|
|||||||
"issue-59-rm-completion",
|
"issue-59-rm-completion",
|
||||||
COMMON_SYSTEMS,
|
COMMON_SYSTEMS,
|
||||||
func(t *testing.T, r e2e.Runnable) {
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
err := r.Exec(e2e.NewCommand(
|
defaultPrepare(t, r)
|
||||||
"sudo",
|
execShouldNoError(t, r, "sudo", "alr", "in", "foo-pkg", "bar-pkg")
|
||||||
"alr",
|
execShouldNoError(t, r, "sh", "-c", "alr rm --generate-bash-completion | grep ^foo-pkg$")
|
||||||
"addrepo",
|
execShouldNoError(t, r, "sh", "-c", "alr rm --generate-bash-completion | grep ^bar-pkg$")
|
||||||
"--name",
|
execShouldError(t, r, "sh", "-c", "alr rm --generate-bash-completion | grep ^test-autoreq-autoprov$")
|
||||||
"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", "foo-pkg", "bar-pkg",
|
|
||||||
))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
err = r.Exec(e2e.NewCommand("sh", "-c", "alr rm --generate-bash-completion | grep ^foo-pkg$"))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
err = r.Exec(e2e.NewCommand("sh", "-c", "alr rm --generate-bash-completion | grep ^bar-pkg$"))
|
|
||||||
assert.NoError(t, err)
|
|
||||||
err = r.Exec(e2e.NewCommand("sh", "-c", "alr rm --generate-bash-completion | grep ^test-autoreq-autoprov$"))
|
|
||||||
assert.Error(t, err)
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
37
e2e-tests/issue_72_install_with_deps_test.go
Normal file
37
e2e-tests/issue_72_install_with_deps_test.go
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// 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 TestE2EIssue72InstallWithDeps(t *testing.T) {
|
||||||
|
dockerMultipleRun(
|
||||||
|
t,
|
||||||
|
"issue-72-install-with-deps",
|
||||||
|
COMMON_SYSTEMS,
|
||||||
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
|
defaultPrepare(t, r)
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "in", "test-app-with-lib")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
43
e2e-tests/issue_74_upgradable_test.go
Normal file
43
e2e-tests/issue_74_upgradable_test.go
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// 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) {
|
||||||
|
defaultPrepare(t, r)
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "repo", "set-ref", "alr-repo", "bd26236cd7")
|
||||||
|
execShouldNoError(t, r, "alr", "ref")
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "in", "bar-pkg")
|
||||||
|
execShouldNoError(t, r, "sh", "-c", "test $(alr list -U | wc -l) -eq 0 || exit 1")
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "repo", "set-ref", "alr-repo", "d9a3541561")
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "ref")
|
||||||
|
execShouldNoError(t, r, "sh", "-c", "test $(alr list -U | wc -l) -eq 1 || exit 1")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
38
e2e-tests/issue_75_ref_specify_test.go
Normal file
38
e2e-tests/issue_75_ref_specify_test.go
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
// 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 TestE2EIssue75InstallWithDeps(t *testing.T) {
|
||||||
|
dockerMultipleRun(
|
||||||
|
t,
|
||||||
|
"issue-75-ref-specify",
|
||||||
|
COMMON_SYSTEMS,
|
||||||
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
|
defaultPrepare(t, r)
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "repo", "set-ref", "alr-repo", "bd26236cd7")
|
||||||
|
execShouldNoError(t, r, "sh", "-c", "test $(alr list | wc -l) -eq 2 || exit 1")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
38
e2e-tests/issue_81_multiple_packages_test.go
Normal file
38
e2e-tests/issue_81_multiple_packages_test.go
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
// 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 TestE2EIssue81MultiplePackages(t *testing.T) {
|
||||||
|
dockerMultipleRun(
|
||||||
|
t,
|
||||||
|
"issue-81-multiple-packages",
|
||||||
|
COMMON_SYSTEMS,
|
||||||
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
|
defaultPrepare(t, r)
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "in", "first-package-with-dashes")
|
||||||
|
execShouldNoError(t, r, "cat", "/opt/first-package")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
40
e2e-tests/issue_91_set_repo_ref_test.go
Normal file
40
e2e-tests/issue_91_set_repo_ref_test.go
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
// 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 TestE2EIssue91MultiplePackages(t *testing.T) {
|
||||||
|
dockerMultipleRun(
|
||||||
|
t,
|
||||||
|
"issue-91-set-repo-ref",
|
||||||
|
COMMON_SYSTEMS,
|
||||||
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
|
defaultPrepare(t, r)
|
||||||
|
execShouldError(t, r, "sudo", "alr", "repo", "set-ref")
|
||||||
|
execShouldError(t, r, "sudo", "alr", "repo", "set-ref", "alr-repo")
|
||||||
|
execShouldNoError(t, r, "sudo", "alr", "repo", "set-ref", "alr-repo", "bd26236cd7")
|
||||||
|
execShouldNoError(t, r, "sh", "-c", "test $(alr list | wc -l) -eq 2 || exit 1")
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
49
e2e-tests/issue_94_twice_build_test.go
Normal file
49
e2e-tests/issue_94_twice_build_test.go
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/>.
|
||||||
|
|
||||||
|
//go:build e2e
|
||||||
|
|
||||||
|
package e2etests_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/efficientgo/e2e"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestE2EIssue94TwiceBuild(t *testing.T) {
|
||||||
|
dockerMultipleRun(
|
||||||
|
t,
|
||||||
|
"issue-94-twice-build",
|
||||||
|
COMMON_SYSTEMS,
|
||||||
|
func(t *testing.T, r e2e.Runnable) {
|
||||||
|
defaultPrepare(t, r)
|
||||||
|
|
||||||
|
var stderr bytes.Buffer
|
||||||
|
err := r.Exec(
|
||||||
|
e2e.NewCommand("sudo", "alr", "in", "test-94-app"),
|
||||||
|
e2e.WithExecOptionStderr(&stderr),
|
||||||
|
)
|
||||||
|
assert.NoError(t, err, "command failed")
|
||||||
|
|
||||||
|
output := stderr.String()
|
||||||
|
assert.Equal(t, 1, strings.Count(output, "Building package name=test-94-dep"))
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
6
gen.go
6
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
|
||||||
@@ -25,7 +25,7 @@ import (
|
|||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/gen"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/gen"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GenCmd() *cli.Command {
|
func GenCmd() *cli.Command {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
30
install.go
30
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
|
||||||
@@ -25,13 +25,13 @@ import (
|
|||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/build"
|
||||||
"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"
|
||||||
database "gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
database "gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/utils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/utils"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/build"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func InstallCmd() *cli.Command {
|
func InstallCmd() *cli.Command {
|
||||||
@@ -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)
|
||||||
@@ -102,7 +98,7 @@ func InstallCmd() *cli.Command {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = builder.InstallPkgs(
|
_, err = builder.InstallPkgs(
|
||||||
ctx,
|
ctx,
|
||||||
&build.BuildArgs{
|
&build.BuildArgs{
|
||||||
Opts: &types.BuildOpts{
|
Opts: &types.BuildOpts{
|
||||||
@@ -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
|
||||||
@@ -32,14 +32,14 @@ import (
|
|||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/build"
|
||||||
"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"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/constants"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/constants"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/logger"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/logger"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/utils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/utils"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/build"
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func InternalBuildCmd() *cli.Command {
|
func InternalBuildCmd() *cli.Command {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -27,15 +27,14 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
"mvdan.cc/sh/v3/syntax"
|
|
||||||
"mvdan.cc/sh/v3/syntax/typedjson"
|
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/alrsh"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BuildInput struct {
|
type BuildInput struct {
|
||||||
@@ -133,50 +132,29 @@ type RepositoryProvider interface {
|
|||||||
|
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|
||||||
type ScriptFile struct {
|
type BuiltDep struct {
|
||||||
File *syntax.File
|
Name string
|
||||||
Path string
|
Path string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScriptFile) GobEncode() ([]byte, error) {
|
func Map[T, R any](items []T, f func(T) R) []R {
|
||||||
var buf bytes.Buffer
|
res := make([]R, len(items))
|
||||||
enc := gob.NewEncoder(&buf)
|
for i, item := range items {
|
||||||
if err := enc.Encode(s.Path); err != nil {
|
res[i] = f(item)
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
var fileBuf bytes.Buffer
|
return res
|
||||||
if err := typedjson.Encode(&fileBuf, s.File); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
fileData := fileBuf.Bytes()
|
|
||||||
if err := enc.Encode(fileData); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return buf.Bytes(), nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScriptFile) GobDecode(data []byte) error {
|
func GetBuiltPaths(deps []*BuiltDep) []string {
|
||||||
buf := bytes.NewBuffer(data)
|
return Map(deps, func(dep *BuiltDep) string {
|
||||||
dec := gob.NewDecoder(buf)
|
return dep.Path
|
||||||
if err := dec.Decode(&s.Path); err != nil {
|
})
|
||||||
return err
|
|
||||||
}
|
|
||||||
var fileData []byte
|
|
||||||
if err := dec.Decode(&fileData); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
fileReader := bytes.NewReader(fileData)
|
|
||||||
file, err := typedjson.Decode(fileReader)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
s.File = file.(*syntax.File)
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type BuildResult struct {
|
func GetBuiltName(deps []*BuiltDep) []string {
|
||||||
PackagePaths []string
|
return Map(deps, func(dep *BuiltDep) string {
|
||||||
PackageNames []string
|
return dep.Name
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type PackageFinder interface {
|
type PackageFinder interface {
|
||||||
@@ -199,8 +177,8 @@ type ScriptResolverExecutor interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ScriptExecutor interface {
|
type ScriptExecutor interface {
|
||||||
ReadScript(ctx context.Context, scriptPath string) (*ScriptFile, error)
|
ReadScript(ctx context.Context, scriptPath string) (*alrsh.ALRSh, error)
|
||||||
ExecuteFirstPass(ctx context.Context, input *BuildInput, sf *ScriptFile) (string, []*types.BuildVars, error)
|
ExecuteFirstPass(ctx context.Context, input *BuildInput, sf *alrsh.ALRSh) (string, []*types.BuildVars, error)
|
||||||
PrepareDirs(
|
PrepareDirs(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
input *BuildInput,
|
input *BuildInput,
|
||||||
@@ -209,12 +187,12 @@ type ScriptExecutor interface {
|
|||||||
ExecuteSecondPass(
|
ExecuteSecondPass(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
input *BuildInput,
|
input *BuildInput,
|
||||||
sf *ScriptFile,
|
sf *alrsh.ALRSh,
|
||||||
varsOfPackages []*types.BuildVars,
|
varsOfPackages []*types.BuildVars,
|
||||||
repoDeps []string,
|
repoDeps []string,
|
||||||
builtNames []string,
|
builtDeps []*BuiltDep,
|
||||||
basePkg string,
|
basePkg string,
|
||||||
) (*SecondPassResult, error)
|
) ([]*BuiltDep, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type CacheExecutor interface {
|
type CacheExecutor interface {
|
||||||
@@ -222,7 +200,7 @@ type CacheExecutor interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ScriptViewerExecutor interface {
|
type ScriptViewerExecutor interface {
|
||||||
ViewScript(ctx context.Context, input *BuildInput, sf *ScriptFile, basePkg string) error
|
ViewScript(ctx context.Context, input *BuildInput, sf *alrsh.ALRSh, basePkg string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type CheckerExecutor interface {
|
type CheckerExecutor interface {
|
||||||
@@ -320,7 +298,7 @@ type BuildPackageFromScriptArgs struct {
|
|||||||
func (b *Builder) BuildPackageFromDb(
|
func (b *Builder) BuildPackageFromDb(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
args *BuildPackageFromDbArgs,
|
args *BuildPackageFromDbArgs,
|
||||||
) (*BuildResult, error) {
|
) ([]*BuiltDep, error) {
|
||||||
scriptInfo := b.scriptResolver.ResolveScript(ctx, args.Package)
|
scriptInfo := b.scriptResolver.ResolveScript(ctx, args.Package)
|
||||||
|
|
||||||
return b.BuildPackage(ctx, &BuildInput{
|
return b.BuildPackage(ctx, &BuildInput{
|
||||||
@@ -336,7 +314,7 @@ func (b *Builder) BuildPackageFromDb(
|
|||||||
func (b *Builder) BuildPackageFromScript(
|
func (b *Builder) BuildPackageFromScript(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
args *BuildPackageFromScriptArgs,
|
args *BuildPackageFromScriptArgs,
|
||||||
) (*BuildResult, error) {
|
) ([]*BuiltDep, error) {
|
||||||
return b.BuildPackage(ctx, &BuildInput{
|
return b.BuildPackage(ctx, &BuildInput{
|
||||||
script: args.Script,
|
script: args.Script,
|
||||||
repository: "default",
|
repository: "default",
|
||||||
@@ -350,7 +328,7 @@ func (b *Builder) BuildPackageFromScript(
|
|||||||
func (b *Builder) BuildPackage(
|
func (b *Builder) BuildPackage(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
input *BuildInput,
|
input *BuildInput,
|
||||||
) (*BuildResult, error) {
|
) ([]*BuiltDep, error) {
|
||||||
scriptPath := input.script
|
scriptPath := input.script
|
||||||
|
|
||||||
slog.Debug("ReadScript")
|
slog.Debug("ReadScript")
|
||||||
@@ -365,7 +343,7 @@ func (b *Builder) BuildPackage(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
builtPaths := make([]string, 0)
|
var builtDeps []*BuiltDep
|
||||||
|
|
||||||
if !input.opts.Clean {
|
if !input.opts.Clean {
|
||||||
var remainingVars []*types.BuildVars
|
var remainingVars []*types.BuildVars
|
||||||
@@ -375,14 +353,16 @@ func (b *Builder) BuildPackage(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if ok {
|
if ok {
|
||||||
builtPaths = append(builtPaths, builtPkgPath)
|
builtDeps = append(builtDeps, &BuiltDep{
|
||||||
|
Path: builtPkgPath,
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
remainingVars = append(remainingVars, vars)
|
remainingVars = append(remainingVars, vars)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(remainingVars) == 0 {
|
if len(remainingVars) == 0 {
|
||||||
return &BuildResult{builtPaths, nil}, nil
|
return builtDeps, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,19 +407,32 @@ func (b *Builder) BuildPackage(
|
|||||||
sources, checksums = removeDuplicatesSources(sources, checksums)
|
sources, checksums = removeDuplicatesSources(sources, checksums)
|
||||||
|
|
||||||
slog.Debug("installBuildDeps")
|
slog.Debug("installBuildDeps")
|
||||||
err = b.installBuildDeps(ctx, input, buildDepends)
|
alrBuildDeps, err := b.installBuildDeps(ctx, input, buildDepends)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
slog.Debug("installOptDeps")
|
slog.Debug("installOptDeps")
|
||||||
err = b.installOptDeps(ctx, input, optDepends)
|
_, err = b.installOptDeps(ctx, input, optDepends)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
depNames := make(map[string]struct{})
|
||||||
|
for _, dep := range alrBuildDeps {
|
||||||
|
depNames[dep.Name] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// We filter so as not to re-build what has already been built at the `installBuildDeps` stage.
|
||||||
|
var filteredDepends []string
|
||||||
|
for _, d := range depends {
|
||||||
|
if _, found := depNames[d]; !found {
|
||||||
|
filteredDepends = append(filteredDepends, d)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
slog.Debug("BuildALRDeps")
|
slog.Debug("BuildALRDeps")
|
||||||
_, builtNames, repoDeps, err := b.BuildALRDeps(ctx, input, depends)
|
newBuiltDeps, repoDeps, err := b.BuildALRDeps(ctx, input, filteredDepends)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -450,8 +443,6 @@ func (b *Builder) BuildPackage(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// builtPaths = append(builtPaths, newBuildPaths...)
|
|
||||||
|
|
||||||
slog.Info(gotext.Get("Downloading sources"))
|
slog.Info(gotext.Get("Downloading sources"))
|
||||||
slog.Debug("DownloadSources")
|
slog.Debug("DownloadSources")
|
||||||
err = b.sourceExecutor.DownloadSources(
|
err = b.sourceExecutor.DownloadSources(
|
||||||
@@ -467,6 +458,8 @@ func (b *Builder) BuildPackage(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builtDeps = removeDuplicates(append(builtDeps, newBuiltDeps...))
|
||||||
|
|
||||||
slog.Debug("ExecuteSecondPass")
|
slog.Debug("ExecuteSecondPass")
|
||||||
res, err := b.scriptExecutor.ExecuteSecondPass(
|
res, err := b.scriptExecutor.ExecuteSecondPass(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -474,20 +467,16 @@ func (b *Builder) BuildPackage(
|
|||||||
sf,
|
sf,
|
||||||
varsOfPackages,
|
varsOfPackages,
|
||||||
repoDeps,
|
repoDeps,
|
||||||
builtNames,
|
builtDeps,
|
||||||
basePkg,
|
basePkg,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgPaths := removeDuplicates(res.BuiltPaths)
|
builtDeps = removeDuplicates(append(builtDeps, res...))
|
||||||
pkgNames := removeDuplicates(res.BuiltNames)
|
|
||||||
|
|
||||||
return &BuildResult{
|
return builtDeps, nil
|
||||||
PackagePaths: pkgPaths,
|
|
||||||
PackageNames: pkgNames,
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type InstallPkgsArgs struct {
|
type InstallPkgsArgs struct {
|
||||||
@@ -523,7 +512,7 @@ func (b *Builder) InstallALRPackages(
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = b.installerExecutor.InstallLocal(
|
err = b.installerExecutor.InstallLocal(
|
||||||
res.PackagePaths,
|
GetBuiltPaths(res),
|
||||||
&manager.Opts{
|
&manager.Opts{
|
||||||
NoConfirm: !input.BuildOpts().Interactive,
|
NoConfirm: !input.BuildOpts().Interactive,
|
||||||
},
|
},
|
||||||
@@ -544,13 +533,13 @@ func (b *Builder) BuildALRDeps(
|
|||||||
PkgFormatProvider
|
PkgFormatProvider
|
||||||
},
|
},
|
||||||
depends []string,
|
depends []string,
|
||||||
) (builtPaths, builtNames, repoDeps []string, err error) {
|
) (buildDeps []*BuiltDep, repoDeps []string, err error) {
|
||||||
if len(depends) > 0 {
|
if len(depends) > 0 {
|
||||||
slog.Info(gotext.Get("Installing dependencies"))
|
slog.Info(gotext.Get("Installing dependencies"))
|
||||||
|
|
||||||
found, notFound, err := b.repos.FindPkgs(ctx, depends) // Поиск зависимостей
|
found, notFound, err := b.repos.FindPkgs(ctx, depends) // Поиск зависимостей
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
repoDeps = notFound
|
repoDeps = notFound
|
||||||
|
|
||||||
@@ -597,20 +586,17 @@ func (b *Builder) BuildALRDeps(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
builtPaths = append(builtPaths, res.PackagePaths...)
|
buildDeps = append(buildDeps, res...)
|
||||||
builtNames = append(builtNames, res.PackageNames...)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Удаляем возможные дубликаты, которые могут быть введены, если
|
|
||||||
// несколько зависимостей зависят от одних и тех же пакетов.
|
|
||||||
repoDeps = removeDuplicates(repoDeps)
|
repoDeps = removeDuplicates(repoDeps)
|
||||||
builtPaths = removeDuplicates(builtPaths)
|
buildDeps = removeDuplicates(buildDeps)
|
||||||
builtNames = removeDuplicates(builtNames)
|
|
||||||
return builtPaths, builtNames, repoDeps, nil
|
return buildDeps, repoDeps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Builder) installBuildDeps(
|
func (i *Builder) installBuildDeps(
|
||||||
@@ -621,19 +607,20 @@ func (i *Builder) installBuildDeps(
|
|||||||
PkgFormatProvider
|
PkgFormatProvider
|
||||||
},
|
},
|
||||||
pkgs []string,
|
pkgs []string,
|
||||||
) error {
|
) ([]*BuiltDep, error) {
|
||||||
|
var builtDeps []*BuiltDep
|
||||||
if len(pkgs) > 0 {
|
if len(pkgs) > 0 {
|
||||||
deps, err := i.installerExecutor.RemoveAlreadyInstalled(pkgs)
|
deps, err := i.installerExecutor.RemoveAlreadyInstalled(pkgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = i.InstallPkgs(ctx, input, deps) // Устанавливаем выбранные пакеты
|
builtDeps, err = i.InstallPkgs(ctx, input, deps) // Устанавливаем выбранные пакеты
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return builtDeps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Builder) installOptDeps(
|
func (i *Builder) installOptDeps(
|
||||||
@@ -644,10 +631,11 @@ func (i *Builder) installOptDeps(
|
|||||||
PkgFormatProvider
|
PkgFormatProvider
|
||||||
},
|
},
|
||||||
pkgs []string,
|
pkgs []string,
|
||||||
) error {
|
) ([]*BuiltDep, error) {
|
||||||
|
var builtDeps []*BuiltDep
|
||||||
optDeps, err := i.installerExecutor.RemoveAlreadyInstalled(pkgs)
|
optDeps, err := i.installerExecutor.RemoveAlreadyInstalled(pkgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
if len(optDeps) > 0 {
|
if len(optDeps) > 0 {
|
||||||
optDeps, err := cliutils.ChooseOptDepends(
|
optDeps, err := cliutils.ChooseOptDepends(
|
||||||
@@ -657,19 +645,19 @@ func (i *Builder) installOptDeps(
|
|||||||
input.BuildOpts().Interactive,
|
input.BuildOpts().Interactive,
|
||||||
) // Пользователя просят выбрать опциональные зависимости
|
) // Пользователя просят выбрать опциональные зависимости
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(optDeps) == 0 {
|
if len(optDeps) == 0 {
|
||||||
return nil
|
return builtDeps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = i.InstallPkgs(ctx, input, optDeps) // Устанавливаем выбранные пакеты
|
builtDeps, err = i.InstallPkgs(ctx, input, optDeps) // Устанавливаем выбранные пакеты
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return builtDeps, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Builder) InstallPkgs(
|
func (i *Builder) InstallPkgs(
|
||||||
@@ -680,18 +668,18 @@ func (i *Builder) InstallPkgs(
|
|||||||
PkgFormatProvider
|
PkgFormatProvider
|
||||||
},
|
},
|
||||||
pkgs []string,
|
pkgs []string,
|
||||||
) error {
|
) ([]*BuiltDep, error) {
|
||||||
builtPaths, _, repoDeps, err := i.BuildALRDeps(ctx, input, pkgs)
|
builtDeps, repoDeps, err := i.BuildALRDeps(ctx, input, pkgs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(builtPaths) > 0 {
|
if len(builtDeps) > 0 {
|
||||||
err = i.installerExecutor.InstallLocal(builtPaths, &manager.Opts{
|
err = i.installerExecutor.InstallLocal(GetBuiltPaths(builtDeps), &manager.Opts{
|
||||||
NoConfirm: !input.BuildOpts().Interactive,
|
NoConfirm: !input.BuildOpts().Interactive,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -700,9 +688,9 @@ func (i *Builder) InstallPkgs(
|
|||||||
NoConfirm: !input.BuildOpts().Interactive,
|
NoConfirm: !input.BuildOpts().Interactive,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return builtDeps, 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
|
||||||
@@ -28,9 +28,9 @@ import (
|
|||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TestPackageFinder struct {
|
type TestPackageFinder struct {
|
||||||
@@ -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
|
||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
"github.com/goreleaser/nfpm/v2"
|
"github.com/goreleaser/nfpm/v2"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cache struct {
|
type Cache struct {
|
||||||
@@ -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
|
||||||
@@ -24,8 +24,8 @@ import (
|
|||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cpu"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cpu"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Checker struct {
|
type Checker struct {
|
||||||
@@ -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,7 +19,7 @@ package build
|
|||||||
import (
|
import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BaseDirProvider interface {
|
type BaseDirProvider interface {
|
||||||
@@ -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
|
||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
"github.com/goreleaser/nfpm/v2"
|
"github.com/goreleaser/nfpm/v2"
|
||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func rpmFindDependenciesALTLinux(ctx context.Context, pkgInfo *nfpm.Info, dirs types.Directories, command string, envs []string, updateFunc func(string)) error {
|
func rpmFindDependenciesALTLinux(ctx context.Context, pkgInfo *nfpm.Info, dirs types.Directories, command string, envs []string, updateFunc func(string)) error {
|
||||||
@@ -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
|
||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
"github.com/goreleaser/nfpm/v2"
|
"github.com/goreleaser/nfpm/v2"
|
||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EmptyFindProvReq struct{}
|
type EmptyFindProvReq struct{}
|
||||||
@@ -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
|
||||||
@@ -28,7 +28,7 @@ import (
|
|||||||
"github.com/goreleaser/nfpm/v2"
|
"github.com/goreleaser/nfpm/v2"
|
||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FedoraFindProvReq struct{}
|
type FedoraFindProvReq struct{}
|
||||||
@@ -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,8 +21,8 @@ import (
|
|||||||
|
|
||||||
"github.com/goreleaser/nfpm/v2"
|
"github.com/goreleaser/nfpm/v2"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProvReqFinder interface {
|
type ProvReqFinder interface {
|
||||||
@@ -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
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewInstaller(mgr manager.Manager) *Installer {
|
func NewInstaller(mgr manager.Manager) *Installer {
|
||||||
@@ -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
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
package build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewMainBuilder(
|
func NewMainBuilder(
|
||||||
@@ -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
|
||||||
@@ -28,7 +28,7 @@ import (
|
|||||||
"github.com/hashicorp/go-plugin"
|
"github.com/hashicorp/go-plugin"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/logger"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/logger"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InstallerPlugin struct {
|
type InstallerPlugin struct {
|
||||||
@@ -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
|
||||||
@@ -28,7 +28,8 @@ import (
|
|||||||
"github.com/hashicorp/go-plugin"
|
"github.com/hashicorp/go-plugin"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/logger"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/logger"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/alrsh"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var HandshakeConfig = plugin.HandshakeConfig{
|
var HandshakeConfig = plugin.HandshakeConfig{
|
||||||
@@ -50,13 +51,13 @@ type ScriptExecutorRPCServer struct {
|
|||||||
// ReadScript
|
// ReadScript
|
||||||
//
|
//
|
||||||
|
|
||||||
func (s *ScriptExecutorRPC) ReadScript(ctx context.Context, scriptPath string) (*ScriptFile, error) {
|
func (s *ScriptExecutorRPC) ReadScript(ctx context.Context, scriptPath string) (*alrsh.ALRSh, error) {
|
||||||
var resp *ScriptFile
|
var resp *alrsh.ALRSh
|
||||||
err := s.client.Call("Plugin.ReadScript", scriptPath, &resp)
|
err := s.client.Call("Plugin.ReadScript", scriptPath, &resp)
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScriptExecutorRPCServer) ReadScript(scriptPath string, resp *ScriptFile) error {
|
func (s *ScriptExecutorRPCServer) ReadScript(scriptPath string, resp *alrsh.ALRSh) error {
|
||||||
file, err := s.Impl.ReadScript(context.Background(), scriptPath)
|
file, err := s.Impl.ReadScript(context.Background(), scriptPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -72,7 +73,7 @@ func (s *ScriptExecutorRPCServer) ReadScript(scriptPath string, resp *ScriptFile
|
|||||||
|
|
||||||
type ExecuteFirstPassArgs struct {
|
type ExecuteFirstPassArgs struct {
|
||||||
Input *BuildInput
|
Input *BuildInput
|
||||||
Sf *ScriptFile
|
Sf *alrsh.ALRSh
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExecuteFirstPassResp struct {
|
type ExecuteFirstPassResp struct {
|
||||||
@@ -80,7 +81,7 @@ type ExecuteFirstPassResp struct {
|
|||||||
VarsOfPackages []*types.BuildVars
|
VarsOfPackages []*types.BuildVars
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScriptExecutorRPC) ExecuteFirstPass(ctx context.Context, input *BuildInput, sf *ScriptFile) (string, []*types.BuildVars, error) {
|
func (s *ScriptExecutorRPC) ExecuteFirstPass(ctx context.Context, input *BuildInput, sf *alrsh.ALRSh) (string, []*types.BuildVars, error) {
|
||||||
var resp *ExecuteFirstPassResp
|
var resp *ExecuteFirstPassResp
|
||||||
err := s.client.Call("Plugin.ExecuteFirstPass", &ExecuteFirstPassArgs{
|
err := s.client.Call("Plugin.ExecuteFirstPass", &ExecuteFirstPassArgs{
|
||||||
Input: input,
|
Input: input,
|
||||||
@@ -148,29 +149,29 @@ func (s *ScriptExecutorRPCServer) PrepareDirs(args *PrepareDirsArgs, reply *stru
|
|||||||
|
|
||||||
type ExecuteSecondPassArgs struct {
|
type ExecuteSecondPassArgs struct {
|
||||||
Input *BuildInput
|
Input *BuildInput
|
||||||
Sf *ScriptFile
|
Sf *alrsh.ALRSh
|
||||||
VarsOfPackages []*types.BuildVars
|
VarsOfPackages []*types.BuildVars
|
||||||
RepoDeps []string
|
RepoDeps []string
|
||||||
BuiltNames []string
|
BuiltDeps []*BuiltDep
|
||||||
BasePkg string
|
BasePkg string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScriptExecutorRPC) ExecuteSecondPass(
|
func (s *ScriptExecutorRPC) ExecuteSecondPass(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
input *BuildInput,
|
input *BuildInput,
|
||||||
sf *ScriptFile,
|
sf *alrsh.ALRSh,
|
||||||
varsOfPackages []*types.BuildVars,
|
varsOfPackages []*types.BuildVars,
|
||||||
repoDeps []string,
|
repoDeps []string,
|
||||||
builtNames []string,
|
builtDeps []*BuiltDep,
|
||||||
basePkg string,
|
basePkg string,
|
||||||
) (*SecondPassResult, error) {
|
) ([]*BuiltDep, error) {
|
||||||
var resp *SecondPassResult
|
var resp []*BuiltDep
|
||||||
err := s.client.Call("Plugin.ExecuteSecondPass", &ExecuteSecondPassArgs{
|
err := s.client.Call("Plugin.ExecuteSecondPass", &ExecuteSecondPassArgs{
|
||||||
Input: input,
|
Input: input,
|
||||||
Sf: sf,
|
Sf: sf,
|
||||||
VarsOfPackages: varsOfPackages,
|
VarsOfPackages: varsOfPackages,
|
||||||
RepoDeps: repoDeps,
|
RepoDeps: repoDeps,
|
||||||
BuiltNames: builtNames,
|
BuiltDeps: builtDeps,
|
||||||
BasePkg: basePkg,
|
BasePkg: basePkg,
|
||||||
}, &resp)
|
}, &resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -179,20 +180,20 @@ func (s *ScriptExecutorRPC) ExecuteSecondPass(
|
|||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ScriptExecutorRPCServer) ExecuteSecondPass(args *ExecuteSecondPassArgs, resp *SecondPassResult) error {
|
func (s *ScriptExecutorRPCServer) ExecuteSecondPass(args *ExecuteSecondPassArgs, resp *[]*BuiltDep) error {
|
||||||
res, err := s.Impl.ExecuteSecondPass(
|
res, err := s.Impl.ExecuteSecondPass(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
args.Input,
|
args.Input,
|
||||||
args.Sf,
|
args.Sf,
|
||||||
args.VarsOfPackages,
|
args.VarsOfPackages,
|
||||||
args.RepoDeps,
|
args.RepoDeps,
|
||||||
args.BuiltNames,
|
args.BuiltDeps,
|
||||||
args.BasePkg,
|
args.BasePkg,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
*resp = *res
|
*resp = res
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,6 +238,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
|
||||||
@@ -19,7 +19,6 @@ package build
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
@@ -36,12 +35,12 @@ import (
|
|||||||
"mvdan.cc/sh/v3/interp"
|
"mvdan.cc/sh/v3/interp"
|
||||||
"mvdan.cc/sh/v3/syntax"
|
"mvdan.cc/sh/v3/syntax"
|
||||||
|
|
||||||
|
finddeps "gitea.plemya-x.ru/Plemya-x/ALR/internal/build/find_deps"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/shutils/decoder"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/shutils/decoder"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/shutils/handlers"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/shutils/handlers"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/shutils/helpers"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/shutils/helpers"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/alrsh"
|
||||||
finddeps "gitea.plemya-x.ru/Plemya-x/ALR/pkg/build/find_deps"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type LocalScriptExecutor struct {
|
type LocalScriptExecutor struct {
|
||||||
@@ -54,103 +53,12 @@ func NewLocalScriptExecutor(cfg Config) *LocalScriptExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *LocalScriptExecutor) ReadScript(ctx context.Context, scriptPath string) (*ScriptFile, error) {
|
func (e *LocalScriptExecutor) ReadScript(ctx context.Context, scriptPath string) (*alrsh.ALRSh, error) {
|
||||||
fl, err := readScript(scriptPath)
|
return alrsh.ReadFromLocal(scriptPath)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return &ScriptFile{
|
|
||||||
Path: scriptPath,
|
|
||||||
File: fl,
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *LocalScriptExecutor) ExecuteFirstPass(ctx context.Context, input *BuildInput, sf *ScriptFile) (string, []*types.BuildVars, error) {
|
func (e *LocalScriptExecutor) ExecuteFirstPass(ctx context.Context, input *BuildInput, sf *alrsh.ALRSh) (string, []*types.BuildVars, error) {
|
||||||
varsOfPackages := []*types.BuildVars{}
|
return sf.ParseBuildVars(ctx, input.info, input.packages)
|
||||||
|
|
||||||
scriptDir := filepath.Dir(sf.Path)
|
|
||||||
env := createBuildEnvVars(input.info, types.Directories{ScriptDir: scriptDir})
|
|
||||||
|
|
||||||
runner, err := interp.New(
|
|
||||||
interp.Env(expand.ListEnviron(env...)), // Устанавливаем окружение
|
|
||||||
interp.StdIO(os.Stdin, os.Stdout, os.Stderr), // Устанавливаем стандартный ввод-вывод
|
|
||||||
interp.ExecHandler(helpers.Restricted.ExecHandler(handlers.NopExec)), // Ограничиваем выполнение
|
|
||||||
interp.ReadDirHandler2(handlers.RestrictedReadDir(scriptDir)), // Ограничиваем чтение директорий
|
|
||||||
interp.StatHandler(handlers.RestrictedStat(scriptDir)), // Ограничиваем доступ к статистике файлов
|
|
||||||
interp.OpenHandler(handlers.RestrictedOpen(scriptDir)), // Ограничиваем открытие файлов
|
|
||||||
interp.Dir(scriptDir),
|
|
||||||
)
|
|
||||||
if err != nil {
|
|
||||||
return "", nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = runner.Run(ctx, sf.File) // Запускаем скрипт
|
|
||||||
if err != nil {
|
|
||||||
return "", nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
dec := decoder.New(input.info, runner) // Создаём новый декодер
|
|
||||||
|
|
||||||
type packages struct {
|
|
||||||
BasePkgName string `sh:"basepkg_name"`
|
|
||||||
Names []string `sh:"name"`
|
|
||||||
}
|
|
||||||
|
|
||||||
var pkgs packages
|
|
||||||
err = dec.DecodeVars(&pkgs)
|
|
||||||
if err != nil {
|
|
||||||
return "", nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(pkgs.Names) == 0 {
|
|
||||||
return "", nil, errors.New("package name is missing")
|
|
||||||
}
|
|
||||||
|
|
||||||
var vars types.BuildVars
|
|
||||||
|
|
||||||
if len(pkgs.Names) == 1 {
|
|
||||||
err = dec.DecodeVars(&vars) // Декодируем переменные
|
|
||||||
if err != nil {
|
|
||||||
return "", nil, err
|
|
||||||
}
|
|
||||||
varsOfPackages = append(varsOfPackages, &vars)
|
|
||||||
|
|
||||||
return vars.Name, varsOfPackages, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(input.packages) == 0 {
|
|
||||||
return "", nil, errors.New("script has multiple packages but package is not specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, pkgName := range input.packages {
|
|
||||||
var preVars types.BuildVarsPre
|
|
||||||
funcName := fmt.Sprintf("meta_%s", pkgName)
|
|
||||||
meta, ok := dec.GetFuncWithSubshell(funcName)
|
|
||||||
if !ok {
|
|
||||||
return "", nil, errors.New("func is missing")
|
|
||||||
}
|
|
||||||
r, err := meta(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return "", nil, err
|
|
||||||
}
|
|
||||||
d := decoder.New(&distro.OSRelease{}, r)
|
|
||||||
err = d.DecodeVars(&preVars)
|
|
||||||
if err != nil {
|
|
||||||
return "", nil, err
|
|
||||||
}
|
|
||||||
vars := preVars.ToBuildVars()
|
|
||||||
vars.Name = pkgName
|
|
||||||
vars.Base = pkgs.BasePkgName
|
|
||||||
|
|
||||||
varsOfPackages = append(varsOfPackages, &vars)
|
|
||||||
}
|
|
||||||
|
|
||||||
return pkgs.BasePkgName, varsOfPackages, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type SecondPassResult struct {
|
|
||||||
BuiltPaths []string
|
|
||||||
BuiltNames []string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *LocalScriptExecutor) PrepareDirs(
|
func (e *LocalScriptExecutor) PrepareDirs(
|
||||||
@@ -178,13 +86,13 @@ func (e *LocalScriptExecutor) PrepareDirs(
|
|||||||
func (e *LocalScriptExecutor) ExecuteSecondPass(
|
func (e *LocalScriptExecutor) ExecuteSecondPass(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
input *BuildInput,
|
input *BuildInput,
|
||||||
sf *ScriptFile,
|
sf *alrsh.ALRSh,
|
||||||
varsOfPackages []*types.BuildVars,
|
varsOfPackages []*types.BuildVars,
|
||||||
repoDeps []string,
|
repoDeps []string,
|
||||||
builtNames []string,
|
builtDeps []*BuiltDep,
|
||||||
basePkg string,
|
basePkg string,
|
||||||
) (*SecondPassResult, error) {
|
) ([]*BuiltDep, error) {
|
||||||
dirs, err := getDirs(e.cfg, sf.Path, basePkg)
|
dirs, err := getDirs(e.cfg, sf.Path(), basePkg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -193,7 +101,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
|
||||||
@@ -202,14 +110,14 @@ func (e *LocalScriptExecutor) ExecuteSecondPass(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = runner.Run(ctx, sf.File)
|
err = runner.Run(ctx, sf.File())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
dec := decoder.New(input.info, runner)
|
dec := decoder.New(input.info, runner)
|
||||||
|
|
||||||
var builtPaths []string
|
// var builtPaths []string
|
||||||
|
|
||||||
err = e.ExecuteFunctions(ctx, dirs, dec)
|
err = e.ExecuteFunctions(ctx, dirs, dec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -243,7 +151,7 @@ func (e *LocalScriptExecutor) ExecuteSecondPass(
|
|||||||
dirs,
|
dirs,
|
||||||
append(
|
append(
|
||||||
repoDeps,
|
repoDeps,
|
||||||
builtNames...,
|
GetBuiltName(builtDeps)...,
|
||||||
),
|
),
|
||||||
funcOut.Contents,
|
funcOut.Contents,
|
||||||
)
|
)
|
||||||
@@ -269,14 +177,13 @@ func (e *LocalScriptExecutor) ExecuteSecondPass(
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
builtPaths = append(builtPaths, pkgPath)
|
builtDeps = append(builtDeps, &BuiltDep{
|
||||||
builtNames = append(builtNames, vars.Name)
|
Name: vars.Name,
|
||||||
|
Path: pkgPath,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return &SecondPassResult{
|
return builtDeps, nil
|
||||||
BuiltPaths: builtPaths,
|
|
||||||
BuiltNames: builtNames,
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildPkgMetadata(
|
func buildPkgMetadata(
|
||||||
@@ -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
|
||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/alrsh"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ScriptViewerConfig interface {
|
type ScriptViewerConfig interface {
|
||||||
@@ -33,12 +34,12 @@ type ScriptViewer struct {
|
|||||||
func (s *ScriptViewer) ViewScript(
|
func (s *ScriptViewer) ViewScript(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
input *BuildInput,
|
input *BuildInput,
|
||||||
sf *ScriptFile,
|
a *alrsh.ALRSh,
|
||||||
basePkg string,
|
basePkg string,
|
||||||
) error {
|
) error {
|
||||||
return cliutils.PromptViewScript(
|
return cliutils.PromptViewScript(
|
||||||
ctx,
|
ctx,
|
||||||
sf.Path,
|
a.Path(),
|
||||||
basePkg,
|
basePkg,
|
||||||
s.config.PagerStyle(),
|
s.config.PagerStyle(),
|
||||||
input.opts.Interactive,
|
input.opts.Interactive,
|
||||||
@@ -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
|
||||||
@@ -33,34 +33,17 @@ import (
|
|||||||
_ "github.com/goreleaser/nfpm/v2/arch"
|
_ "github.com/goreleaser/nfpm/v2/arch"
|
||||||
_ "github.com/goreleaser/nfpm/v2/deb"
|
_ "github.com/goreleaser/nfpm/v2/deb"
|
||||||
_ "github.com/goreleaser/nfpm/v2/rpm"
|
_ "github.com/goreleaser/nfpm/v2/rpm"
|
||||||
"mvdan.cc/sh/v3/syntax"
|
|
||||||
|
|
||||||
"github.com/goreleaser/nfpm/v2"
|
"github.com/goreleaser/nfpm/v2"
|
||||||
"github.com/goreleaser/nfpm/v2/files"
|
"github.com/goreleaser/nfpm/v2/files"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cpu"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cpu"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/overrides"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/overrides"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Функция readScript анализирует скрипт сборки с использованием встроенной реализации bash
|
|
||||||
func readScript(script string) (*syntax.File, error) {
|
|
||||||
fl, err := os.Open(script) // Открываем файл скрипта
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer fl.Close() // Закрываем файл после выполнения
|
|
||||||
|
|
||||||
file, err := syntax.NewParser().Parse(fl, "alr.sh") // Парсим скрипт с помощью синтаксического анализатора
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return file, nil // Возвращаем синтаксическое дерево
|
|
||||||
}
|
|
||||||
|
|
||||||
// Функция prepareDirs подготавливает директории для сборки.
|
// Функция prepareDirs подготавливает директории для сборки.
|
||||||
func prepareDirs(dirs types.Directories) error {
|
func prepareDirs(dirs types.Directories) error {
|
||||||
err := os.RemoveAll(dirs.BaseDir) // Удаляем базовую директорию, если она существует
|
err := os.RemoveAll(dirs.BaseDir) // Удаляем базовую директорию, если она существует
|
||||||
@@ -288,14 +271,14 @@ func packageNames(pkgs []db.Package) []string {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Функция removeDuplicates убирает любые дубликаты из предоставленного среза.
|
// Функция removeDuplicates убирает любые дубликаты из предоставленного среза.
|
||||||
func removeDuplicates(slice []string) []string {
|
func removeDuplicates[T comparable](slice []T) []T {
|
||||||
seen := map[string]struct{}{}
|
seen := map[T]struct{}{}
|
||||||
result := []string{}
|
result := []T{}
|
||||||
|
|
||||||
for _, s := range slice {
|
for _, item := range slice {
|
||||||
if _, ok := seen[s]; !ok {
|
if _, ok := seen[item]; !ok {
|
||||||
seen[s] = struct{}{}
|
seen[item] = struct{}{}
|
||||||
result = append(result, s)
|
result = append(result, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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
|
||||||
@@ -26,9 +26,9 @@ import (
|
|||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/config"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/db"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/manager"
|
||||||
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/repos"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/distro"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager"
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/repos"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type AppDeps struct {
|
type AppDeps struct {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -29,7 +29,7 @@ import (
|
|||||||
"github.com/pelletier/go-toml/v2"
|
"github.com/pelletier/go-toml/v2"
|
||||||
|
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/constants"
|
"gitea.plemya-x.ru/Plemya-x/ALR/internal/constants"
|
||||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/types"
|
"gitea.plemya-x.ru/Plemya-x/ALR/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ALRConfig struct {
|
type ALRConfig struct {
|
||||||
@@ -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,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
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
name='{{.Info.Name | tolower}}'
|
name='python3-{{.Info.Name | tolower}}'
|
||||||
version='{{.Info.Version}}'
|
version='{{.Info.Version}}'
|
||||||
release='1'
|
release='1'
|
||||||
desc='{{.Info.Summary}}'
|
desc='{{.Info.Summary}}'
|
||||||
@@ -48,3 +48,8 @@ package() {
|
|||||||
cd "$srcdir/{{.Info.Name}}-${version}"
|
cd "$srcdir/{{.Info.Name}}-${version}"
|
||||||
pip install --root="${pkgdir}/" . --no-deps --ignore-installed --disable-pip-version-check
|
pip install --root="${pkgdir}/" . --no-deps --ignore-installed --disable-pip-version-check
|
||||||
}
|
}
|
||||||
|
|
||||||
|
files() {
|
||||||
|
printf '"%s" ' ./usr/local/lib/python3.*/site-packages/{{.Info.Name | tolower}}/*
|
||||||
|
printf '"%s" ' ./usr/local/lib/python3.*/site-packages/{{.Info.Name | tolower}}-${version}.dist-info/*
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user