mirror of
https://github.com/Jguer/yay.git
synced 2025-06-25 00:03:32 -04:00
Compare commits
No commits in common. "next" and "v12.1.1" have entirely different histories.
@ -1,26 +0,0 @@
|
||||
# Use the jguer/yay-builder image as a parent image with archlinux
|
||||
FROM docker.io/jguer/yay-builder
|
||||
|
||||
# Install extra packages (pacman-contrib and fish)
|
||||
RUN sudo pacman -Syu --noconfirm pacman-contrib fish git-delta openssh bat go
|
||||
|
||||
# Set passwordless sudo for the docker user
|
||||
RUN echo "docker ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/docker
|
||||
|
||||
# Create a non-root user and switch to it
|
||||
USER docker
|
||||
|
||||
# Install xgotext
|
||||
RUN go install github.com/leonelquinteros/gotext/cli/xgotext@latest
|
||||
|
||||
# Add /app/bin to the PATH
|
||||
ENV PATH="/app/bin:$PATH"
|
||||
|
||||
# add /home/docker/go/bin to the PATH
|
||||
ENV PATH="/home/docker/go/bin:$PATH"
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /workspace
|
||||
|
||||
# Command to run when starting the container
|
||||
CMD ["bash"]
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "Existing Dockerfile",
|
||||
"build": {
|
||||
"context": "..",
|
||||
"dockerfile": "../.devcontainer/Dockerfile"
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"golang.go"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
15
.github/dependabot.yml
vendored
15
.github/dependabot.yml
vendored
@ -1,15 +0,0 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gomod" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
go-all:
|
||||
patterns:
|
||||
- '*'
|
155
.github/workflows/builder-image.yml
vendored
155
.github/workflows/builder-image.yml
vendored
@ -1,143 +1,40 @@
|
||||
name: Builder Image
|
||||
name: Builder image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 3 * * 1" # Every Monday at 3 AM
|
||||
- cron: "0 3 * * 1"
|
||||
push:
|
||||
paths:
|
||||
- "ci.Dockerfile"
|
||||
- ".github/workflows/builder-image.yml"
|
||||
|
||||
env:
|
||||
REGISTRY_IMAGE: jguer/yay-builder
|
||||
|
||||
- "**/builder-image.yml"
|
||||
jobs:
|
||||
build:
|
||||
name: Push builder image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- linux/amd64
|
||||
- linux/arm/v7
|
||||
- linux/arm64
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ env.REGISTRY_IMAGE }}
|
||||
ghcr.io/${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=sha,format=long
|
||||
|
||||
- name: Build and push by digest
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ci.Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
- name: Export digest
|
||||
run: |
|
||||
mkdir -p /tmp/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
echo -n "$digest" > "/tmp/digests/$(echo "${{ matrix.platform }}" | tr '/' '_')"
|
||||
|
||||
- name: Upload digest
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digest-${{ matrix.platform == 'linux/amd64' && 'amd64' || matrix.platform == 'linux/arm/v7' && 'armv7' || 'arm64' }}
|
||||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
merge:
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: digest-*
|
||||
merge-multiple: true
|
||||
path: /tmp/digests
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ env.REGISTRY_IMAGE }}
|
||||
ghcr.io/${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=sha,format=short
|
||||
|
||||
- name: Create and push manifest list
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Push to Docker Hub
|
||||
uses: docker/build-push-action@v2
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: enabled
|
||||
run: |
|
||||
# Extract Docker Hub tags
|
||||
DH_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | grep -v "^ghcr.io" | xargs -I {} echo "-t {}")
|
||||
|
||||
# Extract GitHub Container Registry tags
|
||||
GHCR_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | grep "^ghcr.io" | xargs -I {} echo "-t {}")
|
||||
|
||||
# Create a manifest list using the image digests from /tmp/digests/*
|
||||
DIGESTS=$(for file in /tmp/digests/*; do
|
||||
echo -n "${{ env.REGISTRY_IMAGE }}@$(cat $file) "
|
||||
done)
|
||||
|
||||
# Create the manifest list for Docker Hub
|
||||
docker buildx imagetools create $DH_TAGS $DIGESTS
|
||||
|
||||
# Create the manifest list for GitHub Container Registry
|
||||
docker buildx imagetools create $GHCR_TAGS $DIGESTS
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:latest
|
||||
DOCKER_BUILDKIT: 0
|
||||
COMPOSE_DOCKER_CLI_BUILD: 0
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
file: ci.Dockerfile
|
||||
push: true
|
||||
tags: jguer/yay-builder:latest
|
||||
secrets: |
|
||||
DOCKER_BUILDKIT=0
|
||||
COMPOSE_DOCKER_CLI_BUILD=0
|
||||
cache-from: type=registry,ref=jguer/yay-builder:latest
|
||||
cache-to: type=inline
|
||||
|
108
.github/workflows/multiarch-build.yml
vendored
108
.github/workflows/multiarch-build.yml
vendored
@ -1,5 +1,4 @@
|
||||
name: Build Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
@ -9,36 +8,31 @@ jobs:
|
||||
build-releases:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ["linux/amd64 x86_64", "linux/arm/v7 armv7h", "linux/arm64 aarch64"]
|
||||
arch:
|
||||
["linux/amd64 x86_64", "linux/arm/v7 armv7h", "linux/arm64 aarch64"]
|
||||
name: Build ${{ matrix.arch }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
platforms: all
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
version: latest
|
||||
- name: Read info
|
||||
id: tags
|
||||
shell: bash
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
||||
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
|
||||
arch="${{ matrix.arch }}"
|
||||
echo "PLATFORM=${arch%% *}" >> $GITHUB_OUTPUT
|
||||
echo "ARCH=${arch##* }" >> $GITHUB_OUTPUT
|
||||
|
||||
echo ::set-output name=PLATFORM::${arch%% *}
|
||||
echo ::set-output name=ARCH::${arch##* }
|
||||
- name: Build ${{ matrix.arch }} release
|
||||
run: |
|
||||
mkdir artifacts
|
||||
@ -49,45 +43,75 @@ jobs:
|
||||
-t yay:${{ steps.tags.outputs.arch }} . --load
|
||||
make docker-release ARCH=${{ steps.tags.outputs.arch }} VERSION=${{ steps.tags.outputs.version }} PREFIX="/usr"
|
||||
mv *.tar.gz artifacts
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: yay_${{ steps.tags.outputs.arch }}
|
||||
path: artifacts
|
||||
|
||||
create_release:
|
||||
name: Create release from this build
|
||||
needs: [build-releases]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Read info
|
||||
id: tags
|
||||
shell: bash
|
||||
run: |
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
|
||||
echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
pattern: yay_*
|
||||
merge-multiple: true
|
||||
|
||||
name: yay_x86_64
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: yay_armv7h
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: yay_aarch64
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release create ${{ steps.tags.outputs.tag }} \
|
||||
--title "${{ steps.tags.outputs.tag }}" \
|
||||
--generate-notes \
|
||||
./yay_${{ steps.tags.outputs.version }}_*.tar.gz
|
||||
|
||||
with:
|
||||
tag_name: ${{ steps.tags.outputs.tag }}
|
||||
release_name: ${{ steps.tags.outputs.tag }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload x86_64 asset
|
||||
id: upload-release-asset-x86_64
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./yay_${{ steps.tags.outputs.version }}_x86_64.tar.gz
|
||||
asset_name: yay_${{ steps.tags.outputs.version }}_x86_64.tar.gz
|
||||
asset_content_type: application/tar+gzip
|
||||
- name: Upload armv7h asset
|
||||
id: upload-release-asset-armv7h
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./yay_${{ steps.tags.outputs.version }}_armv7h.tar.gz
|
||||
asset_name: yay_${{ steps.tags.outputs.version }}_armv7h.tar.gz
|
||||
asset_content_type: application/tar+gzip
|
||||
- name: Upload aarch64 asset
|
||||
id: upload-release-asset-aarch64
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./yay_${{ steps.tags.outputs.version }}_aarch64.tar.gz
|
||||
asset_name: yay_${{ steps.tags.outputs.version }}_aarch64.tar.gz
|
||||
asset_content_type: application/tar+gzip
|
||||
- name: Release Notary Action
|
||||
uses: docker://aevea/release-notary:latest
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
7
.github/workflows/testing-git.yml
vendored
7
.github/workflows/testing-git.yml
vendored
@ -12,9 +12,9 @@ jobs:
|
||||
name: Lint and test yay (-git)
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/jguer/yay-builder:latest
|
||||
image: jguer/yay-builder:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
@ -35,5 +35,4 @@ jobs:
|
||||
chmod -R 777 pacman-git
|
||||
su github -c 'cd pacman-git; yes | makepkg -i --nocheck'
|
||||
- name: Run Build and Tests with pacman-git
|
||||
run: |
|
||||
make test
|
||||
run: make test
|
||||
|
22
.github/workflows/testing.yml
vendored
22
.github/workflows/testing.yml
vendored
@ -7,9 +7,9 @@ jobs:
|
||||
name: Lint and test yay
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/jguer/yay-builder:latest
|
||||
image: jguer/yay-builder:latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
@ -17,12 +17,9 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
- name: Lint
|
||||
env:
|
||||
GOFLAGS: -buildvcs=false -tags=next
|
||||
run: /app/bin/golangci-lint run -v ./...
|
||||
run: /app/bin/golangci-lint run ./...
|
||||
- name: Run Build and Tests
|
||||
run: make test
|
||||
|
||||
- name: Run Integration Tests
|
||||
continue-on-error: true
|
||||
run: |
|
||||
@ -30,15 +27,4 @@ jobs:
|
||||
chown -R yay:yay . &&
|
||||
cp -r ~/go/ /home/yay/go/ &&
|
||||
chown -R yay:yay /home/yay/go/ &&
|
||||
su yay -c "make test-integration"
|
||||
- name: Build yay Artifact
|
||||
env:
|
||||
GOFLAGS: -buildvcs=false -tags=next
|
||||
run: make
|
||||
- name: Upload yay Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: yay
|
||||
path: ./yay
|
||||
if-no-files-found: error
|
||||
overwrite: true
|
||||
su yay -c "make test-integration"
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -28,7 +28,3 @@ qemu-*
|
||||
*.pot
|
||||
*.po~
|
||||
*.pprof
|
||||
|
||||
node_modules/
|
||||
xgotext
|
||||
.devcontainer/
|
153
.golangci.yml
153
.golangci.yml
@ -1,18 +1,69 @@
|
||||
version: "2"
|
||||
run:
|
||||
go: "1.20"
|
||||
linters-settings:
|
||||
dupl:
|
||||
threshold: 100
|
||||
funlen:
|
||||
lines: 100
|
||||
statements: 50
|
||||
goconst:
|
||||
min-len: 3
|
||||
min-occurrences: 4
|
||||
gocritic:
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
- experimental
|
||||
- opinionated
|
||||
- performance
|
||||
- style
|
||||
gocyclo:
|
||||
min-complexity: 15
|
||||
goimports:
|
||||
local-prefixes: github.com/Jguer/yay/v12
|
||||
gomnd:
|
||||
checks:
|
||||
- argument
|
||||
- case
|
||||
- condition
|
||||
- return
|
||||
ignored-numbers:
|
||||
- "0"
|
||||
- "1"
|
||||
- "2"
|
||||
- "3"
|
||||
ignored-functions:
|
||||
- strings.SplitN
|
||||
govet:
|
||||
check-shadowing: true
|
||||
lll:
|
||||
line-length: 140
|
||||
misspell:
|
||||
locale: US
|
||||
nolintlint:
|
||||
allow-unused: false # report any unused nolint directives
|
||||
require-explanation: false # don't require an explanation for nolint directives
|
||||
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
|
||||
|
||||
linters:
|
||||
default: none
|
||||
# please, do not use `enable-all`: it's deprecated and will be removed soon.
|
||||
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
|
||||
disable-all: true
|
||||
enable:
|
||||
- bodyclose
|
||||
- dogsled
|
||||
- dupl
|
||||
- errcheck
|
||||
- errorlint
|
||||
- errcheck
|
||||
- exportloopref
|
||||
# - funlen # TOFIX
|
||||
- gochecknoinits
|
||||
# - goconst # TOFIX
|
||||
- gocritic
|
||||
# - gocyclo # TOFIX
|
||||
- gofmt
|
||||
- goimports
|
||||
# - gomnd # TOFIX
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- lll
|
||||
@ -21,74 +72,32 @@ linters:
|
||||
- noctx
|
||||
- nolintlint
|
||||
- staticcheck
|
||||
- stylecheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unparam
|
||||
- unused
|
||||
- whitespace
|
||||
settings:
|
||||
dupl:
|
||||
threshold: 100
|
||||
funlen:
|
||||
lines: 100
|
||||
statements: 50
|
||||
goconst:
|
||||
min-len: 3
|
||||
min-occurrences: 4
|
||||
gocritic:
|
||||
enabled-tags:
|
||||
- diagnostic
|
||||
- experimental
|
||||
- opinionated
|
||||
- performance
|
||||
- style
|
||||
gocyclo:
|
||||
min-complexity: 15
|
||||
lll:
|
||||
line-length: 140
|
||||
misspell:
|
||||
locale: US
|
||||
nolintlint:
|
||||
require-explanation: false
|
||||
require-specific: false
|
||||
allow-unused: false
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
rules:
|
||||
- linters:
|
||||
- dupl
|
||||
- errcheck
|
||||
- errorlint
|
||||
- gochecknoinits
|
||||
- gocritic
|
||||
- godot
|
||||
- govet
|
||||
- lll
|
||||
- revive
|
||||
- staticcheck
|
||||
- wsl
|
||||
path: (.+)_test.go
|
||||
- path: (.+)\.go$
|
||||
text: G204
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
- goimports
|
||||
settings:
|
||||
goimports:
|
||||
local-prefixes:
|
||||
- github.com/Jguer/yay/v12
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
||||
run:
|
||||
go: "1.18"
|
||||
timeout: "10m"
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
- path: (.+)_test.go
|
||||
linters:
|
||||
- lll
|
||||
- revive
|
||||
- wsl
|
||||
- govet
|
||||
- godot
|
||||
- errcheck
|
||||
- stylecheck
|
||||
- dupl
|
||||
- gocritic
|
||||
- gochecknoinits
|
||||
- errorlint
|
||||
|
||||
exclude:
|
||||
- G204
|
||||
|
@ -5,17 +5,19 @@ repos:
|
||||
rev: v0.5.1
|
||||
hooks:
|
||||
- id: go-fmt
|
||||
- id: go-imports
|
||||
args: [-local=github.com/Jguer/yay/v12/]
|
||||
- id: golangci-lint
|
||||
- id: go-unit-tests
|
||||
- id: go-build
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v4.0.0-alpha.8 # Use the sha or tag you want to point at
|
||||
rev: v3.0.0-alpha.4 # Use the sha or tag you want to point at
|
||||
hooks:
|
||||
- id: prettier
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0 # Use the ref you want to point at
|
||||
rev: v4.4.0 # Use the ref you want to point at
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: check-json
|
||||
@ -23,7 +25,7 @@ repos:
|
||||
- id: check-added-large-files
|
||||
|
||||
- repo: https://github.com/commitizen-tools/commitizen
|
||||
rev: v3.15.0
|
||||
rev: v2.38.0
|
||||
hooks:
|
||||
- id: commitizen
|
||||
stages: [commit-msg]
|
||||
|
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -1,7 +0,0 @@
|
||||
{
|
||||
"go.lintTool": "golangci-lint",
|
||||
"gopls": {
|
||||
"formatting.gofumpt": true,
|
||||
"formatting.local": "github.com/Jguer/yay/v12"
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
FROM ghcr.io/jguer/yay-builder:latest
|
||||
FROM docker.io/jguer/yay-builder:latest
|
||||
LABEL maintainer="Jguer,docker@jguer.space"
|
||||
|
||||
ARG VERSION
|
||||
@ -9,4 +9,4 @@ WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN make release VERSION=${VERSION} PREFIX=${PREFIX} ARCH=${ARCH}
|
||||
RUN make release VERSION=${VERSION} PREFIX=${PREFIX} ARCH=${ARCH}
|
||||
|
12
Makefile
12
Makefile
@ -26,7 +26,8 @@ MOFILES := $(POFILES:.po=.mo)
|
||||
|
||||
FLAGS ?= -trimpath -mod=readonly -modcacherw
|
||||
EXTRA_FLAGS ?= -buildmode=pie
|
||||
LDFLAGS := -X "main.yayVersion=${VERSION}" -X "main.localePath=${SYSTEMLOCALEPATH}" -linkmode=external -compressdwarf=false
|
||||
LDFLAGS := -X "main.yayVersion=${VERSION}" -X "main.localePath=${SYSTEMLOCALEPATH}" -linkmode=external
|
||||
FLAGS += $(shell pacman -T 'pacman-git' >/dev/null 2>&1 && echo "-tags next")
|
||||
|
||||
RELEASE_DIR := ${PKGNAME}_${VERSION}_${ARCH}
|
||||
PACKAGE := $(RELEASE_DIR).tar.gz
|
||||
@ -69,7 +70,7 @@ docker-release-all:
|
||||
make docker-release-aarch64 ARCH=aarch64
|
||||
|
||||
docker-release:
|
||||
docker create --name yay-$(ARCH) yay:${ARCH} /bin/sh
|
||||
docker create --name yay-$(ARCH) yay:${ARCH}
|
||||
docker cp yay-$(ARCH):/app/${PACKAGE} $(PACKAGE)
|
||||
docker container rm yay-$(ARCH)
|
||||
|
||||
@ -82,7 +83,9 @@ docker-build:
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
GOFLAGS="$(FLAGS)" golangci-lint run ./...
|
||||
$(GO) vet $(FLAGS) ./...
|
||||
@test -z "$$(gofmt -l $(SOURCES))" || (echo "Files need to be linted. Use make fmt" && false)
|
||||
golangci-lint run ./...
|
||||
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
@ -123,9 +126,8 @@ $(PACKAGE): $(BIN) $(RELEASE_DIR) ${MOFILES}
|
||||
|
||||
locale:
|
||||
xgotext -in . -out po
|
||||
mv po/default.pot po/en.po
|
||||
for lang in ${LANGS}; do \
|
||||
test -f po/$$lang.po || msginit --no-translator -l po/$$lang.po -i po/${POTFILE} -o po/$$lang.po; \
|
||||
test -f po/$$lang.po || msginit -l po/$$lang.po -i po/${POTFILE} -o po/$$lang.po \
|
||||
msgmerge -U po/$$lang.po po/${POTFILE}; \
|
||||
touch po/$$lang.po; \
|
||||
done
|
||||
|
65
README.md
65
README.md
@ -30,18 +30,15 @@ Yet Another Yogurt - An AUR Helper Written in Go
|
||||
|
||||
If you are migrating from another AUR helper, you can simply install Yay with that helper.
|
||||
|
||||
> [!WARNING]
|
||||
> We are using `sudo` in these examples, you can switch that out for a different privilege escalation tool.
|
||||
|
||||
### Source
|
||||
|
||||
The initial installation of Yay can be done by cloning the PKGBUILD and
|
||||
building with makepkg:
|
||||
|
||||
We make sure we have the `base-devel` package group installed.
|
||||
Before you begin, make sure you have the `base-devel` package group installed.
|
||||
|
||||
```sh
|
||||
sudo pacman -S --needed git base-devel
|
||||
pacman -S --needed git base-devel
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
@ -50,7 +47,7 @@ makepkg -si
|
||||
If you want to do all of this at once, we can chain the commands like so:
|
||||
|
||||
```sh
|
||||
sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
|
||||
pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
|
||||
```
|
||||
|
||||
### Binary
|
||||
@ -59,18 +56,12 @@ If you do not want to compile yay yourself you can use the builds generated by
|
||||
GitHub Actions.
|
||||
|
||||
```sh
|
||||
sudo pacman -S --needed git base-devel
|
||||
pacman -S --needed git base-devel
|
||||
git clone https://aur.archlinux.org/yay-bin.git
|
||||
cd yay-bin
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
If you want to do all of this at once, we can chain the commands like so:
|
||||
|
||||
```sh
|
||||
sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -si
|
||||
```
|
||||
|
||||
### Other distributions
|
||||
|
||||
If you're using Manjaro or [another distribution that packages `yay`](https://repology.org/project/yay/versions)
|
||||
@ -79,8 +70,8 @@ you can simply install yay using pacman (as root):
|
||||
```sh
|
||||
pacman -S --needed git base-devel yay
|
||||
```
|
||||
> [!WARNING]
|
||||
> distributions sometimes lag updating yay on their repositories.
|
||||
|
||||
⚠️ distributions sometimes lag updating yay on their repositories.
|
||||
|
||||
## First Use
|
||||
|
||||
@ -120,6 +111,17 @@ pacman -S --needed git base-devel yay
|
||||
Make sure you have the `Color` option in your `/etc/pacman.conf`
|
||||
(see issue [#123](https://github.com/Jguer/yay/issues/123)).
|
||||
|
||||
- **Yay is not prompting to skip packages during system upgrade.**
|
||||
|
||||
The default behavior was changed after
|
||||
[v8.918](https://github.com/Jguer/yay/releases/tag/v8.918)
|
||||
(see [3bdb534](https://github.com/Jguer/yay/commit/3bdb5343218d99d40f8a449b887348611f6bdbfc)
|
||||
and issue [#554](https://github.com/Jguer/yay/issues/554)).
|
||||
To restore the package-skip behavior use `--combinedupgrade` (make
|
||||
it permanent by appending `--save`). Note: skipping packages will leave your
|
||||
system in a
|
||||
[partially-upgraded state](https://wiki.archlinux.org/index.php/System_maintenance#Partial_upgrades_are_unsupported).
|
||||
|
||||
- **Sometimes diffs are printed to the terminal, and other times they are paged via less. How do I fix this?**
|
||||
|
||||
Yay uses `git diff` to display diffs, which by default tells less not to
|
||||
@ -128,14 +130,14 @@ pacman -S --needed git base-devel yay
|
||||
|
||||
- **Yay is not asking me to edit PKGBUILDS, and I don't like the diff menu! What can I do?**
|
||||
|
||||
`yay --editmenu --diffmenu=false --save`
|
||||
`yay --editmenu --nodiffmenu --save`
|
||||
|
||||
- **How can I tell Yay to act only on AUR packages, or only on repo packages?**
|
||||
|
||||
`yay -{OPERATION} --aur`
|
||||
`yay -{OPERATION} --repo`
|
||||
|
||||
- **A `Flagged Out Of Date AUR Packages` message is displayed. Why doesn't Yay update them?**
|
||||
- **An `Out Of Date AUR Packages` message is displayed. Why doesn't Yay update them?**
|
||||
|
||||
This message does not mean that updated AUR packages are available. It means
|
||||
the packages have been flagged out of date on the AUR, but
|
||||
@ -150,13 +152,28 @@ pacman -S --needed git base-devel yay
|
||||
|
||||
- **I know my `-git` package has updates but yay doesn't offer to update it**
|
||||
|
||||
Yay uses a hash cache for development packages. Normally it is updated at the end of the package install with the message `Found git repo`.
|
||||
Yay uses an hash cache for development packages. Normally it is updated at the end of the package install with the message `Found git repo`.
|
||||
If you transition between aur helpers and did not install the devel package using yay at some point, it is possible it never got added to the cache. `yay -Y --gendb` will fix the current version of every devel package and start checking from there.
|
||||
|
||||
- **I want to help out!**
|
||||
|
||||
Check [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.
|
||||
|
||||
- **What settings do you use?**
|
||||
|
||||
```sh
|
||||
yay -Y --devel --combinedupgrade --batchinstall --save
|
||||
```
|
||||
|
||||
Pacman conf options:
|
||||
|
||||
```conf
|
||||
UseSyslog
|
||||
Color
|
||||
CheckSpace
|
||||
VerbosePkgLists
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
All support related to Yay should be requested via GitHub issues. Since Yay is not
|
||||
@ -172,14 +189,14 @@ tools.
|
||||
|
||||
## Images
|
||||
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/Jguer/jguer.github.io/refs/heads/master/yay/yay.png" width="42%">
|
||||
<img src="https://raw.githubusercontent.com/Jguer/jguer.github.io/refs/heads/master/yay/yay-s.png" width="42%">
|
||||
<p float="left">
|
||||
<img src="https://rawcdn.githack.com/Jguer/jguer.github.io/77647f396cb7156fd32e30970dbeaf6d6dc7f983/yay/yay.png" width="42%"/>
|
||||
<img src="https://rawcdn.githack.com/Jguer/jguer.github.io/77647f396cb7156fd32e30970dbeaf6d6dc7f983/yay/yay-s.png" width="42%"/>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/Jguer/jguer.github.io/refs/heads/master/yay/yay-y.png" width="42%">
|
||||
<img src="https://raw.githubusercontent.com/Jguer/jguer.github.io/refs/heads/master/yay/yay-ps.png" width="42%">
|
||||
<p float="left">
|
||||
<img src="https://rawcdn.githack.com/Jguer/jguer.github.io/77647f396cb7156fd32e30970dbeaf6d6dc7f983/yay/yay-y.png" width="42%"/>
|
||||
<img src="https://rawcdn.githack.com/Jguer/jguer.github.io/77647f396cb7156fd32e30970dbeaf6d6dc7f983/yay/yay-ps.png" width="42%"/>
|
||||
</p>
|
||||
|
||||
### Other AUR helpers/tools
|
||||
|
13
SECURITY.md
13
SECURITY.md
@ -1,13 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
Thank you for helping keep yay secure!
|
||||
|
||||
## Supported Versions
|
||||
|
||||
We only provide security updates and support for the latest released version of yay. Please ensure you are using the most up-to-date version before reporting vulnerabilities.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you discover a security vulnerability, please email us at [security@jguer.space](mailto:security@jguer.space). We will respond as quickly as possible and coordinate a fix.
|
||||
|
||||
We appreciate responsible disclosure and your help in making this project safe for everyone.
|
@ -1,4 +1,4 @@
|
||||
package build
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -54,12 +54,12 @@ func NewInstaller(dbExecutor db.Executor,
|
||||
}
|
||||
}
|
||||
|
||||
func (installer *Installer) CompileFailedAndIgnored() (map[string]error, error) {
|
||||
func (installer *Installer) CompileFailedAndIgnored() error {
|
||||
if len(installer.failedAndIgnored) == 0 {
|
||||
return installer.failedAndIgnored, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
return installer.failedAndIgnored, &FailedIgnoredPkgError{
|
||||
return &FailedIgnoredPkgError{
|
||||
pkgErrors: installer.failedAndIgnored,
|
||||
}
|
||||
}
|
||||
@ -145,20 +145,16 @@ func (installer *Installer) handleLayer(ctx context.Context,
|
||||
excluded []string,
|
||||
) error {
|
||||
// Install layer
|
||||
nameToBaseMap := make(map[string]string, len(layer))
|
||||
nameToBaseMap := make(map[string]string, 0)
|
||||
syncDeps, syncExp, syncGroups := mapset.NewThreadUnsafeSet[string](),
|
||||
mapset.NewThreadUnsafeSet[string](), mapset.NewThreadUnsafeSet[string]()
|
||||
aurDeps, aurExp, aurOrigTargetBases := mapset.NewThreadUnsafeSet[string](),
|
||||
mapset.NewThreadUnsafeSet[string](), mapset.NewThreadUnsafeSet[string]()
|
||||
aurDeps, aurExp := mapset.NewThreadUnsafeSet[string](), mapset.NewThreadUnsafeSet[string]()
|
||||
|
||||
upgradeSync := false
|
||||
for name, info := range layer {
|
||||
switch info.Source {
|
||||
case dep.AUR, dep.SrcInfo:
|
||||
nameToBaseMap[name] = *info.AURBase
|
||||
if installer.origTargets.Contains(name) {
|
||||
aurOrigTargetBases.Add(*info.AURBase)
|
||||
}
|
||||
|
||||
switch info.Reason {
|
||||
case dep.Explicit:
|
||||
@ -205,15 +201,14 @@ func (installer *Installer) handleLayer(ctx context.Context,
|
||||
}
|
||||
|
||||
errAur := installer.installAURPackages(ctx, cmdArgs, aurDeps, aurExp,
|
||||
aurOrigTargetBases, nameToBaseMap, pkgBuildDirs, true, lastLayer,
|
||||
installer.appendNoConfirm())
|
||||
nameToBaseMap, pkgBuildDirs, true, lastLayer, installer.appendNoConfirm())
|
||||
|
||||
return errAur
|
||||
}
|
||||
|
||||
func (installer *Installer) installAURPackages(ctx context.Context,
|
||||
cmdArgs *parser.Arguments,
|
||||
aurDepNames, aurExpNames, aurOrigTargetBases mapset.Set[string],
|
||||
aurDepNames, aurExpNames mapset.Set[string],
|
||||
nameToBase, pkgBuildDirsByBase map[string]string,
|
||||
installIncompatible bool,
|
||||
lastLayer bool,
|
||||
@ -224,37 +219,27 @@ func (installer *Installer) installAURPackages(ctx context.Context,
|
||||
return nil
|
||||
}
|
||||
|
||||
builtPkgDests := make(map[string]map[string]string)
|
||||
deps := make([]string, 0, aurDepNames.Cardinality())
|
||||
exps := make([]string, 0, aurExpNames.Cardinality())
|
||||
pkgArchives := make([]string, 0, len(all))
|
||||
deps, exps := make([]string, 0, aurDepNames.Cardinality()), make([]string, 0, aurExpNames.Cardinality())
|
||||
pkgArchives := make([]string, 0, len(exps)+len(deps))
|
||||
|
||||
for _, name := range all {
|
||||
base := nameToBase[name]
|
||||
dir := pkgBuildDirsByBase[base]
|
||||
|
||||
pkgdests, ok := builtPkgDests[base]
|
||||
if ok {
|
||||
installer.log.Debugln("skipping built pkgbase", base, "package", name)
|
||||
} else {
|
||||
var errMake error
|
||||
installer.log.Debugln("building pkgbase", base, "package", name)
|
||||
pkgdests, errMake = installer.buildPkg(ctx, dir, base,
|
||||
installIncompatible, cmdArgs.ExistsArg("needed"), aurOrigTargetBases.Contains(base))
|
||||
builtPkgDests[base] = pkgdests
|
||||
if errMake != nil {
|
||||
if !lastLayer {
|
||||
return fmt.Errorf("%s - %w", gotext.Get("error making: %s", base), errMake)
|
||||
}
|
||||
|
||||
installer.failedAndIgnored[name] = errMake
|
||||
installer.log.Errorln(gotext.Get("error making: %s", base), "-", errMake)
|
||||
continue
|
||||
pkgdests, errMake := installer.buildPkg(ctx, dir, base,
|
||||
installIncompatible, cmdArgs.ExistsArg("needed"), installer.origTargets.Contains(name))
|
||||
if errMake != nil {
|
||||
if !lastLayer {
|
||||
return fmt.Errorf("%s - %w", gotext.Get("error making: %s", base), errMake)
|
||||
}
|
||||
|
||||
installer.failedAndIgnored[name] = errMake
|
||||
text.Errorln(gotext.Get("error making: %s", base), "-", errMake)
|
||||
continue
|
||||
}
|
||||
|
||||
if len(pkgdests) == 0 {
|
||||
installer.log.Warnln(gotext.Get("nothing to install for %s", text.Cyan(base)))
|
||||
text.Warnln(gotext.Get("nothing to install for %s", text.Cyan(base)))
|
||||
continue
|
||||
}
|
||||
|
||||
@ -292,11 +277,7 @@ func (installer *Installer) buildPkg(ctx context.Context,
|
||||
dir, base string,
|
||||
installIncompatible, needed, isTarget bool,
|
||||
) (map[string]string, error) {
|
||||
args := []string{"--nobuild", "-f"}
|
||||
|
||||
if !installer.exeCmd.GetKeepSrc() {
|
||||
args = append(args, "-C")
|
||||
}
|
||||
args := []string{"--nobuild", "-fC"}
|
||||
|
||||
if installIncompatible {
|
||||
args = append(args, "--ignorearch")
|
||||
@ -315,23 +296,19 @@ func (installer *Installer) buildPkg(ctx context.Context,
|
||||
|
||||
switch {
|
||||
case needed && installer.pkgsAreAlreadyInstalled(pkgdests, pkgVersion) || installer.downloadOnly:
|
||||
args = []string{"--nobuild", "--noextract", "--ignorearch"}
|
||||
args = []string{"-c", "--nobuild", "--noextract", "--ignorearch"}
|
||||
pkgdests = map[string]string{}
|
||||
installer.log.Warnln(gotext.Get("%s is up to date -- skipping", text.Cyan(base+"-"+pkgVersion)))
|
||||
text.Warnln(gotext.Get("%s is up to date -- skipping", text.Cyan(base+"-"+pkgVersion)))
|
||||
case installer.skipAlreadyBuiltPkg(isTarget, pkgdests):
|
||||
args = []string{"--nobuild", "--noextract", "--ignorearch"}
|
||||
installer.log.Warnln(gotext.Get("%s already made -- skipping build", text.Cyan(base+"-"+pkgVersion)))
|
||||
args = []string{"-c", "--nobuild", "--noextract", "--ignorearch"}
|
||||
text.Warnln(gotext.Get("%s already made -- skipping build", text.Cyan(base+"-"+pkgVersion)))
|
||||
default:
|
||||
args = []string{"-f", "--noconfirm", "--noextract", "--noprepare", "--holdver"}
|
||||
args = []string{"-cf", "--noconfirm", "--noextract", "--noprepare", "--holdver"}
|
||||
if installIncompatible {
|
||||
args = append(args, "--ignorearch")
|
||||
}
|
||||
}
|
||||
|
||||
if !installer.exeCmd.GetKeepSrc() {
|
||||
args = append(args, "-c")
|
||||
}
|
||||
|
||||
errMake := installer.exeCmd.Show(
|
||||
installer.exeCmd.BuildMakepkgCmd(ctx,
|
||||
dir, args...))
|
||||
@ -356,10 +333,10 @@ func (installer *Installer) pkgsAreAlreadyInstalled(pkgdests map[string]string,
|
||||
return true
|
||||
}
|
||||
|
||||
func pkgsAreBuilt(logger *text.Logger, pkgdests map[string]string) bool {
|
||||
func pkgsAreBuilt(pkgdests map[string]string) bool {
|
||||
for _, pkgdest := range pkgdests {
|
||||
if _, err := os.Stat(pkgdest); err != nil {
|
||||
logger.Debugln("pkgIsBuilt:", pkgdest, "does not exist")
|
||||
text.Debugln("pkgIsBuilt:", pkgdest, "does not exist")
|
||||
return false
|
||||
}
|
||||
}
|
||||
@ -370,14 +347,14 @@ func pkgsAreBuilt(logger *text.Logger, pkgdests map[string]string) bool {
|
||||
func (installer *Installer) skipAlreadyBuiltPkg(isTarget bool, pkgdests map[string]string) bool {
|
||||
switch installer.rebuildMode {
|
||||
case parser.RebuildModeNo:
|
||||
return pkgsAreBuilt(installer.log, pkgdests)
|
||||
return pkgsAreBuilt(pkgdests)
|
||||
case parser.RebuildModeYes:
|
||||
return !isTarget && pkgsAreBuilt(installer.log, pkgdests)
|
||||
return !isTarget && pkgsAreBuilt(pkgdests)
|
||||
// case parser.RebuildModeTree: // TODO
|
||||
// case parser.RebuildModeAll: // TODO
|
||||
default:
|
||||
// same as RebuildModeNo
|
||||
return pkgsAreBuilt(installer.log, pkgdests)
|
||||
return pkgsAreBuilt(pkgdests)
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package build
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -21,7 +21,7 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/vcs"
|
||||
)
|
||||
|
||||
func newTestLogger() *text.Logger {
|
||||
func NewTestLogger() *text.Logger {
|
||||
return text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), true, "test")
|
||||
}
|
||||
|
||||
@ -56,8 +56,8 @@ func TestInstaller_InstallNeeded(t *testing.T) {
|
||||
isInstalled: false,
|
||||
isBuilt: false,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --needed --config -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config -- yay",
|
||||
},
|
||||
@ -68,7 +68,7 @@ func TestInstaller_InstallNeeded(t *testing.T) {
|
||||
isInstalled: false,
|
||||
isBuilt: true,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --needed --config -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config -- yay",
|
||||
@ -80,7 +80,7 @@ func TestInstaller_InstallNeeded(t *testing.T) {
|
||||
isInstalled: true,
|
||||
isBuilt: false,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
},
|
||||
wantCapture: []string{"makepkg --packagelist"},
|
||||
@ -134,7 +134,7 @@ func TestInstaller_InstallNeeded(t *testing.T) {
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
parser.RebuildModeNo, false, newTestLogger())
|
||||
parser.RebuildModeNo, false, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddArg("needed")
|
||||
@ -212,8 +212,8 @@ func TestInstaller_InstallMixedSourcesAndLayers(t *testing.T) {
|
||||
wantShow: []string{
|
||||
"pacman -S --config /etc/pacman.conf -- core/linux",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- linux",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- yay",
|
||||
},
|
||||
@ -241,8 +241,8 @@ func TestInstaller_InstallMixedSourcesAndLayers(t *testing.T) {
|
||||
wantShow: []string{
|
||||
"pacman -S --config /etc/pacman.conf -- core/linux",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- linux",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- yay",
|
||||
},
|
||||
@ -293,10 +293,10 @@ func TestInstaller_InstallMixedSourcesAndLayers(t *testing.T) {
|
||||
{
|
||||
desc: "same layer -- aur",
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- pacman -U --config /etc/pacman.conf -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- yay",
|
||||
},
|
||||
@ -323,12 +323,12 @@ func TestInstaller_InstallMixedSourcesAndLayers(t *testing.T) {
|
||||
{
|
||||
desc: "different layer -- aur",
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- pacman -U --config /etc/pacman.conf -- /testdir/jellyfin-server-10.8.8-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- jellyfin-server",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- pacman -U --config /etc/pacman.conf -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- yay",
|
||||
},
|
||||
@ -374,13 +374,13 @@ func TestInstaller_InstallMixedSourcesAndLayers(t *testing.T) {
|
||||
}
|
||||
|
||||
showOverride := func(cmd *exec.Cmd) error {
|
||||
if strings.Contains(cmd.String(), "makepkg -f --noconfirm") && cmd.Dir == tmpDir {
|
||||
if strings.Contains(cmd.String(), "makepkg -cf --noconfirm") && cmd.Dir == tmpDir {
|
||||
f, err := os.OpenFile(pkgTar, os.O_RDONLY|os.O_CREATE, 0o666)
|
||||
require.NoError(td, err)
|
||||
require.NoError(td, f.Close())
|
||||
}
|
||||
|
||||
if strings.Contains(cmd.String(), "makepkg -f --noconfirm") && cmd.Dir == tmpDirJfin {
|
||||
if strings.Contains(cmd.String(), "makepkg -cf --noconfirm") && cmd.Dir == tmpDirJfin {
|
||||
f, err := os.OpenFile(jfinPkgTar, os.O_RDONLY|os.O_CREATE, 0o666)
|
||||
require.NoError(td, err)
|
||||
require.NoError(td, f.Close())
|
||||
@ -408,7 +408,7 @@ func TestInstaller_InstallMixedSourcesAndLayers(t *testing.T) {
|
||||
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny, parser.RebuildModeNo, false, newTestLogger())
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny, parser.RebuildModeNo, false, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddTarget("yay")
|
||||
@ -462,7 +462,7 @@ func TestInstaller_RunPostHooks(t *testing.T) {
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
parser.RebuildModeNo, false, newTestLogger())
|
||||
parser.RebuildModeNo, false, NewTestLogger())
|
||||
|
||||
called := false
|
||||
hook := func(ctx context.Context) error {
|
||||
@ -570,7 +570,7 @@ func TestInstaller_CompileFailed(t *testing.T) {
|
||||
}
|
||||
|
||||
showOverride := func(cmd *exec.Cmd) error {
|
||||
if tc.failBuild && strings.Contains(cmd.String(), "makepkg -f --noconfirm") && cmd.Dir == tmpDir {
|
||||
if tc.failBuild && strings.Contains(cmd.String(), "makepkg -cf --noconfirm") && cmd.Dir == tmpDir {
|
||||
return errors.New("makepkg failed")
|
||||
}
|
||||
return nil
|
||||
@ -593,7 +593,7 @@ func TestInstaller_CompileFailed(t *testing.T) {
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
parser.RebuildModeNo, false, newTestLogger())
|
||||
parser.RebuildModeNo, false, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddArg("needed")
|
||||
@ -609,21 +609,10 @@ func TestInstaller_CompileFailed(t *testing.T) {
|
||||
} else {
|
||||
require.NoError(td, errI)
|
||||
}
|
||||
failed, err := installer.CompileFailedAndIgnored()
|
||||
err := installer.CompileFailedAndIgnored()
|
||||
if tc.wantErrCompile {
|
||||
require.Error(td, err)
|
||||
for key := range failed {
|
||||
assert.ErrorContains(td, err, key)
|
||||
}
|
||||
uniqueBases := make(map[string]struct{})
|
||||
for _, layer := range tc.targets {
|
||||
for _, info := range layer {
|
||||
if info.AURBase != nil {
|
||||
uniqueBases[*info.AURBase] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
require.Len(td, failed, len(uniqueBases))
|
||||
assert.ErrorContains(td, err, "yay")
|
||||
} else {
|
||||
require.NoError(td, err)
|
||||
}
|
||||
@ -704,16 +693,18 @@ func TestInstaller_InstallSplitPackage(t *testing.T) {
|
||||
wantShow: []string{
|
||||
"pacman -S --config /etc/pacman.conf -- community/dotnet-runtime-6.0 community/aspnet-runtime community/dotnet-sdk-6.0",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- dotnet-runtime-6.0 aspnet-runtime dotnet-sdk-6.0",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst /testdir/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- jellyfin-server jellyfin-web",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- jellyfin",
|
||||
},
|
||||
wantCapture: []string{"makepkg --packagelist", "makepkg --packagelist"},
|
||||
wantCapture: []string{"makepkg --packagelist", "makepkg --packagelist", "makepkg --packagelist"},
|
||||
},
|
||||
}
|
||||
|
||||
@ -761,7 +752,7 @@ func TestInstaller_InstallSplitPackage(t *testing.T) {
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
parser.RebuildModeNo, false, newTestLogger())
|
||||
parser.RebuildModeNo, false, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddTarget("jellyfin")
|
||||
@ -826,7 +817,7 @@ func TestInstaller_InstallDownloadOnly(t *testing.T) {
|
||||
isInstalled: false,
|
||||
isBuilt: false,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
},
|
||||
wantCapture: []string{"makepkg --packagelist"},
|
||||
@ -836,7 +827,7 @@ func TestInstaller_InstallDownloadOnly(t *testing.T) {
|
||||
isInstalled: false,
|
||||
isBuilt: true,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
},
|
||||
wantCapture: []string{"makepkg --packagelist"},
|
||||
@ -846,7 +837,7 @@ func TestInstaller_InstallDownloadOnly(t *testing.T) {
|
||||
isInstalled: true,
|
||||
isBuilt: false,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
},
|
||||
wantCapture: []string{"makepkg --packagelist"},
|
||||
@ -900,7 +891,7 @@ func TestInstaller_InstallDownloadOnly(t *testing.T) {
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
parser.RebuildModeNo, true, newTestLogger())
|
||||
parser.RebuildModeNo, true, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddTarget("yay")
|
||||
@ -1004,7 +995,7 @@ func TestInstaller_InstallGroup(t *testing.T) {
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
parser.RebuildModeNo, true, newTestLogger())
|
||||
parser.RebuildModeNo, true, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddTarget("kubernetes-tools")
|
||||
@ -1083,7 +1074,7 @@ func TestInstaller_InstallRebuild(t *testing.T) {
|
||||
isBuilt: true,
|
||||
isInstalled: false,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config -- yay",
|
||||
@ -1107,8 +1098,8 @@ func TestInstaller_InstallRebuild(t *testing.T) {
|
||||
isBuilt: true,
|
||||
isInstalled: false,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config -- yay",
|
||||
},
|
||||
@ -1131,8 +1122,8 @@ func TestInstaller_InstallRebuild(t *testing.T) {
|
||||
isInstalled: true,
|
||||
isBuilt: true,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config -- yay",
|
||||
},
|
||||
@ -1155,8 +1146,8 @@ func TestInstaller_InstallRebuild(t *testing.T) {
|
||||
isInstalled: true,
|
||||
isBuilt: true,
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg -f -c --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -cf --noconfirm --noextract --noprepare --holdver --ignorearch",
|
||||
"pacman -U --config -- /testdir/yay-91.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asdeps --config -- yay",
|
||||
},
|
||||
@ -1222,7 +1213,7 @@ func TestInstaller_InstallRebuild(t *testing.T) {
|
||||
cmdBuilder.Runner = mockRunner
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
tc.rebuildOption, false, newTestLogger())
|
||||
tc.rebuildOption, false, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddTarget("yay")
|
||||
@ -1307,7 +1298,7 @@ func TestInstaller_InstallUpgrade(t *testing.T) {
|
||||
}
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, tc.targetMode,
|
||||
parser.RebuildModeNo, false, newTestLogger())
|
||||
parser.RebuildModeNo, false, NewTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddArg("u", "upgrades") // Make sure both args are removed
|
||||
@ -1345,107 +1336,3 @@ func TestInstaller_InstallUpgrade(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestInstaller_KeepSrc(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
makepkgBin := t.TempDir() + "/makepkg"
|
||||
pacmanBin := t.TempDir() + "/pacman"
|
||||
f, err := os.OpenFile(makepkgBin, os.O_RDONLY|os.O_CREATE, 0o755)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, f.Close())
|
||||
|
||||
f, err = os.OpenFile(pacmanBin, os.O_RDONLY|os.O_CREATE, 0o755)
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, f.Close())
|
||||
|
||||
type testCase struct {
|
||||
desc string
|
||||
wantShow []string
|
||||
targets []map[string]*dep.InstallInfo
|
||||
}
|
||||
|
||||
tmpDir := t.TempDir()
|
||||
|
||||
testCases := []testCase{
|
||||
{
|
||||
desc: "--keepsrc",
|
||||
wantShow: []string{
|
||||
"makepkg --nobuild -f --ignorearch",
|
||||
"makepkg --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config -- /testdir/yay-92.0.0-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config -- yay",
|
||||
},
|
||||
targets: []map[string]*dep.InstallInfo{
|
||||
{
|
||||
"yay": {
|
||||
Source: dep.AUR,
|
||||
Reason: dep.Explicit,
|
||||
Version: "92.0.0-1",
|
||||
SrcinfoPath: ptrString(tmpDir + "/.SRCINFO"),
|
||||
AURBase: ptrString("yay"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.desc, func(td *testing.T) {
|
||||
tmpDir := td.TempDir()
|
||||
pkgTar := tmpDir + "/yay-92.0.0-1-x86_64.pkg.tar.zst"
|
||||
|
||||
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
|
||||
return pkgTar, "", nil
|
||||
}
|
||||
|
||||
// create a mock file
|
||||
f, err := os.OpenFile(pkgTar, os.O_RDONLY|os.O_CREATE, 0o666)
|
||||
require.NoError(td, err)
|
||||
require.NoError(td, f.Close())
|
||||
|
||||
mockDB := &mock.DBExecutor{}
|
||||
mockRunner := &exe.MockRunner{CaptureFn: captureOverride}
|
||||
cmdBuilder := &exe.CmdBuilder{
|
||||
MakepkgBin: makepkgBin,
|
||||
SudoBin: "su",
|
||||
PacmanBin: pacmanBin,
|
||||
KeepSrc: true,
|
||||
Runner: mockRunner,
|
||||
SudoLoopEnabled: false,
|
||||
}
|
||||
|
||||
installer := NewInstaller(mockDB, cmdBuilder, &vcs.Mock{}, parser.ModeAny,
|
||||
parser.RebuildModeNo, false, newTestLogger())
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddTarget("yay")
|
||||
|
||||
pkgBuildDirs := map[string]string{
|
||||
"yay": tmpDir,
|
||||
}
|
||||
|
||||
errI := installer.Install(context.Background(), cmdArgs, tc.targets, pkgBuildDirs, []string{}, false)
|
||||
require.NoError(td, errI)
|
||||
|
||||
require.Len(td, mockRunner.ShowCalls, len(tc.wantShow))
|
||||
|
||||
for i, call := range mockRunner.ShowCalls {
|
||||
show := call.Args[0].(*exec.Cmd).String()
|
||||
show = strings.ReplaceAll(show, tmpDir, "/testdir") // replace the temp dir with a static path
|
||||
show = strings.ReplaceAll(show, makepkgBin, "makepkg")
|
||||
show = strings.ReplaceAll(show, pacmanBin, "pacman")
|
||||
|
||||
// options are in a different order on different systems and on CI root user is used
|
||||
assert.Subset(td, strings.Split(show, " "), strings.Split(tc.wantShow[i], " "), show)
|
||||
|
||||
// Only assert makepkg commands don't have clean arguments
|
||||
if strings.HasPrefix(show, "makepkg") {
|
||||
assert.NotContains(td, show, "-c")
|
||||
assert.NotContains(td, show, "-C")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package workdir
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -32,11 +32,7 @@ func (e *ErrDownloadSource) Unwrap() error {
|
||||
func downloadPKGBUILDSource(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder, pkgBuildDir string, installIncompatible bool,
|
||||
) error {
|
||||
args := []string{"--verifysource", "--skippgpcheck", "-f"}
|
||||
|
||||
if !cmdBuilder.GetKeepSrc() {
|
||||
args = append(args, "-Cc")
|
||||
}
|
||||
args := []string{"--verifysource", "--skippgpcheck", "-Ccf"}
|
||||
|
||||
if installIncompatible {
|
||||
args = append(args, "--ignorearch")
|
@ -1,7 +1,7 @@
|
||||
//go:build !integration
|
||||
// +build !integration
|
||||
|
||||
package workdir
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -33,10 +33,6 @@ func (z *TestMakepkgBuilder) BuildMakepkgCmd(ctx context.Context, dir string, ex
|
||||
assert.Contains(z.test, cmd.String(), z.want)
|
||||
}
|
||||
|
||||
if z.GetKeepSrc() {
|
||||
assert.NotContains(z.test, cmd.String(), "-Cc")
|
||||
}
|
||||
|
||||
if z.wantDir != "" {
|
||||
assert.Equal(z.test, z.wantDir, cmd.Dir)
|
||||
}
|
||||
@ -50,54 +46,20 @@ func (z *TestMakepkgBuilder) Show(cmd *exec.Cmd) error {
|
||||
return z.showError
|
||||
}
|
||||
|
||||
func (z *TestMakepkgBuilder) GetKeepSrc() bool {
|
||||
return z.parentBuilder.KeepSrc
|
||||
}
|
||||
|
||||
// GIVEN 1 package
|
||||
// WHEN downloadPKGBUILDSource is called
|
||||
// THEN 1 call should be made to makepkg with the specified parameters and dir
|
||||
func Test_downloadPKGBUILDSource(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
type testCase struct {
|
||||
desc string
|
||||
keepSrc bool
|
||||
want string
|
||||
}
|
||||
|
||||
testCases := []testCase{
|
||||
{
|
||||
desc: "keepsrc",
|
||||
keepSrc: true,
|
||||
want: "makepkg --nocheck --config /etc/not.conf --verifysource --skippgpcheck -f",
|
||||
},
|
||||
{
|
||||
desc: "nokeepsrc",
|
||||
keepSrc: false,
|
||||
want: "makepkg --nocheck --config /etc/not.conf --verifysource --skippgpcheck -f -Cc",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.desc, func(td *testing.T) {
|
||||
cmdBuilder := &TestMakepkgBuilder{
|
||||
parentBuilder: &exe.CmdBuilder{
|
||||
MakepkgConfPath: "/etc/not.conf",
|
||||
MakepkgFlags: []string{"--nocheck"},
|
||||
MakepkgBin: "makepkg",
|
||||
KeepSrc: tc.keepSrc,
|
||||
},
|
||||
test: t,
|
||||
want: tc.want,
|
||||
wantDir: "/tmp/yay-bin",
|
||||
}
|
||||
err := downloadPKGBUILDSource(context.Background(), cmdBuilder, filepath.Join("/tmp", "yay-bin"), false)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 1, int(cmdBuilder.passes))
|
||||
})
|
||||
cmdBuilder := &TestMakepkgBuilder{
|
||||
parentBuilder: &exe.CmdBuilder{MakepkgConfPath: "/etc/not.conf", MakepkgFlags: []string{"--nocheck"}, MakepkgBin: "makepkg"},
|
||||
test: t,
|
||||
want: "makepkg --nocheck --config /etc/not.conf --verifysource --skippgpcheck -Ccf",
|
||||
wantDir: "/tmp/yay-bin",
|
||||
}
|
||||
err := downloadPKGBUILDSource(context.Background(), cmdBuilder, filepath.Join("/tmp", "yay-bin"), false)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 1, int(cmdBuilder.passes))
|
||||
}
|
||||
|
||||
// GIVEN 1 package
|
||||
@ -108,7 +70,7 @@ func Test_downloadPKGBUILDSourceError(t *testing.T) {
|
||||
cmdBuilder := &TestMakepkgBuilder{
|
||||
parentBuilder: &exe.CmdBuilder{MakepkgConfPath: "/etc/not.conf", MakepkgFlags: []string{"--nocheck"}, MakepkgBin: "makepkg"},
|
||||
test: t,
|
||||
want: "makepkg --nocheck --config /etc/not.conf --verifysource --skippgpcheck -f -Cc",
|
||||
want: "makepkg --nocheck --config /etc/not.conf --verifysource --skippgpcheck -Ccf",
|
||||
wantDir: "/tmp/yay-bin",
|
||||
showError: &exec.ExitError{},
|
||||
}
|
@ -1,15 +1,13 @@
|
||||
FROM docker.io/ljmf00/archlinux:devel
|
||||
FROM docker.io/jguer/yay-builder:latest
|
||||
LABEL maintainer="Jguer,docker@jguer.space"
|
||||
|
||||
ENV GO111MODULE=on
|
||||
WORKDIR /app
|
||||
|
||||
RUN sed -i '/^\[community\]/,/^\[/ s/^/#/' /etc/pacman.conf
|
||||
|
||||
COPY go.mod .
|
||||
|
||||
RUN pacman-key --init && pacman -Sy && pacman -S --overwrite=* --noconfirm archlinux-keyring && \
|
||||
pacman -Su --overwrite=* --needed --noconfirm pacman doxygen meson asciidoc go git gcc make sudo base-devel && \
|
||||
pacman -Su --overwrite=* --needed --noconfirm doxygen meson asciidoc go git gcc make sudo base-devel && \
|
||||
rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* && \
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v2.1.5 && \
|
||||
go mod download
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.2 && \
|
||||
go mod download
|
||||
|
85
clean.go
85
clean.go
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@ -10,10 +11,10 @@ import (
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
// CleanDependencies removes all dangling dependencies in system.
|
||||
@ -48,29 +49,28 @@ func cleanRemove(ctx context.Context, cfg *settings.Configuration,
|
||||
arguments, cfg.Mode, settings.NoConfirm))
|
||||
}
|
||||
|
||||
func syncClean(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
func syncClean(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
keepInstalled := false
|
||||
keepCurrent := false
|
||||
|
||||
_, removeAll, _ := cmdArgs.GetArg("c", "clean")
|
||||
|
||||
for _, v := range run.PacmanConf.CleanMethod {
|
||||
switch v {
|
||||
case "KeepInstalled":
|
||||
for _, v := range cfg.Runtime.PacmanConf.CleanMethod {
|
||||
if v == "KeepInstalled" {
|
||||
keepInstalled = true
|
||||
case "KeepCurrent":
|
||||
} else if v == "KeepCurrent" {
|
||||
keepCurrent = true
|
||||
}
|
||||
}
|
||||
|
||||
if run.Cfg.Mode.AtLeastRepo() {
|
||||
if err := run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm)); err != nil {
|
||||
if cfg.Mode.AtLeastRepo() {
|
||||
if err := cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if !run.Cfg.Mode.AtLeastAUR() {
|
||||
if !cfg.Mode.AtLeastAUR() {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -81,10 +81,10 @@ func syncClean(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Argume
|
||||
question = gotext.Get("Do you want to remove all other AUR packages from cache?")
|
||||
}
|
||||
|
||||
run.Logger.Println(gotext.Get("\nBuild directory:"), run.Cfg.BuildDir)
|
||||
fmt.Println(gotext.Get("\nBuild directory:"), cfg.BuildDir)
|
||||
|
||||
if run.Logger.ContinueTask(question, true, settings.NoConfirm) {
|
||||
if err := cleanAUR(ctx, run, keepInstalled, keepCurrent, removeAll, dbExecutor); err != nil {
|
||||
if text.ContinueTask(os.Stdin, question, true, settings.NoConfirm) {
|
||||
if err := cleanAUR(ctx, cfg, keepInstalled, keepCurrent, removeAll, dbExecutor); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -93,24 +93,24 @@ func syncClean(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Argume
|
||||
return nil
|
||||
}
|
||||
|
||||
if run.Logger.ContinueTask(gotext.Get("Do you want to remove ALL untracked AUR files?"), true, settings.NoConfirm) {
|
||||
return cleanUntracked(ctx, run)
|
||||
if text.ContinueTask(os.Stdin, gotext.Get("Do you want to remove ALL untracked AUR files?"), true, settings.NoConfirm) {
|
||||
return cleanUntracked(ctx, cfg)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func cleanAUR(ctx context.Context, run *runtime.Runtime,
|
||||
func cleanAUR(ctx context.Context, cfg *settings.Configuration,
|
||||
keepInstalled, keepCurrent, removeAll bool, dbExecutor db.Executor,
|
||||
) error {
|
||||
run.Logger.Println(gotext.Get("removing AUR packages from cache..."))
|
||||
cfg.Runtime.Logger.Println(gotext.Get("removing AUR packages from cache..."))
|
||||
|
||||
installedBases := mapset.NewThreadUnsafeSet[string]()
|
||||
inAURBases := mapset.NewThreadUnsafeSet[string]()
|
||||
|
||||
remotePackages := dbExecutor.InstalledRemotePackages()
|
||||
|
||||
files, err := os.ReadDir(run.Cfg.BuildDir)
|
||||
files, err := os.ReadDir(cfg.BuildDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -130,7 +130,7 @@ func cleanAUR(ctx context.Context, run *runtime.Runtime,
|
||||
// Querying the AUR is slow and needs internet so don't do it if we
|
||||
// don't need to.
|
||||
if keepCurrent {
|
||||
info, errInfo := run.AURClient.Get(ctx, &aur.Query{
|
||||
info, errInfo := cfg.Runtime.AURClient.Get(ctx, &aur.Query{
|
||||
Needles: cachedPackages,
|
||||
})
|
||||
if errInfo != nil {
|
||||
@ -165,20 +165,20 @@ func cleanAUR(ctx context.Context, run *runtime.Runtime,
|
||||
}
|
||||
}
|
||||
|
||||
dir := filepath.Join(run.Cfg.BuildDir, file.Name())
|
||||
run.Logger.Debugln("removing", dir)
|
||||
dir := filepath.Join(cfg.BuildDir, file.Name())
|
||||
cfg.Runtime.Logger.Debugln("removing", dir)
|
||||
if err = os.RemoveAll(dir); err != nil {
|
||||
run.Logger.Warnln(gotext.Get("Unable to remove %s: %s", dir, err))
|
||||
cfg.Runtime.Logger.Warnln(gotext.Get("Unable to remove %s: %s", dir, err))
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func cleanUntracked(ctx context.Context, run *runtime.Runtime) error {
|
||||
run.Logger.Println(gotext.Get("removing untracked AUR files from cache..."))
|
||||
func cleanUntracked(ctx context.Context, cfg *settings.Configuration) error {
|
||||
cfg.Runtime.Logger.Println(gotext.Get("removing untracked AUR files from cache..."))
|
||||
|
||||
files, err := os.ReadDir(run.Cfg.BuildDir)
|
||||
files, err := os.ReadDir(cfg.BuildDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -188,11 +188,12 @@ func cleanUntracked(ctx context.Context, run *runtime.Runtime) error {
|
||||
continue
|
||||
}
|
||||
|
||||
dir := filepath.Join(run.Cfg.BuildDir, file.Name())
|
||||
run.Logger.Debugln("cleaning", dir)
|
||||
dir := filepath.Join(cfg.BuildDir, file.Name())
|
||||
cfg.Runtime.Logger.Debugln("cleaning", dir)
|
||||
if isGitRepository(dir) {
|
||||
if err := run.CmdBuilder.Show(run.CmdBuilder.BuildGitCmd(ctx, dir, "clean", "-fx")); err != nil {
|
||||
run.Logger.Warnln(gotext.Get("Unable to clean:"), dir)
|
||||
if err := cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildGitCmd(ctx, dir, "clean", "-fx")); err != nil {
|
||||
cfg.Runtime.Logger.Warnln(gotext.Get("Unable to clean:"), dir)
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -205,3 +206,29 @@ func isGitRepository(dir string) bool {
|
||||
_, err := os.Stat(filepath.Join(dir, ".git"))
|
||||
return !os.IsNotExist(err)
|
||||
}
|
||||
|
||||
func cleanAfter(ctx context.Context, config *settings.Configuration,
|
||||
cmdBuilder exe.ICmdBuilder, pkgbuildDirs map[string]string,
|
||||
) {
|
||||
fmt.Println(gotext.Get("removing untracked AUR files from cache..."))
|
||||
|
||||
i := 0
|
||||
for _, dir := range pkgbuildDirs {
|
||||
text.OperationInfoln(gotext.Get("Cleaning (%d/%d): %s", i+1, len(pkgbuildDirs), text.Cyan(dir)))
|
||||
|
||||
_, stderr, err := cmdBuilder.Capture(
|
||||
cmdBuilder.BuildGitCmd(
|
||||
ctx, dir, "reset", "--hard", "HEAD"))
|
||||
if err != nil {
|
||||
text.Errorln(gotext.Get("error resetting %s: %s", dir, stderr))
|
||||
}
|
||||
|
||||
if err := config.Runtime.CmdBuilder.Show(
|
||||
config.Runtime.CmdBuilder.BuildGitCmd(
|
||||
ctx, dir, "clean", "-fx", "--exclude", "*.pkg.*")); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db/mock"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
@ -91,13 +90,15 @@ func TestCleanHanging(t *testing.T) {
|
||||
Runner: mockRunner,
|
||||
SudoLoopEnabled: false,
|
||||
}
|
||||
cfg := &settings.Configuration{
|
||||
Runtime: &settings.Runtime{CmdBuilder: cmdBuilder},
|
||||
}
|
||||
|
||||
run := &runtime.Runtime{CmdBuilder: cmdBuilder, Cfg: &settings.Configuration{}}
|
||||
cmdArgs := parser.MakeArguments()
|
||||
cmdArgs.AddArg(tc.args...)
|
||||
|
||||
err := handleCmd(context.Background(),
|
||||
run, cmdArgs, dbExc,
|
||||
cfg, cmdArgs, dbExc,
|
||||
)
|
||||
|
||||
require.NoError(t, err)
|
||||
|
200
cmd.go
200
cmd.go
@ -17,7 +17,6 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/intrange"
|
||||
"github.com/Jguer/yay/v12/pkg/news"
|
||||
"github.com/Jguer/yay/v12/pkg/query"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
@ -26,8 +25,8 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/vcs"
|
||||
)
|
||||
|
||||
func usage(logger *text.Logger) {
|
||||
logger.Println(`Usage:
|
||||
func usage() {
|
||||
fmt.Println(`Usage:
|
||||
yay
|
||||
yay <operation> [...]
|
||||
yay <package(s)>
|
||||
@ -54,7 +53,7 @@ If no operation is specified 'yay -Syu' will be performed
|
||||
If no operation is specified and targets are provided -Y will be assumed
|
||||
|
||||
New options:
|
||||
-N --repo Assume targets are from the repositories
|
||||
--repo Assume targets are from the repositories
|
||||
-a --aur Assume targets are from the AUR
|
||||
|
||||
Permanent configuration options:
|
||||
@ -92,19 +91,23 @@ Permanent configuration options:
|
||||
--cleanmenu Give the option to clean build PKGBUILDS
|
||||
--diffmenu Give the option to show diffs for build files
|
||||
--editmenu Give the option to edit/view PKGBUILDS
|
||||
--nocleanmenu Don't clean build PKGBUILDS
|
||||
--nodiffmenu Don't show diffs for build files
|
||||
--noeditmenu Don't edit/view PKGBUILDS
|
||||
--askremovemake Ask to remove makedepends after install
|
||||
--askyesremovemake Ask to remove makedepends after install("Y" as default)
|
||||
--removemake Remove makedepends after install
|
||||
--noremovemake Don't remove makedepends after install
|
||||
|
||||
--cleanafter Remove package sources after successful install
|
||||
--keepsrc Keep pkg/ and src/ after building packages
|
||||
--nocleanafter Do not remove package sources after successful build
|
||||
--bottomup Shows AUR's packages first and then repository's
|
||||
--topdown Shows repository's packages first and then AUR's
|
||||
--singlelineresults List each search result on its own line
|
||||
--doublelineresults List each search result on two lines, like pacman
|
||||
|
||||
--devel Check development packages during sysupgrade
|
||||
--nodevel Do not check development packages
|
||||
--rebuild Always build target packages
|
||||
--rebuildall Always build all AUR packages
|
||||
--norebuild Skip package build if in cache and up to date
|
||||
@ -113,14 +116,19 @@ Permanent configuration options:
|
||||
--noredownload Skip pkgbuild download if in cache and up to date
|
||||
--redownloadall Always download pkgbuilds of all AUR packages
|
||||
--provides Look for matching providers when searching for packages
|
||||
--noprovides Just look for packages by pkgname
|
||||
--pgpfetch Prompt to import PGP keys from PKGBUILDs
|
||||
--nopgpfetch Don't prompt to import PGP keys
|
||||
--useask Automatically resolve conflicts using pacman's ask flag
|
||||
--nouseask Confirm conflicts manually during the install
|
||||
|
||||
--sudo <file> sudo command to use
|
||||
--sudoflags <flags> Pass arguments to sudo
|
||||
--sudoloop Loop sudo calls in the background to avoid timeout
|
||||
--nosudoloop Do not loop sudo calls in the background
|
||||
|
||||
--timeupdate Check packages' AUR page for changes during sysupgrade
|
||||
--notimeupdate Do not check packages' AUR page for changes
|
||||
|
||||
show specific options:
|
||||
-c --complete Used for completions
|
||||
@ -130,7 +138,7 @@ show specific options:
|
||||
-w --news Print arch news
|
||||
|
||||
yay specific options:
|
||||
-c --clean Remove unneeded dependencies (-cc to ignore optdepends)
|
||||
-c --clean Remove unneeded dependencies
|
||||
--gendb Generates development package DB used for updating
|
||||
|
||||
getpkgbuild specific options:
|
||||
@ -138,49 +146,50 @@ getpkgbuild specific options:
|
||||
-p --print Print pkgbuild of packages`)
|
||||
}
|
||||
|
||||
func handleCmd(ctx context.Context, run *runtime.Runtime,
|
||||
func handleCmd(ctx context.Context, cfg *settings.Configuration,
|
||||
cmdArgs *parser.Arguments, dbExecutor db.Executor,
|
||||
) error {
|
||||
if cmdArgs.ExistsArg("h", "help") {
|
||||
return handleHelp(ctx, run, cmdArgs)
|
||||
return handleHelp(ctx, cfg, cmdArgs)
|
||||
}
|
||||
|
||||
if run.Cfg.SudoLoop && cmdArgs.NeedRoot(run.Cfg.Mode) {
|
||||
run.CmdBuilder.SudoLoop()
|
||||
if cfg.SudoLoop && cmdArgs.NeedRoot(cfg.Mode) {
|
||||
cfg.Runtime.CmdBuilder.SudoLoop()
|
||||
}
|
||||
|
||||
switch cmdArgs.Op {
|
||||
case "V", "version":
|
||||
handleVersion(run.Logger)
|
||||
handleVersion()
|
||||
|
||||
return nil
|
||||
case "D", "database":
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
case "F", "files":
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
case "Q", "query":
|
||||
return handleQuery(ctx, run, cmdArgs, dbExecutor)
|
||||
return handleQuery(ctx, cfg, cmdArgs, dbExecutor)
|
||||
case "R", "remove":
|
||||
return handleRemove(ctx, run, cmdArgs, run.VCSStore)
|
||||
return handleRemove(ctx, cfg, cmdArgs, cfg.Runtime.VCSStore)
|
||||
case "S", "sync":
|
||||
return handleSync(ctx, run, cmdArgs, dbExecutor)
|
||||
return handleSync(ctx, cfg, cmdArgs, dbExecutor)
|
||||
case "T", "deptest":
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
case "U", "upgrade":
|
||||
return handleUpgrade(ctx, run, cmdArgs)
|
||||
return handleUpgrade(ctx, cfg, cmdArgs)
|
||||
case "B", "build":
|
||||
return handleBuild(ctx, run, dbExecutor, cmdArgs)
|
||||
return handleBuild(ctx, cfg, dbExecutor, cmdArgs)
|
||||
case "G", "getpkgbuild":
|
||||
return handleGetpkgbuild(ctx, run, cmdArgs, dbExecutor)
|
||||
return handleGetpkgbuild(ctx, cfg, cmdArgs, dbExecutor)
|
||||
case "P", "show":
|
||||
return handlePrint(ctx, run, cmdArgs, dbExecutor)
|
||||
return handlePrint(ctx, cfg, cmdArgs, dbExecutor)
|
||||
case "Y", "yay":
|
||||
return handleYay(ctx, run, cmdArgs, run.CmdBuilder,
|
||||
dbExecutor, run.QueryBuilder)
|
||||
return handleYay(ctx, cfg, cmdArgs, cfg.Runtime.CmdBuilder,
|
||||
dbExecutor, cfg.Runtime.QueryBuilder)
|
||||
case "W", "web":
|
||||
return handleWeb(ctx, run, cmdArgs)
|
||||
return handleWeb(ctx, cfg, cmdArgs)
|
||||
}
|
||||
|
||||
return errors.New(gotext.Get("unhandled operation"))
|
||||
@ -210,19 +219,19 @@ func getFilter(cmdArgs *parser.Arguments) (upgrade.Filter, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func handleQuery(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
func handleQuery(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
if cmdArgs.ExistsArg("u", "upgrades") {
|
||||
filter, err := getFilter(cmdArgs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return printUpdateList(ctx, run, cmdArgs, dbExecutor,
|
||||
return printUpdateList(ctx, cfg, cmdArgs, dbExecutor,
|
||||
cmdArgs.ExistsDouble("u", "sysupgrade"), filter)
|
||||
}
|
||||
|
||||
if err := run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm)); err != nil {
|
||||
if err := cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm)); err != nil {
|
||||
if str := err.Error(); strings.Contains(str, "exit status") {
|
||||
// yay -Qdt should not output anything in case of error
|
||||
return fmt.Errorf("")
|
||||
@ -234,139 +243,138 @@ func handleQuery(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Argu
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleHelp(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments) error {
|
||||
usage(run.Logger)
|
||||
func handleHelp(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments) error {
|
||||
usage()
|
||||
switch cmdArgs.Op {
|
||||
case "Y", "yay", "G", "getpkgbuild", "P", "show", "W", "web", "B", "build":
|
||||
return nil
|
||||
}
|
||||
|
||||
run.Logger.Println("\npacman operation specific options:")
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
cfg.Runtime.Logger.Println("\npacman operation specific options:")
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
}
|
||||
|
||||
func handleVersion(logger *text.Logger) {
|
||||
logger.Printf("yay v%s - libalpm v%s\n", yayVersion, alpm.Version())
|
||||
func handleVersion() {
|
||||
fmt.Printf("yay v%s - libalpm v%s\n", yayVersion, alpm.Version())
|
||||
}
|
||||
|
||||
func handlePrint(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
func handlePrint(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
switch {
|
||||
case cmdArgs.ExistsArg("d", "defaultconfig"):
|
||||
tmpConfig := settings.DefaultConfig(yayVersion)
|
||||
run.Logger.Printf("%v", tmpConfig)
|
||||
fmt.Printf("%v", tmpConfig)
|
||||
|
||||
return nil
|
||||
case cmdArgs.ExistsArg("g", "currentconfig"):
|
||||
run.Logger.Printf("%v", run.Cfg)
|
||||
fmt.Printf("%v", cfg)
|
||||
|
||||
return nil
|
||||
case cmdArgs.ExistsArg("w", "news"):
|
||||
double := cmdArgs.ExistsDouble("w", "news")
|
||||
quiet := cmdArgs.ExistsArg("q", "quiet")
|
||||
|
||||
return news.PrintNewsFeed(ctx, run.HTTPClient, run.Logger,
|
||||
dbExecutor.LastBuildTime(), run.Cfg.BottomUp, double, quiet)
|
||||
return news.PrintNewsFeed(ctx, cfg.Runtime.HTTPClient, dbExecutor.LastBuildTime(), cfg.BottomUp, double, quiet)
|
||||
case cmdArgs.ExistsArg("c", "complete"):
|
||||
return completion.Show(ctx, run.HTTPClient, dbExecutor,
|
||||
run.Cfg.AURURL, run.Cfg.CompletionPath, run.Cfg.CompletionInterval, cmdArgs.ExistsDouble("c", "complete"))
|
||||
return completion.Show(ctx, cfg.Runtime.HTTPClient, dbExecutor,
|
||||
cfg.AURURL, cfg.CompletionPath, cfg.CompletionInterval, cmdArgs.ExistsDouble("c", "complete"))
|
||||
case cmdArgs.ExistsArg("s", "stats"):
|
||||
return localStatistics(ctx, run, dbExecutor)
|
||||
return localStatistics(ctx, cfg, dbExecutor)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleYay(ctx context.Context, run *runtime.Runtime,
|
||||
func handleYay(ctx context.Context, cfg *settings.Configuration,
|
||||
cmdArgs *parser.Arguments, cmdBuilder exe.ICmdBuilder,
|
||||
dbExecutor db.Executor, queryBuilder query.Builder,
|
||||
) error {
|
||||
switch {
|
||||
case cmdArgs.ExistsArg("gendb"):
|
||||
return createDevelDB(ctx, run, dbExecutor)
|
||||
return createDevelDB(ctx, cfg, dbExecutor)
|
||||
case cmdArgs.ExistsDouble("c"):
|
||||
return cleanDependencies(ctx, run.Cfg, cmdBuilder, cmdArgs, dbExecutor, true)
|
||||
return cleanDependencies(ctx, cfg, cmdBuilder, cmdArgs, dbExecutor, true)
|
||||
case cmdArgs.ExistsArg("c", "clean"):
|
||||
return cleanDependencies(ctx, run.Cfg, cmdBuilder, cmdArgs, dbExecutor, false)
|
||||
return cleanDependencies(ctx, cfg, cmdBuilder, cmdArgs, dbExecutor, false)
|
||||
case len(cmdArgs.Targets) > 0:
|
||||
return displayNumberMenu(ctx, run, cmdArgs.Targets, dbExecutor, queryBuilder, cmdArgs)
|
||||
return displayNumberMenu(ctx, cfg, cmdArgs.Targets, dbExecutor, queryBuilder, cmdArgs)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleWeb(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments) error {
|
||||
func handleWeb(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments) error {
|
||||
switch {
|
||||
case cmdArgs.ExistsArg("v", "vote"):
|
||||
return handlePackageVote(ctx, cmdArgs.Targets, run.AURClient, run.Logger,
|
||||
run.VoteClient, true)
|
||||
return handlePackageVote(ctx, cmdArgs.Targets, cfg.Runtime.AURClient,
|
||||
cfg.Runtime.VoteClient, true)
|
||||
case cmdArgs.ExistsArg("u", "unvote"):
|
||||
return handlePackageVote(ctx, cmdArgs.Targets, run.AURClient, run.Logger,
|
||||
run.VoteClient, false)
|
||||
return handlePackageVote(ctx, cmdArgs.Targets, cfg.Runtime.AURClient,
|
||||
cfg.Runtime.VoteClient, false)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleGetpkgbuild(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, dbExecutor download.DBSearcher) error {
|
||||
func handleGetpkgbuild(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments, dbExecutor download.DBSearcher) error {
|
||||
if cmdArgs.ExistsArg("p", "print") {
|
||||
return printPkgbuilds(dbExecutor, run.AURClient,
|
||||
run.HTTPClient, run.Logger, cmdArgs.Targets, run.Cfg.Mode, run.Cfg.AURURL)
|
||||
return printPkgbuilds(dbExecutor, cfg.Runtime.AURClient,
|
||||
cfg.Runtime.HTTPClient, cmdArgs.Targets, cfg.Mode, cfg.AURURL)
|
||||
}
|
||||
|
||||
return getPkgbuilds(ctx, dbExecutor, run.AURClient, run,
|
||||
return getPkgbuilds(ctx, dbExecutor, cfg.Runtime.AURClient, cfg,
|
||||
cmdArgs.Targets, cmdArgs.ExistsArg("f", "force"))
|
||||
}
|
||||
|
||||
func handleUpgrade(ctx context.Context,
|
||||
run *runtime.Runtime, cmdArgs *parser.Arguments,
|
||||
config *settings.Configuration, cmdArgs *parser.Arguments,
|
||||
) error {
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
return config.Runtime.CmdBuilder.Show(config.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, config.Mode, settings.NoConfirm))
|
||||
}
|
||||
|
||||
// -B* options
|
||||
func handleBuild(ctx context.Context,
|
||||
run *runtime.Runtime, dbExecutor db.Executor, cmdArgs *parser.Arguments,
|
||||
config *settings.Configuration, dbExecutor db.Executor, cmdArgs *parser.Arguments,
|
||||
) error {
|
||||
if cmdArgs.ExistsArg("i", "install") {
|
||||
return installLocalPKGBUILD(ctx, run, cmdArgs, dbExecutor)
|
||||
return installLocalPKGBUILD(ctx, config, cmdArgs, dbExecutor)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleSync(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
func handleSync(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments, dbExecutor db.Executor) error {
|
||||
targets := cmdArgs.Targets
|
||||
|
||||
switch {
|
||||
case cmdArgs.ExistsArg("s", "search"):
|
||||
return syncSearch(ctx, targets, dbExecutor, run.QueryBuilder, !cmdArgs.ExistsArg("q", "quiet"))
|
||||
return syncSearch(ctx, targets, dbExecutor, cfg.Runtime.QueryBuilder, !cmdArgs.ExistsArg("q", "quiet"))
|
||||
case cmdArgs.ExistsArg("p", "print", "print-format"):
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
case cmdArgs.ExistsArg("c", "clean"):
|
||||
return syncClean(ctx, run, cmdArgs, dbExecutor)
|
||||
return syncClean(ctx, cfg, cmdArgs, dbExecutor)
|
||||
case cmdArgs.ExistsArg("l", "list"):
|
||||
return syncList(ctx, run, run.HTTPClient, cmdArgs, dbExecutor)
|
||||
return syncList(ctx, cfg, cfg.Runtime.HTTPClient, cmdArgs, dbExecutor)
|
||||
case cmdArgs.ExistsArg("g", "groups"):
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
case cmdArgs.ExistsArg("i", "info"):
|
||||
return syncInfo(ctx, run, cmdArgs, targets, dbExecutor)
|
||||
return syncInfo(ctx, cfg, cmdArgs, targets, dbExecutor)
|
||||
case cmdArgs.ExistsArg("u", "sysupgrade") || len(cmdArgs.Targets) > 0:
|
||||
return syncInstall(ctx, run, cmdArgs, dbExecutor)
|
||||
return syncInstall(ctx, cfg, cmdArgs, dbExecutor)
|
||||
case cmdArgs.ExistsArg("y", "refresh"):
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleRemove(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments, localCache vcs.Store) error {
|
||||
err := run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
func handleRemove(ctx context.Context, cfg *settings.Configuration, cmdArgs *parser.Arguments, localCache vcs.Store) error {
|
||||
err := cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
if err == nil {
|
||||
localCache.RemovePackages(cmdArgs.Targets)
|
||||
}
|
||||
@ -375,7 +383,7 @@ func handleRemove(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arg
|
||||
}
|
||||
|
||||
// NumberMenu presents a CLI for selecting packages to install.
|
||||
func displayNumberMenu(ctx context.Context, run *runtime.Runtime, pkgS []string, dbExecutor db.Executor,
|
||||
func displayNumberMenu(ctx context.Context, cfg *settings.Configuration, pkgS []string, dbExecutor db.Executor,
|
||||
queryBuilder query.Builder, cmdArgs *parser.Arguments,
|
||||
) error {
|
||||
queryBuilder.Execute(ctx, dbExecutor, pkgS)
|
||||
@ -389,9 +397,9 @@ func displayNumberMenu(ctx context.Context, run *runtime.Runtime, pkgS []string,
|
||||
return nil
|
||||
}
|
||||
|
||||
run.Logger.Infoln(gotext.Get("Packages to install (eg: 1 2 3, 1-3 or ^4)"))
|
||||
cfg.Runtime.Logger.Infoln(gotext.Get("Packages to install (eg: 1 2 3, 1-3 or ^4)"))
|
||||
|
||||
numberBuf, err := run.Logger.GetInput("", false)
|
||||
numberBuf, err := cfg.Runtime.Logger.GetInput("", false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -407,27 +415,27 @@ func displayNumberMenu(ctx context.Context, run *runtime.Runtime, pkgS []string,
|
||||
cmdArgs.Targets = targets
|
||||
|
||||
if len(cmdArgs.Targets) == 0 {
|
||||
run.Logger.Println(gotext.Get(" there is nothing to do"))
|
||||
fmt.Println(gotext.Get(" there is nothing to do"))
|
||||
return nil
|
||||
}
|
||||
|
||||
return syncInstall(ctx, run, cmdArgs, dbExecutor)
|
||||
return syncInstall(ctx, cfg, cmdArgs, dbExecutor)
|
||||
}
|
||||
|
||||
func syncList(ctx context.Context, run *runtime.Runtime,
|
||||
func syncList(ctx context.Context, cfg *settings.Configuration,
|
||||
httpClient *http.Client, cmdArgs *parser.Arguments, dbExecutor db.Executor,
|
||||
) error {
|
||||
aur := false
|
||||
|
||||
for i := len(cmdArgs.Targets) - 1; i >= 0; i-- {
|
||||
if cmdArgs.Targets[i] == "aur" && run.Cfg.Mode.AtLeastAUR() {
|
||||
if cmdArgs.Targets[i] == "aur" && cfg.Mode.AtLeastAUR() {
|
||||
cmdArgs.Targets = append(cmdArgs.Targets[:i], cmdArgs.Targets[i+1:]...)
|
||||
aur = true
|
||||
}
|
||||
}
|
||||
|
||||
if run.Cfg.Mode.AtLeastAUR() && (len(cmdArgs.Targets) == 0 || aur) {
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, run.Cfg.AURURL+"/packages.gz", http.NoBody)
|
||||
if cfg.Mode.AtLeastAUR() && (len(cmdArgs.Targets) == 0 || aur) {
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, cfg.AURURL+"/packages.gz", http.NoBody)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -445,22 +453,22 @@ func syncList(ctx context.Context, run *runtime.Runtime,
|
||||
for scanner.Scan() {
|
||||
name := scanner.Text()
|
||||
if cmdArgs.ExistsArg("q", "quiet") {
|
||||
run.Logger.Println(name)
|
||||
fmt.Println(name)
|
||||
} else {
|
||||
run.Logger.Printf("%s %s %s", text.Magenta("aur"), text.Bold(name), text.Bold(text.Green(gotext.Get("unknown-version"))))
|
||||
fmt.Printf("%s %s %s", text.Magenta("aur"), text.Bold(name), text.Bold(text.Green(gotext.Get("unknown-version"))))
|
||||
|
||||
if dbExecutor.LocalPackage(name) != nil {
|
||||
run.Logger.Print(text.Bold(text.Blue(gotext.Get(" [Installed]"))))
|
||||
fmt.Print(text.Bold(text.Blue(gotext.Get(" [Installed]"))))
|
||||
}
|
||||
|
||||
run.Logger.Println()
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if run.Cfg.Mode.AtLeastRepo() && (len(cmdArgs.Targets) != 0 || !aur) {
|
||||
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
|
||||
if cfg.Mode.AtLeastRepo() && (len(cmdArgs.Targets) != 0 || !aur) {
|
||||
return cfg.Runtime.CmdBuilder.Show(cfg.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, cfg.Mode, settings.NoConfirm))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
23
cmd_test.go
23
cmd_test.go
@ -19,7 +19,6 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/db/mock"
|
||||
mockaur "github.com/Jguer/yay/v12/pkg/dep/mock"
|
||||
"github.com/Jguer/yay/v12/pkg/query"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
@ -104,19 +103,19 @@ func TestYogurtMenuAURDB(t *testing.T) {
|
||||
},
|
||||
}
|
||||
logger := text.NewLogger(io.Discard, os.Stderr, strings.NewReader("1\n"), true, "test")
|
||||
|
||||
run := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
cfg := &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: logger,
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
QueryBuilder: query.NewSourceQueryBuilder(aurCache, logger, "votes", parser.ModeAny, "name",
|
||||
true, false, true),
|
||||
AURClient: aurCache,
|
||||
},
|
||||
Logger: logger,
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
QueryBuilder: query.NewSourceQueryBuilder(aurCache, logger, "votes", parser.ModeAny, "name",
|
||||
true, false, true),
|
||||
AURClient: aurCache,
|
||||
}
|
||||
err = handleCmd(context.Background(), run, cmdArgs, db)
|
||||
|
||||
err = handleCmd(context.Background(), cfg, cmdArgs, db)
|
||||
require.NoError(t, err)
|
||||
|
||||
wantCapture := []string{}
|
||||
|
@ -61,22 +61,22 @@ _yay() {
|
||||
search unrequired upgrades' 'c e g i k l m n o p s t u')
|
||||
remove=('cascade dbonly nodeps assume-installed nosave print recursive unneeded' 'c n p s u')
|
||||
sync=('asdeps asexplicit clean dbonly downloadonly overwrite groups ignore ignoregroup
|
||||
info list needed nodeps assume-installed print refresh recursive search sysupgrade aur repo'
|
||||
'c g i l p s u w y a N')
|
||||
info list needed nodeps assume-installed print refresh recursive search sysupgrade'
|
||||
'c g i l p s u w y')
|
||||
upgrade=('asdeps asexplicit overwrite needed nodeps assume-installed print recursive' 'p')
|
||||
core=('database files help query remove sync upgrade version' 'D F Q R S U V h')
|
||||
|
||||
##yay stuff
|
||||
common=('arch cachedir color config confirm dbpath debug gpgdir help hookdir logfile
|
||||
noconfirm noprogressbar noscriptlet quiet root verbose
|
||||
makepkg pacman git gpg gpgflags config requestsplitn sudoloop
|
||||
makepkg pacman git gpg gpgflags config requestsplitn sudoloop nosudoloop
|
||||
redownload noredownload redownloadall rebuild rebuildall rebuildtree norebuild sortby
|
||||
singlelineresults doublelineresults answerclean answerdiff answeredit answerupgrade noanswerclean noanswerdiff
|
||||
noansweredit noanswerupgrade cleanmenu diffmenu editmenu cleanafter keepsrc
|
||||
provides pgpfetch
|
||||
useask combinedupgrade aur repo makepkgconf
|
||||
noansweredit noanswerupgrade cleanmenu diffmenu editmenu cleanafter nocleanafter
|
||||
nocleanmenu nodiffmenu provides noprovides pgpfetch nopgpfetch
|
||||
useask nouseask combinedupgrade nocombinedupgrade aur repo makepkgconf
|
||||
nomakepkgconf askremovemake askyesremovemake removemake noremovemake completioninterval aururl aurrpcurl
|
||||
searchby batchinstall'
|
||||
searchby batchinstall nobatchinstall'
|
||||
'b d h q r v')
|
||||
yays=('clean gendb' 'c')
|
||||
show=('complete defaultconfig currentconfig stats news' 'c d g s w')
|
||||
|
@ -165,8 +165,8 @@ complete -c $progname -n "$webspecific" -s u -l unvote -d 'Unvote for AUR packag
|
||||
complete -c $progname -n "$webspecific" -xa "$listall"
|
||||
|
||||
# New options
|
||||
complete -c $progname -n "not $noopt" -s a -l aur -d 'Assume targets are from the AUR' -f
|
||||
complete -c $progname -n "not $noopt" -s N -l repo -d 'Assume targets are from the repositories' -f
|
||||
complete -c $progname -n "not $noopt" -l repo -d 'Assume targets are from the AUR' -f
|
||||
complete -c $progname -n "not $noopt" -s a -l aur -d 'Assume targets are from the repositories' -f
|
||||
|
||||
# Yay options
|
||||
complete -c $progname -n "$yayspecific" -s c -l clean -d 'Remove unneeded dependencies' -f
|
||||
@ -216,6 +216,9 @@ complete -c $progname -n "not $noopt" -l noanswerupgrade -d 'Unset the answer fo
|
||||
complete -c $progname -n "not $noopt" -l cleanmenu -d 'Give the option to clean build PKGBUILDS' -f
|
||||
complete -c $progname -n "not $noopt" -l diffmenu -d 'Give the option to show diffs for build files' -f
|
||||
complete -c $progname -n "not $noopt" -l editmenu -d 'Give the option to edit/view PKGBUILDS' -f
|
||||
complete -c $progname -n "not $noopt" -l nocleanmenu -d 'Do not clean build PKGBUILDS' -f
|
||||
complete -c $progname -n "not $noopt" -l nodiffmenu -d 'Do not show diffs for build files' -f
|
||||
complete -c $progname -n "not $noopt" -l noeditmenu -d 'Do not edit/view PKGBUILDS' -f
|
||||
complete -c $progname -n "not $noopt" -l askremovemake -d 'Ask to remove make deps after install' -f
|
||||
complete -c $progname -n "not $noopt" -l askyesremovemake -d 'Ask to remove make deps after install(with "Y" as default)' -f
|
||||
complete -c $progname -n "not $noopt" -l removemake -d 'Remove make deps after install' -f
|
||||
@ -225,17 +228,24 @@ complete -c $progname -n "not $noopt" -l bottomup -d 'Shows aur packages first a
|
||||
complete -c $progname -n "not $noopt" -l singlelineresults -d 'List each search result on its own line' -f
|
||||
complete -c $progname -n "not $noopt" -l doublelineresults -d 'List each search result on two lines, like pacman' -f
|
||||
complete -c $progname -n "not $noopt" -l devel -d 'Check -git/-svn/-hg development version' -f
|
||||
complete -c $progname -n "not $noopt" -l nodevel -d 'Disable development version checking' -f
|
||||
complete -c $progname -n "not $noopt" -l cleanafter -d 'Clean package sources after successful build' -f
|
||||
complete -c $progname -n "not $noopt" -l keepsrc -d 'Keep pkg/ and src/ after building packages' -f
|
||||
complete -c $progname -n "not $noopt" -l nocleanafter -d 'Disable package sources cleaning' -f
|
||||
complete -c $progname -n "not $noopt" -l timeupdate -d 'Check package modification date and version' -f
|
||||
complete -c $progname -n "not $noopt" -l notimeupdate -d 'Check only package version change' -f
|
||||
complete -c $progname -n "not $noopt" -l redownload -d 'Redownload PKGBUILD of package even if up-to-date' -f
|
||||
complete -c $progname -n "not $noopt" -l redownloadall -d 'Redownload PKGBUILD of package and deps even if up-to-date' -f
|
||||
complete -c $progname -n "not $noopt" -l noredownload -d 'Do not redownload up-to-date PKGBUILDs' -f
|
||||
complete -c $progname -n "not $noopt" -l provides -d 'Look for matching providers when searching for packages' -f
|
||||
complete -c $progname -n "not $noopt" -l noprovides -d 'Just look for packages by pkgname' -f
|
||||
complete -c $progname -n "not $noopt" -l pgpfetch -d 'Prompt to import PGP keys from PKGBUILDs' -f
|
||||
complete -c $progname -n "not $noopt" -l nopgpfetch -d 'Do not prompt to import PGP keys' -f
|
||||
complete -c $progname -n "not $noopt" -l useask -d 'Automatically resolve conflicts using pacmans ask flag' -f
|
||||
complete -c $progname -n "not $noopt" -l nouseask -d 'Confirm conflicts manually during the install' -f
|
||||
complete -c $progname -n "not $noopt" -l combinedupgrade -d 'Refresh then perform the repo and AUR upgrade together' -f
|
||||
complete -c $progname -n "not $noopt" -l nocombinedupgrade -d 'Perform the repo upgrade and AUR upgrade separately' -f
|
||||
complete -c $progname -n "not $noopt" -l batchinstall -d 'Build multiple AUR packages then install them together' -f
|
||||
complete -c $progname -n "not $noopt" -l nobatchinstall -d 'Build and install each AUR package one by one' -f
|
||||
complete -c $progname -n "not $noopt" -l rebuild -d 'Always build target packages' -f
|
||||
complete -c $progname -n "not $noopt" -l rebuildall -d 'Always build all AUR packages' -f
|
||||
complete -c $progname -n "not $noopt" -l rebuildtree -d 'Always build all AUR packages even if installed' -f
|
||||
@ -243,3 +253,4 @@ complete -c $progname -n "not $noopt" -l norebuild -d 'Skip package build if in
|
||||
complete -c $progname -n "not $noopt" -l mflags -d 'Pass the following options to makepkg' -f
|
||||
complete -c $progname -n "not $noopt" -l gpgflags -d 'Pass the following options to gpg' -f
|
||||
complete -c $progname -n "not $noopt" -l sudoloop -d 'Loop sudo calls in the background to avoid timeout' -f
|
||||
complete -c $progname -n "not $noopt" -l nosudoloop -d 'Do not loop sudo calls in the background' -f
|
||||
|
@ -23,7 +23,7 @@ _pacman_opts_commands=(
|
||||
|
||||
# options for passing to _arguments: options common to all commands
|
||||
_pacman_opts_common=(
|
||||
{-N,--repo}'[Assume targets are from the repositories]'
|
||||
'--repo[Assume targets are from the repositories]'
|
||||
{-a,--aur}'[Assume targets are from the AUR]'
|
||||
'--aururl[Set an alternative AUR URL]:url'
|
||||
'--aurrpcurl[Set an alternative URL for the AUR /rpc endpoint]:url'
|
||||
@ -70,6 +70,9 @@ _pacman_opts_common=(
|
||||
'--cleanmenu[Give the option to clean build PKGBUILDS]'
|
||||
'--diffmenu[Give the option to show diffs for build files]'
|
||||
'--editmenu[Give the option to edit/view PKGBUILDS]'
|
||||
"--nocleanmenu[Don't clean build PKGBUILDS]"
|
||||
"--nodiffmenu[Don't show diffs for build files]"
|
||||
"--noeditmenu[Don't edit/view PKGBUILDS]"
|
||||
"--askremovemake[Ask to remove makedepends after install]"
|
||||
"--askyesremovemake[Ask to remove makedepends after install(with "Y" as default)]"
|
||||
"--removemake[Remove makedepends after install]"
|
||||
@ -80,26 +83,34 @@ _pacman_opts_common=(
|
||||
'--singlelineresults[List each search result on its own line]'
|
||||
'--doublelineresults[List each search result on two lines, like pacman]'
|
||||
'--devel[Check -git/-svn/-hg development version]'
|
||||
'--nodevel[Disable development version checking]'
|
||||
'--cleanafter[Clean package sources after successful build]'
|
||||
'--keepsrc[Keep pkg/ and src/ after building packages]'
|
||||
'--nocleanafter[Disable package sources cleaning after successful build]'
|
||||
'--timeupdate[Check packages modification date and version]'
|
||||
'--notimeupdate[Check only package version change]'
|
||||
'--redownload[Always download pkgbuilds of targets]'
|
||||
'--redownloadall[Always download pkgbuilds of all AUR packages]'
|
||||
'--noredownload[Skip pkgbuild download if in cache and up to date]'
|
||||
'--rebuild[Always build target packages]'
|
||||
'--rebuildall[Always build all AUR packages]'
|
||||
'--provides[Look for matching providers when searching for packages]'
|
||||
'--noprovides[Just look for packages by pkgname]'
|
||||
'--pgpfetch[Prompt to import PGP keys from PKGBUILDs]'
|
||||
"--nopgpfetch[Don't prompt to import PGP keys]"
|
||||
"--useask[Automatically resolve conflicts using pacman's ask flag]"
|
||||
'--nouseask[Confirm conflicts manually during the install]'
|
||||
'--combinedupgrade[Refresh then perform the repo and AUR upgrade together]'
|
||||
'--nocombinedupgrade[Perform the repo upgrade and AUR upgrade separately]'
|
||||
'--rebuildtree[Always build all AUR packages even if installed]'
|
||||
'--norebuild[Skip package build if in cache and up to date]'
|
||||
'--mflags[Pass arguments to makepkg]:mflags'
|
||||
'--gpgflags[Pass arguments to gpg]:gpgflags'
|
||||
'--sudoloop[Loop sudo calls in the background to avoid timeout]'
|
||||
'--nosudoloop[Do not loop sudo calls in the background]'
|
||||
'--searchby[Search for packages using a specified field]'
|
||||
'--sortby[Sort AUR results by a specific field during search]'
|
||||
'--batchinstall[Build multiple AUR packages then install them together]'
|
||||
'--nobatchinstall[Build and install each AUR package one by one]'
|
||||
)
|
||||
|
||||
# options for passing to _arguments: options for --upgrade commands
|
||||
|
69
doc/yay.8
69
doc/yay.8
@ -63,7 +63,7 @@ Yay will also remove cached data about devel packages.
|
||||
|
||||
.SH NEW OPTIONS
|
||||
.TP
|
||||
.B \-N, \-\-repo
|
||||
.B \-\-repo
|
||||
Assume all targets are from the repositories. Additionally Actions such as
|
||||
sysupgrade will only act on repository packages.
|
||||
|
||||
@ -97,10 +97,6 @@ used when migrating to Yay from another AUR helper.
|
||||
.B \-c, \-\-clean
|
||||
Remove unneeded dependencies.
|
||||
|
||||
.TP
|
||||
.B \-cc
|
||||
Remove unneeded dependencies, including packages optionally required by any other package.
|
||||
|
||||
.SH SHOW OPTIONS (APPLY TO \-P AND \-\-show)
|
||||
.TP
|
||||
.B \-c, \-\-complete
|
||||
@ -297,9 +293,6 @@ Unset the answer for the upgrade menu.
|
||||
Show the clean menu. This menu gives you the chance to fully delete the
|
||||
downloaded build files from Yay's cache before redownloading a fresh copy.
|
||||
|
||||
If 'cleanmenu' is enabled in the configuration file, you can temporarily disable it by
|
||||
using '--cleanmenu=false' on the command line
|
||||
|
||||
.TP
|
||||
.B \-\-diffmenu
|
||||
Show the diff menu. This menu gives you the option to view diffs from
|
||||
@ -317,6 +310,18 @@ before building.
|
||||
\fBWarning\fR: Yay resolves dependencies ahead of time via the RPC. It is not
|
||||
recommended to edit pkgbuild variables unless you know what you are doing.
|
||||
|
||||
.TP
|
||||
.B \-\-nocleanmenu
|
||||
Do not show the clean menu.
|
||||
|
||||
.TP
|
||||
.B \-\-nodiffmenu
|
||||
Do not show the diff menu.
|
||||
|
||||
.TP
|
||||
.B \-\-noeditmenu
|
||||
Do not show the edit menu.
|
||||
|
||||
.TP
|
||||
.B \-\-askremovemake
|
||||
Ask to remove makedepends after installing packages.
|
||||
@ -363,8 +368,9 @@ checked almost instantly and not require the original pkgbuild to be downloaded.
|
||||
The slower pacaur-like devel checks can be implemented manually by piping
|
||||
a list of packages into yay (see \fBexamples\fR).
|
||||
|
||||
If 'devel' is enabled in the configuration file, you can temporarily disable it by
|
||||
using '--devel=false' on the command line
|
||||
.TP
|
||||
.B \-\-nodevel
|
||||
Do not check for development packages updates during sysupgrade.
|
||||
|
||||
.TP
|
||||
.B \-\-cleanafter
|
||||
@ -375,18 +381,26 @@ This allows VCS packages to easily pull an update
|
||||
instead of having to reclone the entire repo.
|
||||
|
||||
.TP
|
||||
.B \-\-keepsrc
|
||||
Keep pkg/ and src/ after building packages
|
||||
.B \-\-nocleanafter
|
||||
Do not remove package sources after successful Install.
|
||||
|
||||
.TP
|
||||
.B \-\-timeupdate
|
||||
During sysupgrade also compare the build time of installed packages against
|
||||
the last modification time of each package's AUR page.
|
||||
|
||||
.TP
|
||||
.B \-\-notimeupdate
|
||||
Do not consider build times during sysupgrade.
|
||||
|
||||
.TP
|
||||
.B \-\-separatesources
|
||||
Separate query results by source, AUR and sync
|
||||
|
||||
.TP
|
||||
.B \-\-noseparatesources
|
||||
Do not separate query results by source for searching
|
||||
|
||||
.TP
|
||||
.B \-\-redownload
|
||||
Always download pkgbuilds of targets even when a copy is available in cache.
|
||||
@ -407,11 +421,23 @@ Look for matching providers when searching for AUR packages. When multiple
|
||||
providers are found a menu will appear prompting you to pick one. This
|
||||
increases dependency resolve time although this should not be noticeable.
|
||||
|
||||
.TP
|
||||
.B \-\-noprovides
|
||||
Do not look for matching providers when searching for AUR packages.
|
||||
Yay will never show its provider menu but Pacman will still show its
|
||||
provider menu for repo packages.
|
||||
|
||||
.TP
|
||||
.B \-\-pgpfetch
|
||||
Prompt to import unknown PGP keys from the \fBvalidpgpkeys\fR field of each
|
||||
PKGBUILD.
|
||||
|
||||
.TP
|
||||
.B \-\-nopgpfetch
|
||||
Do not prompt to import unknown PGP keys. This is likely to cause a build
|
||||
failure unless using options such as \fB\-\-skippgpcheck\fR or a customized
|
||||
gpg config\%.
|
||||
|
||||
.TP
|
||||
.B \-\-useask
|
||||
Use pacman's --ask flag to automatically confirm package conflicts. Yay lists
|
||||
@ -419,6 +445,11 @@ conflicts ahead of time. It is possible that Yay does not detect
|
||||
a conflict, causing a package to be removed without the user's confirmation.
|
||||
However, this is very unlikely.
|
||||
|
||||
.TP
|
||||
.B \-\-nouseask
|
||||
Manually resolve package conflicts during the install. Packages which do not
|
||||
conflict will not need to be confined manually.
|
||||
|
||||
.TP
|
||||
.B \-\-combinedupgrade
|
||||
During sysupgrade, Yay will first perform a refresh, then show
|
||||
@ -430,6 +461,12 @@ If Yay exits for any reason After the refresh without upgrading. It is then
|
||||
the user's responsibility to either resolve the reason Yay exited or run
|
||||
a sysupgrade through pacman directly.
|
||||
|
||||
.TP
|
||||
.B \-\-nocombinedupgrade
|
||||
During sysupgrade, Pacman \-Syu will be called, then the AUR upgrade will
|
||||
start. This means the upgrade menu and pkgbuild review will be performed
|
||||
after the sysupgrade has finished.
|
||||
|
||||
.TP
|
||||
.B \-\-batchinstall
|
||||
When building and installing AUR packages instead of installing each package
|
||||
@ -437,6 +474,10 @@ after building, queue each package for install. Then once either all packages
|
||||
are built or a package in the build queue is needed as a dependency to build
|
||||
another package, install all the packages in the install queue.
|
||||
|
||||
.TP
|
||||
.B \-\-nobatchinstall
|
||||
Always install AUR packages immediately after building them.
|
||||
|
||||
.TP
|
||||
.B \-\-rebuild
|
||||
Always build target packages even when a copy is available in cache.
|
||||
@ -490,6 +531,10 @@ separated list that is quoted by the shell.
|
||||
Loop sudo calls in the background to prevent sudo from timing out during long
|
||||
builds.
|
||||
|
||||
.TP
|
||||
.B \-\-nosudoloop
|
||||
Do not loop sudo calls in the background.
|
||||
|
||||
.SH EXAMPLES
|
||||
.TP
|
||||
yay \fIfoo\fR
|
||||
|
53
errors.go
53
errors.go
@ -7,3 +7,56 @@ import (
|
||||
)
|
||||
|
||||
var ErrPackagesNotFound = errors.New(gotext.Get("could not find all required packages"))
|
||||
|
||||
type NoPkgDestsFoundError struct {
|
||||
dir string
|
||||
}
|
||||
|
||||
func (e *NoPkgDestsFoundError) Error() string {
|
||||
return gotext.Get("could not find any package archives listed in %s", e.dir)
|
||||
}
|
||||
|
||||
type SetPkgReasonError struct {
|
||||
exp bool // explicit
|
||||
}
|
||||
|
||||
func (e *SetPkgReasonError) Error() string {
|
||||
reason := gotext.Get("explicit")
|
||||
if !e.exp {
|
||||
reason = gotext.Get("dependency")
|
||||
}
|
||||
|
||||
return gotext.Get("error updating package install reason to %s", reason)
|
||||
}
|
||||
|
||||
type FindPkgDestError struct {
|
||||
name, pkgDest string
|
||||
}
|
||||
|
||||
func (e *FindPkgDestError) Error() string {
|
||||
return gotext.Get(
|
||||
"the PKGDEST for %s is listed by makepkg but does not exist: %s",
|
||||
e.name, e.pkgDest)
|
||||
}
|
||||
|
||||
type PkgDestNotInListError struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func (e *PkgDestNotInListError) Error() string {
|
||||
return gotext.Get("could not find PKGDEST for: %s", e.name)
|
||||
}
|
||||
|
||||
type FailedIgnoredPkgError struct {
|
||||
pkgErrors map[string]error
|
||||
}
|
||||
|
||||
func (e *FailedIgnoredPkgError) Error() string {
|
||||
msg := gotext.Get("Failed to install the following packages. Manual intervention is required:")
|
||||
|
||||
for pkg, err := range e.pkgErrors {
|
||||
msg += "\n" + pkg + " - " + err.Error()
|
||||
}
|
||||
|
||||
return msg
|
||||
}
|
||||
|
26
get.go
26
get.go
@ -11,23 +11,25 @@ import (
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/download"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
// yay -Gp.
|
||||
func printPkgbuilds(dbExecutor download.DBSearcher, aurClient aur.QueryClient,
|
||||
httpClient *http.Client, logger *text.Logger, targets []string,
|
||||
func printPkgbuilds(dbExecutor download.DBSearcher, aurClient aur.QueryClient, httpClient *http.Client, targets []string,
|
||||
mode parser.TargetMode, aurURL string,
|
||||
) error {
|
||||
pkgbuilds, err := download.PKGBUILDs(dbExecutor, aurClient, httpClient, logger, targets, aurURL, mode)
|
||||
pkgbuilds, err := download.PKGBUILDs(dbExecutor, aurClient, httpClient, targets, aurURL, mode)
|
||||
if err != nil {
|
||||
logger.Errorln(err)
|
||||
text.Errorln(err)
|
||||
}
|
||||
|
||||
for target, pkgbuild := range pkgbuilds {
|
||||
logger.Printf("\n\n# %s\n\n%s", target, string(pkgbuild))
|
||||
if len(pkgbuilds) != 0 {
|
||||
for target, pkgbuild := range pkgbuilds {
|
||||
fmt.Printf("\n\n# %s\n\n", target)
|
||||
fmt.Print(string(pkgbuild))
|
||||
}
|
||||
}
|
||||
|
||||
if len(pkgbuilds) != len(targets) {
|
||||
@ -39,7 +41,7 @@ func printPkgbuilds(dbExecutor download.DBSearcher, aurClient aur.QueryClient,
|
||||
}
|
||||
}
|
||||
|
||||
logger.Warnln(gotext.Get("Unable to find the following packages:"), " ", strings.Join(missing, ", "))
|
||||
text.Warnln(gotext.Get("Unable to find the following packages:"), " ", strings.Join(missing, ", "))
|
||||
|
||||
return fmt.Errorf("")
|
||||
}
|
||||
@ -49,7 +51,7 @@ func printPkgbuilds(dbExecutor download.DBSearcher, aurClient aur.QueryClient,
|
||||
|
||||
// yay -G.
|
||||
func getPkgbuilds(ctx context.Context, dbExecutor download.DBSearcher, aurClient aur.QueryClient,
|
||||
run *runtime.Runtime, targets []string, force bool,
|
||||
config *settings.Configuration, targets []string, force bool,
|
||||
) error {
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
@ -57,9 +59,9 @@ func getPkgbuilds(ctx context.Context, dbExecutor download.DBSearcher, aurClient
|
||||
}
|
||||
|
||||
cloned, errD := download.PKGBUILDRepos(ctx, dbExecutor, aurClient,
|
||||
run.CmdBuilder, run.Logger, targets, run.Cfg.Mode, run.Cfg.AURURL, wd, force)
|
||||
config.Runtime.CmdBuilder, targets, config.Mode, config.AURURL, wd, force)
|
||||
if errD != nil {
|
||||
run.Logger.Errorln(errD)
|
||||
text.Errorln(errD)
|
||||
}
|
||||
|
||||
if len(targets) != len(cloned) {
|
||||
@ -71,7 +73,7 @@ func getPkgbuilds(ctx context.Context, dbExecutor download.DBSearcher, aurClient
|
||||
}
|
||||
}
|
||||
|
||||
run.Logger.Warnln(gotext.Get("Unable to find the following packages:"), " ", strings.Join(missing, ", "))
|
||||
text.Warnln(gotext.Get("Unable to find the following packages:"), " ", strings.Join(missing, ", "))
|
||||
|
||||
err = fmt.Errorf("")
|
||||
}
|
||||
|
38
go.mod
38
go.mod
@ -2,34 +2,40 @@ module github.com/Jguer/yay/v12
|
||||
|
||||
require (
|
||||
github.com/Jguer/aur v1.2.3
|
||||
github.com/Jguer/go-alpm/v2 v2.2.2
|
||||
github.com/Jguer/go-alpm/v2 v2.2.1
|
||||
github.com/Jguer/votar v1.0.0
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
|
||||
github.com/Morganamilo/go-srcinfo v1.0.0
|
||||
github.com/adrg/strutil v0.3.1
|
||||
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
|
||||
github.com/deckarep/golang-set/v2 v2.8.0
|
||||
github.com/hashicorp/go-multierror v1.1.1
|
||||
github.com/leonelquinteros/gotext v1.7.2
|
||||
github.com/stretchr/testify v1.10.0
|
||||
golang.org/x/net v0.41.0
|
||||
golang.org/x/sys v0.33.0
|
||||
golang.org/x/term v0.32.0
|
||||
github.com/leonelquinteros/gotext v1.5.2
|
||||
github.com/stretchr/testify v1.8.4
|
||||
golang.org/x/sys v0.10.0
|
||||
golang.org/x/term v0.10.0
|
||||
golang.org/x/text v0.11.0 // indirect
|
||||
gopkg.in/h2non/gock.v1 v1.1.2
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/adrg/strutil v0.3.0
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/itchyny/gojq v0.12.17 // indirect
|
||||
github.com/itchyny/timefmt-go v0.1.6 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/ohler55/ojg v1.26.1 // indirect
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
||||
|
||||
go 1.23.5
|
||||
require (
|
||||
github.com/deckarep/golang-set/v2 v2.3.0
|
||||
github.com/itchyny/gojq v0.12.13 // indirect
|
||||
github.com/itchyny/timefmt-go v0.1.5 // indirect
|
||||
github.com/ohler55/ojg v1.19.1 // indirect
|
||||
)
|
||||
|
||||
toolchain go1.24.0
|
||||
require github.com/hashicorp/go-multierror v1.1.1
|
||||
|
||||
require (
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
)
|
||||
|
||||
go 1.19
|
||||
|
75
go.sum
75
go.sum
@ -1,15 +1,15 @@
|
||||
github.com/Jguer/aur v1.2.3 h1:D+OGgLxnAnZnw88DsRvnRQsn0Poxsy9ng7pBcsA0krM=
|
||||
github.com/Jguer/aur v1.2.3/go.mod h1:Dahvb6L1yr0rR7svyYSDwaRJoQMeyvJblwJ3QH/7CUs=
|
||||
github.com/Jguer/go-alpm/v2 v2.2.2 h1:sPwUoZp1X5Tw6K6Ba1lWvVJfcgVNEGVcxARLBttZnC0=
|
||||
github.com/Jguer/go-alpm/v2 v2.2.2/go.mod h1:lfe8gSe83F/KERaQvEfrSqQ4n+8bES+ZIyKWR/gm3MI=
|
||||
github.com/Jguer/go-alpm/v2 v2.2.1 h1:PMIRKo2lY0wfhN8W8Scc5v82zQeDsTv702CuDiz81sA=
|
||||
github.com/Jguer/go-alpm/v2 v2.2.1/go.mod h1:lfe8gSe83F/KERaQvEfrSqQ4n+8bES+ZIyKWR/gm3MI=
|
||||
github.com/Jguer/votar v1.0.0 h1:drPYpV5Py5BeAQS8xezmT6uCEfLzotNjLf5yfmlHKTg=
|
||||
github.com/Jguer/votar v1.0.0/go.mod h1:rc6vgVlTqNjI4nAnPbDTbdxw/N7kXkbB8BcUDjeFbYQ=
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5 h1:TMscPjkb1ThXN32LuFY5bEYIcXZx3YlwzhS1GxNpn/c=
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5/go.mod h1:Hk55m330jNiwxRodIlMCvw5iEyoRUCIY64W1p9D+tHc=
|
||||
github.com/Morganamilo/go-srcinfo v1.0.0 h1:Wh4nEF+HJWo+29hnxM18Q2hi+DUf0GejS13+Wg+dzmI=
|
||||
github.com/Morganamilo/go-srcinfo v1.0.0/go.mod h1:MP6VGY1NNpVUmYIEgoM9acix95KQqIRyqQ0hCLsyYUY=
|
||||
github.com/adrg/strutil v0.3.1 h1:OLvSS7CSJO8lBii4YmBt8jiK9QOtB9CzCzwl4Ic/Fz4=
|
||||
github.com/adrg/strutil v0.3.1/go.mod h1:8h90y18QLrs11IBffcGX3NW/GFBXCMcNg4M7H6MspPA=
|
||||
github.com/adrg/strutil v0.3.0 h1:bi/HB2zQbDihC8lxvATDTDzkT4bG7PATtVnDYp5rvq4=
|
||||
github.com/adrg/strutil v0.3.0/go.mod h1:Jz0wzBVE6Uiy9wxo62YEqEY1Nwto3QlLl1Il5gkLKWU=
|
||||
github.com/alexflint/go-arg v1.4.3/go.mod h1:3PZ/wp/8HuqRZMUUgu7I+e1qcpUbvmS258mRXkFH4IA=
|
||||
github.com/alexflint/go-scalar v1.1.0/go.mod h1:LoFvNMqS1CPrMVltza4LvnGKhaSpc3oyLEBUZVhhS2o=
|
||||
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible h1:UafIjBvWQmS9i/xRg+CamMrnLTKNzo+bdmT/oH34c2Y=
|
||||
@ -17,8 +17,8 @@ github.com/bradleyjkemp/cupaloy v2.3.0+incompatible/go.mod h1:Au1Xw1sgaJ5iSFktEh
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ=
|
||||
github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
|
||||
github.com/deckarep/golang-set/v2 v2.3.0 h1:qs18EKUfHm2X9fA50Mr/M5hccg2tNnVqsiBImnyDs0g=
|
||||
github.com/deckarep/golang-set/v2 v2.3.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
|
||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@ -26,39 +26,60 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/itchyny/gojq v0.12.17 h1:8av8eGduDb5+rvEdaOO+zQUjA04MS0m3Ps8HiD+fceg=
|
||||
github.com/itchyny/gojq v0.12.17/go.mod h1:WBrEMkgAfAGO1LUcGOckBl5O726KPp+OlkKug0I/FEY=
|
||||
github.com/itchyny/timefmt-go v0.1.6 h1:ia3s54iciXDdzWzwaVKXZPbiXzxxnv1SPGFfM/myJ5Q=
|
||||
github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJGxm9/mAERQg=
|
||||
github.com/leonelquinteros/gotext v1.7.2 h1:bDPndU8nt+/kRo1m4l/1OXiiy2v7Z7dfPQ9+YP7G1Mc=
|
||||
github.com/leonelquinteros/gotext v1.7.2/go.mod h1:9/haCkm5P7Jay1sxKDGJ5WIg4zkz8oZKw4ekNpALob8=
|
||||
github.com/itchyny/gojq v0.12.13 h1:IxyYlHYIlspQHHTE0f3cJF0NKDMfajxViuhBLnHd/QU=
|
||||
github.com/itchyny/gojq v0.12.13/go.mod h1:JzwzAqenfhrPUuwbmEz3nu3JQmFLlQTQMUcOdnu/Sf4=
|
||||
github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE=
|
||||
github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8=
|
||||
github.com/leonelquinteros/gotext v1.5.2 h1:T2y6ebHli+rMBCjcJlHTXyUrgXqsKBhl/ormgvt7lPo=
|
||||
github.com/leonelquinteros/gotext v1.5.2/go.mod h1:AT4NpQrOmyj1L/+hLja6aR0lk81yYYL4ePnj2kp7d6M=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=
|
||||
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
|
||||
github.com/ohler55/ojg v1.26.1 h1:J5TaLmVEuvnpVH7JMdT1QdbpJU545Yp6cKiCO4aQILc=
|
||||
github.com/ohler55/ojg v1.26.1/go.mod h1:gQhDVpQLqrmnd2eqGAvJtn+NfKoYJbe/A4Sj3/Vro4o=
|
||||
github.com/ohler55/ojg v1.19.1 h1:ruSyx+OGrE2HvJgUvtDWiqHJFfMs6e7IM0yZhcrs3NU=
|
||||
github.com/ohler55/ojg v1.19.1/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
|
||||
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
|
||||
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
|
||||
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
|
||||
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
|
||||
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
|
||||
|
@ -1,4 +1,4 @@
|
||||
package build
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -16,6 +16,164 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/vcs"
|
||||
)
|
||||
|
||||
func setPkgReason(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder,
|
||||
mode parser.TargetMode,
|
||||
cmdArgs *parser.Arguments, pkgs []string, exp bool,
|
||||
) error {
|
||||
if len(pkgs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmdArgs = cmdArgs.CopyGlobal()
|
||||
if exp {
|
||||
if err := cmdArgs.AddArg("q", "D", "asexplicit"); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cmdArgs.AddArg("q", "D", "asdeps"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, compositePkgName := range pkgs {
|
||||
pkgSplit := strings.Split(compositePkgName, "/")
|
||||
|
||||
pkgName := pkgSplit[0]
|
||||
if len(pkgSplit) > 1 {
|
||||
pkgName = pkgSplit[1]
|
||||
}
|
||||
|
||||
cmdArgs.AddTarget(pkgName)
|
||||
}
|
||||
|
||||
if err := cmdBuilder.Show(cmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, mode, settings.NoConfirm)); err != nil {
|
||||
return &SetPkgReasonError{exp: exp}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func asdeps(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder,
|
||||
mode parser.TargetMode, cmdArgs *parser.Arguments, pkgs []string,
|
||||
) error {
|
||||
return setPkgReason(ctx, cmdBuilder, mode, cmdArgs, pkgs, false)
|
||||
}
|
||||
|
||||
func asexp(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder,
|
||||
mode parser.TargetMode, cmdArgs *parser.Arguments, pkgs []string,
|
||||
) error {
|
||||
return setPkgReason(ctx, cmdBuilder, mode, cmdArgs, pkgs, true)
|
||||
}
|
||||
|
||||
func removeMake(ctx context.Context, config *settings.Configuration,
|
||||
cmdBuilder exe.ICmdBuilder, makeDeps []string, cmdArgs *parser.Arguments,
|
||||
) error {
|
||||
removeArguments := cmdArgs.CopyGlobal()
|
||||
|
||||
err := removeArguments.AddArg("R", "s", "u")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, pkg := range makeDeps {
|
||||
removeArguments.AddTarget(pkg)
|
||||
}
|
||||
|
||||
oldValue := settings.NoConfirm
|
||||
settings.NoConfirm = true
|
||||
err = cmdBuilder.Show(cmdBuilder.BuildPacmanCmd(ctx,
|
||||
removeArguments, config.Mode, settings.NoConfirm))
|
||||
settings.NoConfirm = oldValue
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func earlyRefresh(ctx context.Context, cfg *settings.Configuration, cmdBuilder exe.ICmdBuilder, cmdArgs *parser.Arguments) error {
|
||||
arguments := cmdArgs.Copy()
|
||||
if cfg.CombinedUpgrade {
|
||||
arguments.DelArg("u", "sysupgrade")
|
||||
}
|
||||
arguments.DelArg("s", "search")
|
||||
arguments.DelArg("i", "info")
|
||||
arguments.DelArg("l", "list")
|
||||
arguments.ClearTargets()
|
||||
|
||||
return cmdBuilder.Show(cmdBuilder.BuildPacmanCmd(ctx,
|
||||
arguments, cfg.Mode, settings.NoConfirm))
|
||||
}
|
||||
|
||||
func parsePackageList(ctx context.Context, cmdBuilder exe.ICmdBuilder,
|
||||
dir string,
|
||||
) (pkgdests map[string]string, pkgVersion string, err error) {
|
||||
stdout, stderr, err := cmdBuilder.Capture(
|
||||
cmdBuilder.BuildMakepkgCmd(ctx, dir, "--packagelist"))
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("%s %w", stderr, err)
|
||||
}
|
||||
|
||||
lines := strings.Split(stdout, "\n")
|
||||
pkgdests = make(map[string]string)
|
||||
|
||||
for _, line := range lines {
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
fileName := filepath.Base(line)
|
||||
split := strings.Split(fileName, "-")
|
||||
|
||||
if len(split) < 4 {
|
||||
return nil, "", errors.New(gotext.Get("cannot find package name: %v", split))
|
||||
}
|
||||
|
||||
// pkgname-pkgver-pkgrel-arch.pkgext
|
||||
// This assumes 3 dashes after the pkgname, Will cause an error
|
||||
// if the PKGEXT contains a dash. Please no one do that.
|
||||
pkgName := strings.Join(split[:len(split)-3], "-")
|
||||
pkgVersion = strings.Join(split[len(split)-3:len(split)-1], "-")
|
||||
pkgdests[pkgName] = line
|
||||
}
|
||||
|
||||
if len(pkgdests) == 0 {
|
||||
return nil, "", &NoPkgDestsFoundError{dir}
|
||||
}
|
||||
|
||||
return pkgdests, pkgVersion, nil
|
||||
}
|
||||
|
||||
func gitMerge(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) error {
|
||||
_, stderr, err := cmdBuilder.Capture(
|
||||
cmdBuilder.BuildGitCmd(ctx,
|
||||
dir, "reset", "--hard", "HEAD"))
|
||||
if err != nil {
|
||||
return errors.New(gotext.Get("error resetting %s: %s", dir, stderr))
|
||||
}
|
||||
|
||||
_, stderr, err = cmdBuilder.Capture(
|
||||
cmdBuilder.BuildGitCmd(ctx,
|
||||
dir, "merge", "--no-edit", "--ff"))
|
||||
if err != nil {
|
||||
return errors.New(gotext.Get("error merging %s: %s", dir, stderr))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func mergePkgbuilds(ctx context.Context, cmdBuilder exe.ICmdBuilder, pkgbuildDirs map[string]string) error {
|
||||
for _, dir := range pkgbuildDirs {
|
||||
err := gitMerge(ctx, cmdBuilder, dir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func installPkgArchive(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder,
|
||||
mode parser.TargetMode,
|
||||
@ -70,95 +228,3 @@ func setInstallReason(ctx context.Context,
|
||||
|
||||
return asexp(ctx, cmdBuilder, mode, cmdArgs, exps)
|
||||
}
|
||||
|
||||
func setPkgReason(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder,
|
||||
mode parser.TargetMode,
|
||||
cmdArgs *parser.Arguments, pkgs []string, exp bool,
|
||||
) error {
|
||||
if len(pkgs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
cmdArgs = cmdArgs.CopyGlobal()
|
||||
if exp {
|
||||
if err := cmdArgs.AddArg("q", "D", "asexplicit"); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
if err := cmdArgs.AddArg("q", "D", "asdeps"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, compositePkgName := range pkgs {
|
||||
pkgSplit := strings.Split(compositePkgName, "/")
|
||||
|
||||
pkgName := pkgSplit[0]
|
||||
if len(pkgSplit) > 1 {
|
||||
pkgName = pkgSplit[1]
|
||||
}
|
||||
|
||||
cmdArgs.AddTarget(pkgName)
|
||||
}
|
||||
|
||||
if err := cmdBuilder.Show(cmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, mode, settings.NoConfirm)); err != nil {
|
||||
return &SetPkgReasonError{exp: exp}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func asdeps(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder,
|
||||
mode parser.TargetMode, cmdArgs *parser.Arguments, pkgs []string,
|
||||
) error {
|
||||
return setPkgReason(ctx, cmdBuilder, mode, cmdArgs, pkgs, false)
|
||||
}
|
||||
|
||||
func asexp(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder,
|
||||
mode parser.TargetMode, cmdArgs *parser.Arguments, pkgs []string,
|
||||
) error {
|
||||
return setPkgReason(ctx, cmdBuilder, mode, cmdArgs, pkgs, true)
|
||||
}
|
||||
|
||||
func parsePackageList(ctx context.Context, cmdBuilder exe.ICmdBuilder,
|
||||
dir string,
|
||||
) (pkgdests map[string]string, pkgVersion string, err error) {
|
||||
stdout, stderr, err := cmdBuilder.Capture(
|
||||
cmdBuilder.BuildMakepkgCmd(ctx, dir, "--packagelist"))
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("%s %w", stderr, err)
|
||||
}
|
||||
|
||||
lines := strings.Split(stdout, "\n")
|
||||
pkgdests = make(map[string]string, len(lines))
|
||||
|
||||
for _, line := range lines {
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
fileName := filepath.Base(line)
|
||||
split := strings.Split(fileName, "-")
|
||||
|
||||
if len(split) < 4 {
|
||||
return nil, "", errors.New(gotext.Get("cannot find package name: %v", split))
|
||||
}
|
||||
|
||||
// pkgname-pkgver-pkgrel-arch.pkgext
|
||||
// This assumes 3 dashes after the pkgname, Will cause an error
|
||||
// if the PKGEXT contains a dash. Please no one do that.
|
||||
pkgName := strings.Join(split[:len(split)-3], "-")
|
||||
pkgVersion = strings.Join(split[len(split)-3:len(split)-1], "-")
|
||||
pkgdests[pkgName] = line
|
||||
}
|
||||
|
||||
if len(pkgdests) == 0 {
|
||||
return nil, "", &NoPkgDestsFoundError{dir}
|
||||
}
|
||||
|
||||
return pkgdests, pkgVersion, nil
|
||||
}
|
@ -4,7 +4,6 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -13,17 +12,19 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/db"
|
||||
"github.com/Jguer/yay/v12/pkg/dep"
|
||||
"github.com/Jguer/yay/v12/pkg/multierror"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/sync"
|
||||
|
||||
gosrc "github.com/Morganamilo/go-srcinfo"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var ErrNoBuildFiles = errors.New(gotext.Get("cannot find PKGBUILD and .SRCINFO in directory"))
|
||||
var (
|
||||
ErrInstallRepoPkgs = errors.New(gotext.Get("error installing repo packages"))
|
||||
ErrNoBuildFiles = errors.New(gotext.Get("cannot find PKGBUILD and .SRCINFO in directory"))
|
||||
)
|
||||
|
||||
func srcinfoExists(ctx context.Context,
|
||||
cmdBuilder exe.ICmdBuilder, targetDir string,
|
||||
@ -43,10 +44,6 @@ func srcinfoExists(ctx context.Context,
|
||||
return fmt.Errorf("unable to generate .SRCINFO: %w - %s", err, stderr)
|
||||
}
|
||||
|
||||
if srcinfo == "" {
|
||||
return fmt.Errorf("generated .SRCINFO is empty, check your PKGBUILD for errors")
|
||||
}
|
||||
|
||||
if err := os.WriteFile(srcInfoDir, []byte(srcinfo), 0o600); err != nil {
|
||||
return fmt.Errorf("unable to write .SRCINFO: %w", err)
|
||||
}
|
||||
@ -59,12 +56,12 @@ func srcinfoExists(ctx context.Context,
|
||||
|
||||
func installLocalPKGBUILD(
|
||||
ctx context.Context,
|
||||
run *runtime.Runtime,
|
||||
config *settings.Configuration,
|
||||
cmdArgs *parser.Arguments,
|
||||
dbExecutor db.Executor,
|
||||
) error {
|
||||
aurCache := run.AURClient
|
||||
noCheck := strings.Contains(run.Cfg.MFlags, "--nocheck")
|
||||
aurCache := config.Runtime.AURClient
|
||||
noCheck := strings.Contains(config.MFlags, "--nocheck")
|
||||
|
||||
if len(cmdArgs.Targets) < 1 {
|
||||
return errors.New(gotext.Get("no target directories specified"))
|
||||
@ -72,13 +69,13 @@ func installLocalPKGBUILD(
|
||||
|
||||
srcInfos := map[string]*gosrc.Srcinfo{}
|
||||
for _, targetDir := range cmdArgs.Targets {
|
||||
if err := srcinfoExists(ctx, run.CmdBuilder, targetDir); err != nil {
|
||||
if err := srcinfoExists(ctx, config.Runtime.CmdBuilder, targetDir); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pkgbuild, err := gosrc.ParseFile(filepath.Join(targetDir, ".SRCINFO"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %w", gotext.Get("failed to parse .SRCINFO"), err)
|
||||
return errors.Wrap(err, gotext.Get("failed to parse .SRCINFO"))
|
||||
}
|
||||
|
||||
srcInfos[targetDir] = pkgbuild
|
||||
@ -86,13 +83,13 @@ func installLocalPKGBUILD(
|
||||
|
||||
grapher := dep.NewGrapher(dbExecutor, aurCache, false, settings.NoConfirm,
|
||||
cmdArgs.ExistsDouble("d", "nodeps"), noCheck, cmdArgs.ExistsArg("needed"),
|
||||
run.Logger.Child("grapher"))
|
||||
config.Runtime.Logger.Child("grapher"))
|
||||
graph, err := grapher.GraphFromSrcInfos(ctx, nil, srcInfos)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
opService := sync.NewOperationService(ctx, dbExecutor, run)
|
||||
opService := NewOperationService(ctx, config, dbExecutor)
|
||||
multiErr := &multierror.MultiError{}
|
||||
targets := graph.TopoSortedLayerMap(func(name string, ii *dep.InstallInfo) error {
|
||||
if ii.Source == dep.Missing {
|
||||
@ -104,5 +101,5 @@ func installLocalPKGBUILD(
|
||||
if err := multiErr.Return(); err != nil {
|
||||
return err
|
||||
}
|
||||
return opService.Run(ctx, run, cmdArgs, targets, []string{})
|
||||
return opService.Run(ctx, cmdArgs, targets, []string{})
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@ -20,18 +19,12 @@ import (
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db/mock"
|
||||
mockaur "github.com/Jguer/yay/v12/pkg/dep/mock"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
"github.com/Jguer/yay/v12/pkg/vcs"
|
||||
)
|
||||
|
||||
func newTestLogger() *text.Logger {
|
||||
return text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), true, "test")
|
||||
}
|
||||
|
||||
func TestIntegrationLocalInstall(t *testing.T) {
|
||||
makepkgBin := t.TempDir() + "/makepkg"
|
||||
pacmanBin := t.TempDir() + "/pacman"
|
||||
@ -56,14 +49,16 @@ func TestIntegrationLocalInstall(t *testing.T) {
|
||||
}
|
||||
|
||||
wantShow := []string{
|
||||
"makepkg --verifysource --skippgpcheck -f -Cc",
|
||||
"makepkg --verifysource --skippgpcheck -Ccf",
|
||||
"pacman -S --config /etc/pacman.conf -- community/dotnet-sdk-6.0 community/dotnet-runtime-6.0",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- dotnet-runtime-6.0 dotnet-sdk-6.0",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst /testdir/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- jellyfin-server jellyfin-web",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- jellyfin",
|
||||
@ -74,6 +69,7 @@ func TestIntegrationLocalInstall(t *testing.T) {
|
||||
"git -C testdata/jfin git reset --hard HEAD",
|
||||
"git -C testdata/jfin git merge --no-edit --ff",
|
||||
"makepkg --packagelist",
|
||||
"makepkg --packagelist",
|
||||
}
|
||||
|
||||
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
|
||||
@ -146,21 +142,21 @@ func TestIntegrationLocalInstall(t *testing.T) {
|
||||
InstalledRemotePackageNamesFn: func() []string { return []string{} },
|
||||
}
|
||||
|
||||
run := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
},
|
||||
Logger: newTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
config := &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: NewTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err = handleCmd(context.Background(), run, cmdArgs, db)
|
||||
err = handleCmd(context.Background(), config, cmdArgs, db)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, mockRunner.ShowCalls, len(wantShow))
|
||||
@ -267,19 +263,20 @@ func TestIntegrationLocalInstallMissingDep(t *testing.T) {
|
||||
LocalPackageFn: func(string) mock.IPackage { return nil },
|
||||
}
|
||||
|
||||
run := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{},
|
||||
Logger: newTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
config := &settings.Configuration{
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: NewTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err = handleCmd(context.Background(), run, cmdArgs, db)
|
||||
err = handleCmd(context.Background(), config, cmdArgs, db)
|
||||
require.ErrorContains(t, err, wantErr.Error())
|
||||
|
||||
require.Len(t, mockRunner.ShowCalls, len(wantShow))
|
||||
@ -321,12 +318,14 @@ func TestIntegrationLocalInstallNeeded(t *testing.T) {
|
||||
}
|
||||
|
||||
wantShow := []string{
|
||||
"makepkg --verifysource --skippgpcheck -f -Cc",
|
||||
"makepkg --verifysource --skippgpcheck -Ccf",
|
||||
"pacman -S --config /etc/pacman.conf -- community/dotnet-sdk-6.0 community/dotnet-runtime-6.0",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- dotnet-runtime-6.0 dotnet-sdk-6.0",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
}
|
||||
|
||||
@ -335,6 +334,7 @@ func TestIntegrationLocalInstallNeeded(t *testing.T) {
|
||||
"git -C testdata/jfin git reset --hard HEAD",
|
||||
"git -C testdata/jfin git merge --no-edit --ff",
|
||||
"makepkg --packagelist",
|
||||
"makepkg --packagelist",
|
||||
}
|
||||
|
||||
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
|
||||
@ -421,21 +421,21 @@ func TestIntegrationLocalInstallNeeded(t *testing.T) {
|
||||
InstalledRemotePackageNamesFn: func() []string { return []string{} },
|
||||
}
|
||||
|
||||
run := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
},
|
||||
Logger: newTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
config := &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: NewTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err = handleCmd(context.Background(), run, cmdArgs, db)
|
||||
err = handleCmd(context.Background(), config, cmdArgs, db)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, mockRunner.ShowCalls, len(wantShow), "show calls: %v", mockRunner.ShowCalls)
|
||||
@ -486,14 +486,16 @@ func TestIntegrationLocalInstallGenerateSRCINFO(t *testing.T) {
|
||||
}
|
||||
|
||||
wantShow := []string{
|
||||
"makepkg --verifysource --skippgpcheck -f -Cc",
|
||||
"makepkg --verifysource --skippgpcheck -Ccf",
|
||||
"pacman -S --config /etc/pacman.conf -- community/dotnet-sdk-6.0 community/dotnet-runtime-6.0",
|
||||
"pacman -D -q --asdeps --config /etc/pacman.conf -- dotnet-runtime-6.0 dotnet-sdk-6.0",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst /testdir/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- jellyfin-server jellyfin-web",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- jellyfin",
|
||||
@ -505,6 +507,7 @@ func TestIntegrationLocalInstallGenerateSRCINFO(t *testing.T) {
|
||||
"git -C testdata/jfin git reset --hard HEAD",
|
||||
"git -C testdata/jfin git merge --no-edit --ff",
|
||||
"makepkg --packagelist",
|
||||
"makepkg --packagelist",
|
||||
}
|
||||
|
||||
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
|
||||
@ -582,22 +585,22 @@ func TestIntegrationLocalInstallGenerateSRCINFO(t *testing.T) {
|
||||
InstalledRemotePackageNamesFn: func() []string { return []string{} },
|
||||
}
|
||||
|
||||
run := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Debug: false,
|
||||
},
|
||||
Logger: newTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
config := &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Debug: false,
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: NewTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err = handleCmd(context.Background(), run, cmdArgs, db)
|
||||
err = handleCmd(context.Background(), config, cmdArgs, db)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, mockRunner.ShowCalls, len(wantShow))
|
||||
@ -648,6 +651,7 @@ func TestIntegrationLocalInstallMissingFiles(t *testing.T) {
|
||||
wantCapture := []string{}
|
||||
|
||||
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
|
||||
fmt.Println(cmd.Args)
|
||||
if cmd.Args[1] == "--printsrcinfo" {
|
||||
return string(srcinfo), "", nil
|
||||
}
|
||||
@ -718,17 +722,16 @@ func TestIntegrationLocalInstallMissingFiles(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
config := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Debug: false,
|
||||
},
|
||||
Logger: newTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
config := &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: NewTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -774,12 +777,12 @@ func TestIntegrationLocalInstallWithDepsProvides(t *testing.T) {
|
||||
}
|
||||
|
||||
wantShow := []string{
|
||||
"makepkg --verifysource --skippgpcheck -f -Cc",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --verifysource --skippgpcheck -Ccf",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/ceph-libs-bin-17.2.6-2-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- ceph-libs-bin",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir/ceph-bin-17.2.6-2-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- ceph-bin",
|
||||
@ -845,16 +848,16 @@ func TestIntegrationLocalInstallWithDepsProvides(t *testing.T) {
|
||||
InstalledRemotePackageNamesFn: func() []string { return []string{} },
|
||||
}
|
||||
|
||||
config := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
},
|
||||
Logger: newTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
config := &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: NewTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -901,13 +904,13 @@ func TestIntegrationLocalInstallTwoSrcInfosWithDeps(t *testing.T) {
|
||||
}
|
||||
|
||||
wantShow := []string{
|
||||
"makepkg --verifysource --skippgpcheck -f -Cc",
|
||||
"makepkg --verifysource --skippgpcheck -f -Cc",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --verifysource --skippgpcheck -Ccf",
|
||||
"makepkg --verifysource --skippgpcheck -Ccf",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir1/libzip-git-1.9.2.r166.gd2c47d0f-1-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- libzip-git",
|
||||
"makepkg --nobuild -f -C --ignorearch",
|
||||
"makepkg --nobuild -fC --ignorearch",
|
||||
"makepkg -c --nobuild --noextract --ignorearch",
|
||||
"pacman -U --config /etc/pacman.conf -- /testdir2/gourou-0.8.1-4-x86_64.pkg.tar.zst",
|
||||
"pacman -D -q --asexplicit --config /etc/pacman.conf -- gourou",
|
||||
@ -985,21 +988,21 @@ func TestIntegrationLocalInstallTwoSrcInfosWithDeps(t *testing.T) {
|
||||
InstalledRemotePackageNamesFn: func() []string { return []string{} },
|
||||
}
|
||||
|
||||
run := &runtime.Runtime{
|
||||
Cfg: &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
},
|
||||
Logger: newTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
config := &settings.Configuration{
|
||||
RemoveMake: "no",
|
||||
Runtime: &settings.Runtime{
|
||||
Logger: NewTestLogger(),
|
||||
CmdBuilder: cmdBuilder,
|
||||
VCSStore: &vcs.Mock{},
|
||||
AURClient: &mockaur.MockAUR{
|
||||
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
|
||||
return []aur.Pkg{}, nil
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err = handleCmd(context.Background(), run, cmdArgs, db)
|
||||
err = handleCmd(context.Background(), config, cmdArgs, db)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, mockRunner.ShowCalls, len(wantShow))
|
||||
|
82
main.go
82
main.go
@ -6,12 +6,12 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db"
|
||||
"github.com/Jguer/yay/v12/pkg/db/ialpm"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/query"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
@ -28,12 +28,7 @@ func initGotext() {
|
||||
}
|
||||
|
||||
if lc := os.Getenv("LANGUAGE"); lc != "" {
|
||||
// Split LANGUAGE by ':' and prioritize the first locale
|
||||
// Should fix in gotext to support this
|
||||
locales := strings.Split(lc, ":")
|
||||
if len(locales) > 0 && locales[0] != "" {
|
||||
gotext.Configure(localePath, locales[0], "yay")
|
||||
}
|
||||
gotext.Configure(localePath, lc, "yay")
|
||||
} else if lc := os.Getenv("LC_ALL"); lc != "" {
|
||||
gotext.Configure(localePath, lc, "yay")
|
||||
} else if lc := os.Getenv("LC_MESSAGES"); lc != "" {
|
||||
@ -44,7 +39,6 @@ func initGotext() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
fallbackLog := text.NewLogger(os.Stdout, os.Stderr, os.Stdin, false, "fallback")
|
||||
var (
|
||||
err error
|
||||
ctx = context.Background()
|
||||
@ -53,9 +47,8 @@ func main() {
|
||||
|
||||
defer func() {
|
||||
if rec := recover(); rec != nil {
|
||||
fallbackLog.Errorln("Panic occurred:", rec)
|
||||
fallbackLog.Errorln("Stack trace:", string(debug.Stack()))
|
||||
ret = 1
|
||||
text.Errorln(rec)
|
||||
debug.PrintStack()
|
||||
}
|
||||
|
||||
os.Exit(ret)
|
||||
@ -64,15 +57,15 @@ func main() {
|
||||
initGotext()
|
||||
|
||||
if os.Geteuid() == 0 {
|
||||
fallbackLog.Warnln(gotext.Get("Avoid running yay as root/sudo."))
|
||||
text.Warnln(gotext.Get("Avoid running yay as root/sudo."))
|
||||
}
|
||||
|
||||
configPath := settings.GetConfigPath()
|
||||
// Parse config
|
||||
cfg, err := settings.NewConfig(fallbackLog, configPath, yayVersion)
|
||||
cfg, err := settings.NewConfig(configPath, yayVersion)
|
||||
if err != nil {
|
||||
if str := err.Error(); str != "" {
|
||||
fallbackLog.Errorln(str)
|
||||
text.Errorln(str)
|
||||
}
|
||||
|
||||
ret = 1
|
||||
@ -80,9 +73,13 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
if errS := cfg.RunMigrations(fallbackLog,
|
||||
if cfg.Debug {
|
||||
text.GlobalLogger.Debug = true
|
||||
}
|
||||
|
||||
if errS := cfg.RunMigrations(
|
||||
settings.DefaultMigrations(), configPath, yayVersion); errS != nil {
|
||||
fallbackLog.Errorln(errS)
|
||||
text.Errorln(errS)
|
||||
}
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
@ -90,7 +87,7 @@ func main() {
|
||||
// Parse command line
|
||||
if err = cfg.ParseCommandLine(cmdArgs); err != nil {
|
||||
if str := err.Error(); str != "" {
|
||||
fallbackLog.Errorln(str)
|
||||
text.Errorln(str)
|
||||
}
|
||||
|
||||
ret = 1
|
||||
@ -100,15 +97,15 @@ func main() {
|
||||
|
||||
if cfg.SaveConfig {
|
||||
if errS := cfg.Save(configPath, yayVersion); errS != nil {
|
||||
fallbackLog.Errorln(errS)
|
||||
text.Errorln(errS)
|
||||
}
|
||||
}
|
||||
|
||||
// Build run
|
||||
run, err := runtime.NewRuntime(cfg, cmdArgs, yayVersion)
|
||||
// Build runtime
|
||||
runtime, err := settings.BuildRuntime(cfg, cmdArgs, yayVersion)
|
||||
if err != nil {
|
||||
if str := err.Error(); str != "" {
|
||||
fallbackLog.Errorln(str)
|
||||
text.Errorln(str)
|
||||
}
|
||||
|
||||
ret = 1
|
||||
@ -116,10 +113,35 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
dbExecutor, err := ialpm.NewExecutor(run.PacmanConf, run.Logger.Child("db"))
|
||||
cfg.Runtime = runtime
|
||||
|
||||
cfg.Runtime.QueryBuilder = query.NewSourceQueryBuilder(
|
||||
cfg.Runtime.AURClient,
|
||||
cfg.Runtime.Logger.Child("mixed.querybuilder"), cfg.SortBy,
|
||||
cfg.Mode, cfg.SearchBy,
|
||||
cfg.BottomUp, cfg.SingleLineResults, cfg.SeparateSources)
|
||||
|
||||
var useColor bool
|
||||
|
||||
cfg.Runtime.PacmanConf, useColor, err = settings.RetrievePacmanConfig(cmdArgs, cfg.PacmanConf)
|
||||
if err != nil {
|
||||
if str := err.Error(); str != "" {
|
||||
fallbackLog.Errorln(str)
|
||||
text.Errorln(str)
|
||||
}
|
||||
|
||||
ret = 1
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
cfg.Runtime.CmdBuilder.SetPacmanDBPath(cfg.Runtime.PacmanConf.DBPath)
|
||||
|
||||
text.UseColor = useColor
|
||||
|
||||
dbExecutor, err := ialpm.NewExecutor(cfg.Runtime.PacmanConf, runtime.Logger.Child("db"))
|
||||
if err != nil {
|
||||
if str := err.Error(); str != "" {
|
||||
text.Errorln(str)
|
||||
}
|
||||
|
||||
ret = 1
|
||||
@ -129,16 +151,20 @@ func main() {
|
||||
|
||||
defer func() {
|
||||
if rec := recover(); rec != nil {
|
||||
fallbackLog.Errorln("Panic occurred in DB operation:", rec)
|
||||
fallbackLog.Errorln("Stack trace:", string(debug.Stack()))
|
||||
text.Errorln(rec)
|
||||
debug.PrintStack()
|
||||
}
|
||||
|
||||
dbExecutor.Cleanup()
|
||||
}()
|
||||
|
||||
if err = handleCmd(ctx, run, cmdArgs, dbExecutor); err != nil {
|
||||
if err = handleCmd(ctx, cfg, cmdArgs, db.Executor(dbExecutor)); err != nil {
|
||||
if str := err.Error(); str != "" {
|
||||
fallbackLog.Errorln(str)
|
||||
text.Errorln(str)
|
||||
if cmdArgs.ExistsArg("c") && cmdArgs.ExistsArg("y") && cmdArgs.Op == "S" {
|
||||
// Remove after 2023-10-01
|
||||
text.Errorln("Did you mean 'yay -Yc'?")
|
||||
}
|
||||
}
|
||||
|
||||
exitError := &exec.ExitError{}
|
||||
|
@ -2,61 +2,59 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db/ialpm"
|
||||
"github.com/Jguer/yay/v12/pkg/dep"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
|
||||
"github.com/Jguer/aur/metadata"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func handleCmd(logger *text.Logger) error {
|
||||
cfg, err := settings.NewConfig(logger, settings.GetConfigPath(), "")
|
||||
func handleCmd() error {
|
||||
config, err := settings.NewConfig(settings.GetConfigPath(), "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmdArgs := parser.MakeArguments()
|
||||
if errP := cfg.ParseCommandLine(cmdArgs); errP != nil {
|
||||
if errP := config.ParseCommandLine(cmdArgs); errP != nil {
|
||||
return errP
|
||||
}
|
||||
|
||||
run, err := runtime.NewRuntime(cfg, cmdArgs, "1.0.0")
|
||||
pacmanConf, _, err := settings.RetrievePacmanConfig(cmdArgs, config.PacmanConf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dbExecutor, err := ialpm.NewExecutor(run.PacmanConf, logger)
|
||||
dbExecutor, err := ialpm.NewExecutor(pacmanConf, text.GlobalLogger)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
aurCache, err := metadata.New(
|
||||
metadata.WithCacheFilePath(
|
||||
filepath.Join(cfg.BuildDir, "aur.json")))
|
||||
filepath.Join(config.BuildDir, "aur.json")))
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %w", gotext.Get("failed to retrieve aur Cache"), err)
|
||||
return errors.Wrap(err, gotext.Get("failed to retrieve aur Cache"))
|
||||
}
|
||||
|
||||
grapher := dep.NewGrapher(dbExecutor, aurCache, true, settings.NoConfirm,
|
||||
cmdArgs.ExistsDouble("d", "nodeps"), false, false,
|
||||
run.Logger.Child("grapher"))
|
||||
config.Runtime.Logger.Child("grapher"))
|
||||
|
||||
return graphPackage(context.Background(), grapher, cmdArgs.Targets)
|
||||
}
|
||||
|
||||
func main() {
|
||||
fallbackLog := text.NewLogger(os.Stdout, os.Stderr, os.Stdin, false, "fallback")
|
||||
if err := handleCmd(fallbackLog); err != nil {
|
||||
fallbackLog.Errorln(err)
|
||||
if err := handleCmd(); err != nil {
|
||||
text.Errorln(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ func createAURList(ctx context.Context, client httpRequestDoer, aurURL string, o
|
||||
return nil
|
||||
}
|
||||
|
||||
// createRepoList appends Repo packages to completion cache.
|
||||
// CreatePackageList appends Repo packages to completion cache.
|
||||
func createRepoList(dbExecutor PkgSynchronizer, out io.Writer) error {
|
||||
for _, pkg := range dbExecutor.SyncPackages() {
|
||||
_, err := io.WriteString(out, pkg.Name()+"\t"+pkg.DB().Name()+"\n")
|
||||
|
@ -176,7 +176,7 @@ func (ae *AlpmExecutor) questionCallback() func(question alpm.QuestionAny) {
|
||||
return nil
|
||||
})
|
||||
|
||||
str := text.Bold(gotext.Get("There are %[1]d providers available for %[2]s:", size, qp.Dep()))
|
||||
str := text.Bold(gotext.Get("There are %d providers available for %s:", size, qp.Dep()))
|
||||
|
||||
size = 1
|
||||
|
||||
|
@ -37,7 +37,7 @@ func (i *InstallInfo) String() string {
|
||||
}
|
||||
|
||||
type (
|
||||
Reason uint
|
||||
Reason int
|
||||
Source int
|
||||
)
|
||||
|
||||
@ -165,6 +165,7 @@ func (g *Grapher) GraphFromTargets(ctx context.Context,
|
||||
}
|
||||
if pkg != nil {
|
||||
g.GraphSyncPkg(ctx, graph, pkg, nil)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
@ -536,13 +537,12 @@ func (g *Grapher) findDepsFromAUR(ctx context.Context,
|
||||
}
|
||||
|
||||
// remove packages that don't satisfy the dependency
|
||||
satisfyingPkgs := make([]aurc.Pkg, 0, len(aurPkgs))
|
||||
for i := range aurPkgs {
|
||||
if satisfiesAur(depString, &aurPkgs[i]) {
|
||||
satisfyingPkgs = append(satisfyingPkgs, aurPkgs[i])
|
||||
for i := 0; i < len(aurPkgs); i++ {
|
||||
if !satisfiesAur(depString, &aurPkgs[i]) {
|
||||
aurPkgs = append(aurPkgs[:i], aurPkgs[i+1:]...)
|
||||
i--
|
||||
}
|
||||
}
|
||||
aurPkgs = satisfyingPkgs
|
||||
|
||||
if len(aurPkgs) == 0 {
|
||||
g.logger.Errorln(gotext.Get("No AUR package found for"), " ", depString)
|
||||
@ -723,7 +723,7 @@ func (g *Grapher) provideMenu(dep string, options []aur.Pkg) *aur.Pkg {
|
||||
return &options[0]
|
||||
}
|
||||
|
||||
str := text.Bold(gotext.Get("There are %[1]d providers available for %[2]s:", size, dep))
|
||||
str := text.Bold(gotext.Get("There are %d providers available for %s:", size, dep))
|
||||
str += "\n"
|
||||
|
||||
size = 1
|
||||
@ -749,7 +749,7 @@ func (g *Grapher) provideMenu(dep string, options []aur.Pkg) *aur.Pkg {
|
||||
if err != nil {
|
||||
g.logger.Errorln(err)
|
||||
|
||||
return &options[0]
|
||||
break
|
||||
}
|
||||
|
||||
if numberBuf == "" {
|
||||
@ -772,6 +772,8 @@ func (g *Grapher) provideMenu(dep string, options []aur.Pkg) *aur.Pkg {
|
||||
|
||||
return &options[num-1]
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func makeAURPKGFromSrcinfo(dbExecutor db.Executor, srcInfo *gosrc.Srcinfo) ([]*aur.Pkg, error) {
|
||||
@ -804,20 +806,19 @@ func makeAURPKGFromSrcinfo(dbExecutor db.Executor, srcInfo *gosrc.Srcinfo) ([]*a
|
||||
Description: getDesc(pkg),
|
||||
URL: pkg.URL,
|
||||
Depends: append(archStringToString(alpmArch, pkg.Depends),
|
||||
archStringToString(alpmArch, srcInfo.Depends)...),
|
||||
MakeDepends: archStringToString(alpmArch, srcInfo.MakeDepends),
|
||||
CheckDepends: archStringToString(alpmArch, srcInfo.CheckDepends),
|
||||
archStringToString(alpmArch, srcInfo.Package.Depends)...),
|
||||
MakeDepends: archStringToString(alpmArch, srcInfo.PackageBase.MakeDepends),
|
||||
CheckDepends: archStringToString(alpmArch, srcInfo.PackageBase.CheckDepends),
|
||||
Conflicts: append(archStringToString(alpmArch, pkg.Conflicts),
|
||||
archStringToString(alpmArch, srcInfo.Conflicts)...),
|
||||
archStringToString(alpmArch, srcInfo.Package.Conflicts)...),
|
||||
Provides: append(archStringToString(alpmArch, pkg.Provides),
|
||||
archStringToString(alpmArch, srcInfo.Provides)...),
|
||||
archStringToString(alpmArch, srcInfo.Package.Provides)...),
|
||||
Replaces: append(archStringToString(alpmArch, pkg.Replaces),
|
||||
archStringToString(alpmArch, srcInfo.Replaces)...),
|
||||
OptDepends: append(archStringToString(alpmArch, pkg.OptDepends),
|
||||
archStringToString(alpmArch, srcInfo.OptDepends)...),
|
||||
Groups: pkg.Groups,
|
||||
License: pkg.License,
|
||||
Keywords: []string{},
|
||||
archStringToString(alpmArch, srcInfo.Package.Replaces)...),
|
||||
OptDepends: []string{},
|
||||
Groups: pkg.Groups,
|
||||
License: pkg.License,
|
||||
Keywords: []string{},
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/Jguer/go-alpm/v2"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
type (
|
||||
@ -242,6 +244,7 @@ func (g *Graph[T, V]) Prune(node T) []T {
|
||||
// Remove edges from things that depend on `node`.
|
||||
for dependent := range g.dependents[node] {
|
||||
last := g.dependencies.removeFromDepmap(dependent, node)
|
||||
text.Debugln("pruning dependent", dependent, last)
|
||||
if last {
|
||||
pruned = append(pruned, g.Prune(dependent)...)
|
||||
}
|
||||
@ -252,6 +255,7 @@ func (g *Graph[T, V]) Prune(node T) []T {
|
||||
// Remove all edges from node to the things it depends on.
|
||||
for dependency := range g.dependencies[node] {
|
||||
last := g.dependents.removeFromDepmap(dependency, node)
|
||||
text.Debugln("pruning dependency", dependency, last)
|
||||
if last {
|
||||
pruned = append(pruned, g.Prune(dependency)...)
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package topo
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
ErrSelfReferential = errors.New(" self-referential dependencies not allowed")
|
||||
ErrConflictingAlias = errors.New(" alias already defined")
|
||||
ErrCircular = errors.New(" circular dependencies not allowed")
|
||||
ErrSelfReferential = errors.New("self-referential dependencies not allowed")
|
||||
ErrConflictingAlias = errors.New("alias already defined")
|
||||
ErrCircular = errors.New("circular dependencies not allowed")
|
||||
)
|
||||
|
@ -48,7 +48,7 @@ func AURPKGBUILDRepo(ctx context.Context, cmdBuilder exe.GitCmdBuilder, aurURL,
|
||||
|
||||
func AURPKGBUILDRepos(
|
||||
ctx context.Context,
|
||||
cmdBuilder exe.GitCmdBuilder, logger *text.Logger,
|
||||
cmdBuilder exe.GitCmdBuilder,
|
||||
targets []string, aurURL, dest string, force bool,
|
||||
) (map[string]bool, error) {
|
||||
cloned := make(map[string]bool, len(targets))
|
||||
@ -63,34 +63,30 @@ func AURPKGBUILDRepos(
|
||||
|
||||
for _, target := range targets {
|
||||
sem <- 1
|
||||
|
||||
wg.Add(1)
|
||||
|
||||
go func(target string) {
|
||||
defer func() {
|
||||
<-sem
|
||||
wg.Done()
|
||||
}()
|
||||
|
||||
newClone, err := AURPKGBUILDRepo(ctx, cmdBuilder, aurURL, target, dest, force)
|
||||
|
||||
mux.Lock()
|
||||
progress := len(cloned)
|
||||
progress := 0
|
||||
|
||||
if err != nil {
|
||||
errs.Add(err)
|
||||
} else {
|
||||
mux.Lock()
|
||||
cloned[target] = newClone
|
||||
progress = len(cloned)
|
||||
mux.Unlock()
|
||||
logger.OperationInfoln(
|
||||
gotext.Get("(%d/%d) Failed to download PKGBUILD: %s",
|
||||
progress, len(targets), text.Cyan(target)))
|
||||
return
|
||||
}
|
||||
|
||||
cloned[target] = newClone
|
||||
progress = len(cloned)
|
||||
mux.Unlock()
|
||||
|
||||
logger.OperationInfoln(
|
||||
text.OperationInfoln(
|
||||
gotext.Get("(%d/%d) Downloaded PKGBUILD: %s",
|
||||
progress, len(targets), text.Cyan(target)))
|
||||
|
||||
<-sem
|
||||
|
||||
wg.Done()
|
||||
}(target)
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ func TestAURPKGBUILDRepos(t *testing.T) {
|
||||
GitFlags: []string{},
|
||||
},
|
||||
}
|
||||
cloned, err := AURPKGBUILDRepos(context.Background(), cmdBuilder, newTestLogger(), targets, "https://aur.archlinux.org", dir, false)
|
||||
cloned, err := AURPKGBUILDRepos(context.Background(), cmdBuilder, targets, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.EqualValues(t, map[string]bool{"yay": true, "yay-bin": false, "yay-git": true}, cloned)
|
||||
|
@ -81,8 +81,8 @@ func getURLName(pkg db.IPackage) string {
|
||||
return name
|
||||
}
|
||||
|
||||
func PKGBUILDs(dbExecutor DBSearcher, aurClient aur.QueryClient, httpClient *http.Client,
|
||||
logger *text.Logger, targets []string, aurURL string, mode parser.TargetMode,
|
||||
func PKGBUILDs(dbExecutor DBSearcher, aurClient aur.QueryClient, httpClient *http.Client, targets []string,
|
||||
aurURL string, mode parser.TargetMode,
|
||||
) (map[string][]byte, error) {
|
||||
pkgbuilds := make(map[string][]byte, len(targets))
|
||||
|
||||
@ -96,7 +96,7 @@ func PKGBUILDs(dbExecutor DBSearcher, aurClient aur.QueryClient, httpClient *htt
|
||||
|
||||
for _, target := range targets {
|
||||
// Probably replaceable by something in query.
|
||||
dbName, name, isAUR, toSkip := getPackageUsableName(dbExecutor, aurClient, logger, target, mode)
|
||||
dbName, name, isAUR, toSkip := getPackageUsableName(dbExecutor, aurClient, target, mode)
|
||||
if toSkip {
|
||||
continue
|
||||
}
|
||||
@ -136,7 +136,7 @@ func PKGBUILDs(dbExecutor DBSearcher, aurClient aur.QueryClient, httpClient *htt
|
||||
}
|
||||
|
||||
func PKGBUILDRepos(ctx context.Context, dbExecutor DBSearcher, aurClient aur.QueryClient,
|
||||
cmdBuilder exe.GitCmdBuilder, logger *text.Logger,
|
||||
cmdBuilder exe.GitCmdBuilder,
|
||||
targets []string, mode parser.TargetMode, aurURL, dest string, force bool,
|
||||
) (map[string]bool, error) {
|
||||
cloned := make(map[string]bool, len(targets))
|
||||
@ -151,7 +151,7 @@ func PKGBUILDRepos(ctx context.Context, dbExecutor DBSearcher, aurClient aur.Que
|
||||
|
||||
for _, target := range targets {
|
||||
// Probably replaceable by something in query.
|
||||
dbName, name, isAUR, toSkip := getPackageUsableName(dbExecutor, aurClient, logger, target, mode)
|
||||
dbName, name, isAUR, toSkip := getPackageUsableName(dbExecutor, aurClient, target, mode)
|
||||
if toSkip {
|
||||
continue
|
||||
}
|
||||
@ -184,11 +184,11 @@ func PKGBUILDRepos(ctx context.Context, dbExecutor DBSearcher, aurClient aur.Que
|
||||
}
|
||||
|
||||
if aur {
|
||||
logger.OperationInfoln(
|
||||
text.OperationInfoln(
|
||||
gotext.Get("(%d/%d) Downloaded PKGBUILD: %s",
|
||||
progress, len(targets), text.Cyan(pkgName)))
|
||||
} else {
|
||||
logger.OperationInfoln(
|
||||
text.OperationInfoln(
|
||||
gotext.Get("(%d/%d) Downloaded PKGBUILD from ABS: %s",
|
||||
progress, len(targets), text.Cyan(pkgName)))
|
||||
}
|
||||
@ -206,7 +206,7 @@ func PKGBUILDRepos(ctx context.Context, dbExecutor DBSearcher, aurClient aur.Que
|
||||
|
||||
// TODO: replace with dep.ResolveTargets.
|
||||
func getPackageUsableName(dbExecutor DBSearcher, aurClient aur.QueryClient,
|
||||
logger *text.Logger, target string, mode parser.TargetMode,
|
||||
target string, mode parser.TargetMode,
|
||||
) (dbname, pkgname string, isAUR, toSkip bool) {
|
||||
dbName, name := text.SplitDBFromName(target)
|
||||
if dbName != "aur" && mode.AtLeastRepo() {
|
||||
@ -239,7 +239,7 @@ func getPackageUsableName(dbExecutor DBSearcher, aurClient aur.QueryClient,
|
||||
Needles: []string{name},
|
||||
})
|
||||
if err != nil {
|
||||
logger.Warnln(err)
|
||||
text.Warnln(err)
|
||||
return dbName, name, true, true
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ func TestIntegrationPKGBUILDReposDefinedDBClone(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"linux": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, testLogger.Child("test"),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeAny, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@ -71,7 +71,7 @@ func TestIntegrationPKGBUILDReposNotExist(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, testLogger.Child("test"),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeAny, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.Error(t, err)
|
||||
@ -88,13 +88,12 @@ func TestIntegrationPKGBUILDFull(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
testLogger := text.NewLogger(os.Stdout, os.Stderr, strings.NewReader(""), true, "test")
|
||||
targets := []string{"core/linux", "aur/yay-bin", "yay-git"}
|
||||
searcher := &testDBSearcher{
|
||||
absPackagesDB: map[string]string{"linux": "core"},
|
||||
}
|
||||
|
||||
fetched, err := PKGBUILDs(searcher, mockClient, &http.Client{}, testLogger.Child("test"),
|
||||
fetched, err := PKGBUILDs(searcher, mockClient, &http.Client{},
|
||||
targets, "https://aur.archlinux.org", parser.ModeAny)
|
||||
|
||||
assert.NoError(t, err)
|
||||
|
@ -5,7 +5,6 @@ package download
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -23,10 +22,6 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func newTestLogger() *text.Logger {
|
||||
return text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), true, "test")
|
||||
}
|
||||
|
||||
// GIVEN 2 aur packages and 1 in repo
|
||||
// GIVEN package in repo is already present
|
||||
// WHEN defining package db as a target
|
||||
@ -61,7 +56,7 @@ func TestPKGBUILDReposDefinedDBPull(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, newTestLogger(),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeAny, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@ -95,7 +90,7 @@ func TestPKGBUILDReposDefinedDBClone(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, newTestLogger(),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeAny, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@ -129,7 +124,7 @@ func TestPKGBUILDReposClone(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, newTestLogger(),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeAny, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@ -163,7 +158,7 @@ func TestPKGBUILDReposNotFound(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, newTestLogger(),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeAny, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@ -197,7 +192,7 @@ func TestPKGBUILDReposRepoMode(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, newTestLogger(),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeRepo, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@ -235,7 +230,7 @@ func TestPKGBUILDFull(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
|
||||
fetched, err := PKGBUILDs(searcher, mockClient, &http.Client{}, newTestLogger(),
|
||||
fetched, err := PKGBUILDs(searcher, mockClient, &http.Client{},
|
||||
targets, "https://aur.archlinux.org", parser.ModeAny)
|
||||
|
||||
assert.NoError(t, err)
|
||||
@ -273,7 +268,7 @@ func TestPKGBUILDReposMissingAUR(t *testing.T) {
|
||||
absPackagesDB: map[string]string{"yay": "core"},
|
||||
}
|
||||
cloned, err := PKGBUILDRepos(context.Background(), searcher, mockClient,
|
||||
cmdBuilder, newTestLogger(),
|
||||
cmdBuilder,
|
||||
targets, parser.ModeAny, "https://aur.archlinux.org", dir, false)
|
||||
|
||||
assert.NoError(t, err)
|
||||
|
@ -17,10 +17,10 @@ type IntRange struct {
|
||||
// IntRanges is a slice of IntRange.
|
||||
type IntRanges []IntRange
|
||||
|
||||
func makeIntRange(minVal, maxVal int) IntRange {
|
||||
func makeIntRange(min, max int) IntRange {
|
||||
return IntRange{
|
||||
min: minVal,
|
||||
max: maxVal,
|
||||
min,
|
||||
max,
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,6 +42,24 @@ func (rs IntRanges) Get(n int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Min returns min value between a and b.
|
||||
func Min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
// Max returns max value between a and b.
|
||||
func Max(a, b int) int {
|
||||
if a < b {
|
||||
return b
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// ParseNumberMenu parses input for number menus split by spaces or commas
|
||||
// supports individual selection: 1 2 3 4
|
||||
// supports range selections: 1-4 10-20
|
||||
@ -98,8 +116,8 @@ func ParseNumberMenu(input string) (include, exclude IntRanges,
|
||||
num2 = num1
|
||||
}
|
||||
|
||||
mi := min(num1, num2)
|
||||
ma := max(num1, num2)
|
||||
mi := Min(num1, num2)
|
||||
ma := Max(num1, num2)
|
||||
|
||||
if !invert {
|
||||
include = append(include, makeIntRange(mi, ma))
|
||||
|
@ -64,9 +64,9 @@ func TestParseNumberMenu(t *testing.T) {
|
||||
},
|
||||
mapset.NewThreadUnsafeSet[string](), mapset.NewThreadUnsafeSet[string](),
|
||||
},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet("abort", "all", "none"), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet("a-b"), mapset.NewThreadUnsafeSet("abort", "a-b")},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet("-9223372036854775809-9223372036854775809"), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet[string]("abort", "all", "none"), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet[string]("a-b"), mapset.NewThreadUnsafeSet[string]("abort", "a-b")},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet[string]("-9223372036854775809-9223372036854775809"), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{
|
||||
makeIntRange(1, 1),
|
||||
makeIntRange(2, 2),
|
||||
@ -86,7 +86,7 @@ func TestParseNumberMenu(t *testing.T) {
|
||||
}, IntRanges{}, mapset.NewThreadUnsafeSet[string](), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet[string](), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet[string](), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet("a", "b", "c", "d", "e"), mapset.NewThreadUnsafeSet[string]()},
|
||||
{IntRanges{}, IntRanges{}, mapset.NewThreadUnsafeSet[string]("a", "b", "c", "d", "e"), mapset.NewThreadUnsafeSet[string]()},
|
||||
}
|
||||
|
||||
for n, in := range inputs {
|
||||
|
@ -9,7 +9,6 @@ import (
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
@ -24,7 +23,7 @@ func anyExistInCache(pkgbuildDirs map[string]string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func CleanFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
|
||||
func CleanFn(ctx context.Context, config *settings.Configuration, w io.Writer,
|
||||
pkgbuildDirsByBase map[string]string, installed mapset.Set[string],
|
||||
) error {
|
||||
if len(pkgbuildDirsByBase) == 0 {
|
||||
@ -50,25 +49,25 @@ func CleanFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
|
||||
bases = append(bases, pkg)
|
||||
}
|
||||
|
||||
toClean, errClean := selectionMenu(run.Logger, pkgbuildDirsByBase, bases, installed,
|
||||
toClean, errClean := selectionMenu(w, pkgbuildDirsByBase, bases, installed,
|
||||
gotext.Get("Packages to cleanBuild?"),
|
||||
settings.NoConfirm, run.Cfg.AnswerClean, skipFunc)
|
||||
settings.NoConfirm, config.AnswerClean, skipFunc)
|
||||
if errClean != nil {
|
||||
return errClean
|
||||
}
|
||||
|
||||
for i, base := range toClean {
|
||||
dir := pkgbuildDirsByBase[base]
|
||||
run.Logger.OperationInfoln(gotext.Get("Deleting (%d/%d): %s", i+1, len(toClean), text.Cyan(dir)))
|
||||
text.OperationInfoln(gotext.Get("Deleting (%d/%d): %s", i+1, len(toClean), text.Cyan(dir)))
|
||||
|
||||
if err := run.CmdBuilder.Show(run.CmdBuilder.BuildGitCmd(ctx, dir, "reset", "--hard", "origin/HEAD")); err != nil {
|
||||
run.Logger.Warnln(gotext.Get("Unable to clean:"), dir)
|
||||
if err := config.Runtime.CmdBuilder.Show(config.Runtime.CmdBuilder.BuildGitCmd(ctx, dir, "reset", "--hard", "origin/HEAD")); err != nil {
|
||||
text.Warnln(gotext.Get("Unable to clean:"), dir)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
if err := run.CmdBuilder.Show(run.CmdBuilder.BuildGitCmd(ctx, dir, "clean", "-fdx")); err != nil {
|
||||
run.Logger.Warnln(gotext.Get("Unable to clean:"), dir)
|
||||
if err := config.Runtime.CmdBuilder.Show(config.Runtime.CmdBuilder.BuildGitCmd(ctx, dir, "clean", "-fdx")); err != nil {
|
||||
text.Warnln(gotext.Get("Unable to clean:"), dir)
|
||||
|
||||
return err
|
||||
}
|
||||
|
@ -5,13 +5,13 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/multierror"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
@ -22,7 +22,7 @@ const (
|
||||
gitDiffRefName = "AUR_SEEN"
|
||||
)
|
||||
|
||||
func showPkgbuildDiffs(ctx context.Context, cmdBuilder exe.ICmdBuilder, logger *text.Logger,
|
||||
func showPkgbuildDiffs(ctx context.Context, cmdBuilder exe.ICmdBuilder,
|
||||
pkgbuildDirs map[string]string, bases []string,
|
||||
) error {
|
||||
var errMulti multierror.MultiError
|
||||
@ -46,7 +46,7 @@ func showPkgbuildDiffs(ctx context.Context, cmdBuilder exe.ICmdBuilder, logger *
|
||||
}
|
||||
|
||||
if !hasDiff {
|
||||
logger.Warnln(gotext.Get("%s: No changes -- skipping", text.Cyan(pkg)))
|
||||
text.Warnln(gotext.Get("%s: No changes -- skipping", text.Cyan(pkg)))
|
||||
|
||||
continue
|
||||
}
|
||||
@ -85,13 +85,13 @@ func gitHasDiff(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) (bo
|
||||
|
||||
return lastseen != upstream, nil
|
||||
}
|
||||
// If AUR_SEEN does not exists, we have never reviewed a diff for this package
|
||||
// If YAY_DIFF_REVIEW does not exists, we have never reviewed a diff for this package
|
||||
// and should display it.
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// Return whether or not we have reviewed a diff yet. It checks for the existence of
|
||||
// AUR_SEEN in the git ref-list.
|
||||
// YAY_DIFF_REVIEW in the git ref-list.
|
||||
func gitHasLastSeenRef(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) bool {
|
||||
_, _, err := cmdBuilder.Capture(
|
||||
cmdBuilder.BuildGitCmd(ctx,
|
||||
@ -100,7 +100,7 @@ func gitHasLastSeenRef(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir stri
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// Returns the last reviewed hash. If AUR_SEEN exists it will return this hash.
|
||||
// Returns the last reviewed hash. If YAY_DIFF_REVIEW exists it will return this hash.
|
||||
// If it does not it will return empty tree as no diff have been reviewed yet.
|
||||
func getLastSeenHash(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) (string, error) {
|
||||
if gitHasLastSeenRef(ctx, cmdBuilder, dir) {
|
||||
@ -119,7 +119,7 @@ func getLastSeenHash(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string
|
||||
return gitEmptyTree, nil
|
||||
}
|
||||
|
||||
// Update the AUR_SEEN ref to HEAD. We use this ref to determine which diff were
|
||||
// Update the YAY_DIFF_REVIEW ref to HEAD. We use this ref to determine which diff were
|
||||
// reviewed by the user.
|
||||
func gitUpdateSeenRef(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) error {
|
||||
_, stderr, err := cmdBuilder.Capture(
|
||||
@ -145,7 +145,7 @@ func updatePkgbuildSeenRef(ctx context.Context, cmdBuilder exe.ICmdBuilder, pkgb
|
||||
return errMulti.Return()
|
||||
}
|
||||
|
||||
func DiffFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
|
||||
func DiffFn(ctx context.Context, config *settings.Configuration, w io.Writer,
|
||||
pkgbuildDirsByBase map[string]string, installed mapset.Set[string],
|
||||
) error {
|
||||
if len(pkgbuildDirsByBase) == 0 {
|
||||
@ -157,23 +157,23 @@ func DiffFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
|
||||
bases = append(bases, base)
|
||||
}
|
||||
|
||||
toDiff, errMenu := selectionMenu(run.Logger, pkgbuildDirsByBase, bases, installed, gotext.Get("Diffs to show?"),
|
||||
settings.NoConfirm, run.Cfg.AnswerDiff, nil)
|
||||
toDiff, errMenu := selectionMenu(w, pkgbuildDirsByBase, bases, installed, gotext.Get("Diffs to show?"),
|
||||
settings.NoConfirm, config.AnswerDiff, nil)
|
||||
if errMenu != nil || len(toDiff) == 0 {
|
||||
return errMenu
|
||||
}
|
||||
|
||||
if errD := showPkgbuildDiffs(ctx, run.CmdBuilder, run.Logger, pkgbuildDirsByBase, toDiff); errD != nil {
|
||||
if errD := showPkgbuildDiffs(ctx, config.Runtime.CmdBuilder, pkgbuildDirsByBase, toDiff); errD != nil {
|
||||
return errD
|
||||
}
|
||||
|
||||
run.Logger.Println()
|
||||
fmt.Println()
|
||||
|
||||
if !run.Logger.ContinueTask(gotext.Get("Proceed with install?"), true, false) {
|
||||
if !text.ContinueTask(os.Stdin, gotext.Get("Proceed with install?"), true, false) {
|
||||
return settings.ErrUserAbort{}
|
||||
}
|
||||
|
||||
if errUpd := updatePkgbuildSeenRef(ctx, run.CmdBuilder, pkgbuildDirsByBase, toDiff); errUpd != nil {
|
||||
if errUpd := updatePkgbuildSeenRef(ctx, config.Runtime.CmdBuilder, pkgbuildDirsByBase, toDiff); errUpd != nil {
|
||||
return errUpd
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ import (
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
@ -60,7 +59,7 @@ func editor(log *text.Logger, editorConfig, editorFlags string, noConfirm bool)
|
||||
for {
|
||||
log.Infoln(gotext.Get("Edit PKGBUILD with?"))
|
||||
|
||||
editorInput, err := log.GetInput("", noConfirm)
|
||||
editorInput, err := text.GetInput(os.Stdin, "", noConfirm)
|
||||
if err != nil {
|
||||
log.Errorln(err)
|
||||
continue
|
||||
@ -114,7 +113,7 @@ func editPkgbuilds(log *text.Logger, pkgbuildDirs map[string]string, bases []str
|
||||
return nil
|
||||
}
|
||||
|
||||
func EditFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
|
||||
func EditFn(ctx context.Context, cfg *settings.Configuration, w io.Writer,
|
||||
pkgbuildDirsByBase map[string]string, installed mapset.Set[string],
|
||||
) error {
|
||||
if len(pkgbuildDirsByBase) == 0 {
|
||||
@ -126,21 +125,21 @@ func EditFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
|
||||
bases = append(bases, pkg)
|
||||
}
|
||||
|
||||
toEdit, errMenu := selectionMenu(run.Logger, pkgbuildDirsByBase, bases, installed,
|
||||
gotext.Get("PKGBUILDs to edit?"), settings.NoConfirm, run.Cfg.AnswerEdit, nil)
|
||||
toEdit, errMenu := selectionMenu(w, pkgbuildDirsByBase, bases, installed,
|
||||
gotext.Get("PKGBUILDs to edit?"), settings.NoConfirm, cfg.AnswerEdit, nil)
|
||||
if errMenu != nil || len(toEdit) == 0 {
|
||||
return errMenu
|
||||
}
|
||||
|
||||
// TOFIX: remove or use srcinfo data
|
||||
if errEdit := editPkgbuilds(run.Logger, pkgbuildDirsByBase,
|
||||
toEdit, run.Cfg.Editor, run.Cfg.EditorFlags, nil, settings.NoConfirm); errEdit != nil {
|
||||
if errEdit := editPkgbuilds(cfg.Runtime.Logger, pkgbuildDirsByBase,
|
||||
toEdit, cfg.Editor, cfg.EditorFlags, nil, settings.NoConfirm); errEdit != nil {
|
||||
return errEdit
|
||||
}
|
||||
|
||||
run.Logger.Println()
|
||||
cfg.Runtime.Logger.Println()
|
||||
|
||||
if !run.Logger.ContinueTask(gotext.Get("Proceed with install?"), true, false) {
|
||||
if !text.ContinueTask(os.Stdin, gotext.Get("Proceed with install?"), true, false) {
|
||||
return settings.ErrUserAbort{}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package menus
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
@ -13,9 +14,7 @@ import (
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
)
|
||||
|
||||
func pkgbuildNumberMenu(logger *text.Logger, pkgbuildDirs map[string]string,
|
||||
bases []string, installed mapset.Set[string],
|
||||
) {
|
||||
func pkgbuildNumberMenu(w io.Writer, pkgbuildDirs map[string]string, bases []string, installed mapset.Set[string]) {
|
||||
toPrint := ""
|
||||
|
||||
for n, pkgBase := range bases {
|
||||
@ -35,20 +34,20 @@ func pkgbuildNumberMenu(logger *text.Logger, pkgbuildDirs map[string]string,
|
||||
toPrint += "\n"
|
||||
}
|
||||
|
||||
logger.Print(toPrint)
|
||||
fmt.Fprint(w, toPrint)
|
||||
}
|
||||
|
||||
func selectionMenu(logger *text.Logger, pkgbuildDirs map[string]string, bases []string, installed mapset.Set[string],
|
||||
func selectionMenu(w io.Writer, pkgbuildDirs map[string]string, bases []string, installed mapset.Set[string],
|
||||
message string, noConfirm bool, defaultAnswer string, skipFunc func(string) bool,
|
||||
) ([]string, error) {
|
||||
selected := make([]string, 0)
|
||||
|
||||
pkgbuildNumberMenu(logger, pkgbuildDirs, bases, installed)
|
||||
pkgbuildNumberMenu(w, pkgbuildDirs, bases, installed)
|
||||
|
||||
logger.Infoln(message)
|
||||
logger.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", text.Cyan(gotext.Get("[N]one"))))
|
||||
text.Infoln(message)
|
||||
text.Infoln(gotext.Get("%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)", text.Cyan(gotext.Get("[N]one"))))
|
||||
|
||||
selectInput, err := logger.GetInput(defaultAnswer, noConfirm)
|
||||
selectInput, err := text.GetInput(os.Stdin, defaultAnswer, noConfirm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -4,9 +4,11 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"html"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -21,13 +23,13 @@ type item struct {
|
||||
Creator string `xml:"dc:creator"`
|
||||
}
|
||||
|
||||
func (item *item) printNews(logger *text.Logger, buildTime time.Time, all, quiet bool) {
|
||||
func (item *item) print(buildTime time.Time, all, quiet bool) {
|
||||
var fd string
|
||||
|
||||
date, err := time.Parse(time.RFC1123Z, item.PubDate)
|
||||
|
||||
if err != nil {
|
||||
logger.Errorln(err)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
} else {
|
||||
fd = text.FormatTime(int(date.Unix()))
|
||||
if !all && !buildTime.IsZero() {
|
||||
@ -37,11 +39,11 @@ func (item *item) printNews(logger *text.Logger, buildTime time.Time, all, quiet
|
||||
}
|
||||
}
|
||||
|
||||
logger.Println(text.Bold(text.Magenta(fd)), text.Bold(strings.TrimSpace(item.Title)))
|
||||
fmt.Println(text.Bold(text.Magenta(fd)), text.Bold(strings.TrimSpace(item.Title)))
|
||||
|
||||
if !quiet {
|
||||
desc := strings.TrimSpace(parseNews(item.Description))
|
||||
logger.Println(desc)
|
||||
fmt.Println(desc)
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,9 +60,7 @@ type rss struct {
|
||||
Channel channel `xml:"channel"`
|
||||
}
|
||||
|
||||
func PrintNewsFeed(ctx context.Context, client *http.Client, logger *text.Logger,
|
||||
cutOffDate time.Time, bottomUp, all, quiet bool,
|
||||
) error {
|
||||
func PrintNewsFeed(ctx context.Context, client *http.Client, cutOffDate time.Time, bottomUp, all, quiet bool) error {
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://archlinux.org/feeds/news", http.NoBody)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -87,11 +87,11 @@ func PrintNewsFeed(ctx context.Context, client *http.Client, logger *text.Logger
|
||||
|
||||
if bottomUp {
|
||||
for i := len(rssGot.Channel.Items) - 1; i >= 0; i-- {
|
||||
rssGot.Channel.Items[i].printNews(logger, cutOffDate, all, quiet)
|
||||
rssGot.Channel.Items[i].print(cutOffDate, all, quiet)
|
||||
}
|
||||
} else {
|
||||
for i := 0; i < len(rssGot.Channel.Items); i++ {
|
||||
rssGot.Channel.Items[i].printNews(logger, cutOffDate, all, quiet)
|
||||
rssGot.Channel.Items[i].print(cutOffDate, all, quiet)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,15 +8,12 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/bradleyjkemp/cupaloy"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/h2non/gock.v1"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
const lastNews = `
|
||||
@ -138,16 +135,17 @@ func TestPrintNewsFeed(t *testing.T) {
|
||||
|
||||
defer gock.Off()
|
||||
|
||||
rescueStdout := os.Stdout
|
||||
r, w, _ := os.Pipe()
|
||||
logger := text.NewLogger(w, w, strings.NewReader(""), false, "logger")
|
||||
os.Stdout = w
|
||||
|
||||
err := PrintNewsFeed(context.Background(), &http.Client{}, logger,
|
||||
tt.args.cutOffDate, tt.args.bottomUp, tt.args.all, tt.args.quiet)
|
||||
err := PrintNewsFeed(context.Background(), &http.Client{}, tt.args.cutOffDate, tt.args.bottomUp, tt.args.all, tt.args.quiet)
|
||||
assert.NoError(t, err)
|
||||
|
||||
w.Close()
|
||||
out, _ := io.ReadAll(r)
|
||||
cupaloy.SnapshotT(t, out)
|
||||
os.Stdout = rescueStdout
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -166,14 +164,15 @@ func TestPrintNewsFeedSameDay(t *testing.T) {
|
||||
|
||||
defer gock.Off()
|
||||
|
||||
rescueStdout := os.Stdout
|
||||
r, w, _ := os.Pipe()
|
||||
logger := text.NewLogger(w, w, strings.NewReader(""), false, "logger")
|
||||
os.Stdout = w
|
||||
|
||||
err := PrintNewsFeed(context.Background(), &http.Client{}, logger,
|
||||
lastNewsTime, true, false, false)
|
||||
err := PrintNewsFeed(context.Background(), &http.Client{}, lastNewsTime, true, false, false)
|
||||
assert.NoError(t, err)
|
||||
|
||||
w.Close()
|
||||
out, _ := io.ReadAll(r)
|
||||
cupaloy.SnapshotT(t, out)
|
||||
os.Stdout = rescueStdout
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
@ -48,7 +50,7 @@ type GPGCmdBuilder interface {
|
||||
|
||||
// CheckPgpKeys iterates through the keys listed in the PKGBUILDs and if needed,
|
||||
// asks the user whether yay should try to import them.
|
||||
func CheckPgpKeys(ctx context.Context, logger *text.Logger, pkgbuildDirsByBase map[string]string, srcinfos map[string]*gosrc.Srcinfo,
|
||||
func CheckPgpKeys(ctx context.Context, pkgbuildDirsByBase map[string]string, srcinfos map[string]*gosrc.Srcinfo,
|
||||
cmdBuilder GPGCmdBuilder, noConfirm bool,
|
||||
) ([]string, error) {
|
||||
// Let's check the keys individually, and then we can offer to import
|
||||
@ -78,23 +80,24 @@ func CheckPgpKeys(ctx context.Context, logger *text.Logger, pkgbuildDirsByBase m
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
str, err := formatKeysToImport(logger, problematic)
|
||||
str, err := formatKeysToImport(problematic)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logger.Println("\n", str)
|
||||
fmt.Println()
|
||||
fmt.Println(str)
|
||||
|
||||
if logger.ContinueTask(gotext.Get("Import?"), true, noConfirm) {
|
||||
return problematic.toSlice(), importKeys(ctx, logger, cmdBuilder, problematic.toSlice())
|
||||
if text.ContinueTask(os.Stdin, gotext.Get("Import?"), true, noConfirm) {
|
||||
return problematic.toSlice(), importKeys(ctx, cmdBuilder, problematic.toSlice())
|
||||
}
|
||||
|
||||
return problematic.toSlice(), nil
|
||||
}
|
||||
|
||||
// importKeys tries to import the list of keys specified in its argument.
|
||||
func importKeys(ctx context.Context, logger *text.Logger, cmdBuilder GPGCmdBuilder, keys []string) error {
|
||||
logger.OperationInfoln(gotext.Get("Importing keys with gpg..."))
|
||||
func importKeys(ctx context.Context, cmdBuilder GPGCmdBuilder, keys []string) error {
|
||||
text.OperationInfoln(gotext.Get("Importing keys with gpg..."))
|
||||
|
||||
if err := cmdBuilder.Show(cmdBuilder.BuildGPGCmd(ctx, append([]string{"--recv-keys"}, keys...)...)); err != nil {
|
||||
return errors.New(gotext.Get("problem importing keys"))
|
||||
@ -105,14 +108,14 @@ func importKeys(ctx context.Context, logger *text.Logger, cmdBuilder GPGCmdBuild
|
||||
|
||||
// formatKeysToImport receives a set of keys and returns a string containing the
|
||||
// question asking the user wants to import the problematic keys.
|
||||
func formatKeysToImport(logger *text.Logger, keys pgpKeySet) (string, error) {
|
||||
func formatKeysToImport(keys pgpKeySet) (string, error) {
|
||||
if len(keys) == 0 {
|
||||
return "", errors.New(gotext.Get("no keys to import"))
|
||||
}
|
||||
|
||||
var buffer bytes.Buffer
|
||||
|
||||
buffer.WriteString(logger.SprintOperationInfo(gotext.Get("PGP keys need importing:")))
|
||||
buffer.WriteString(text.SprintOperationInfo(gotext.Get("PGP keys need importing:")))
|
||||
|
||||
for key, bases := range keys {
|
||||
pkglist := ""
|
||||
@ -121,7 +124,7 @@ func formatKeysToImport(logger *text.Logger, keys pgpKeySet) (string, error) {
|
||||
}
|
||||
|
||||
pkglist = strings.TrimRight(pkglist, " ")
|
||||
buffer.WriteString("\n" + logger.SprintWarn(gotext.Get("%s, required by: %s", text.Cyan(key), text.Cyan(pkglist))))
|
||||
buffer.WriteString("\n" + text.SprintWarn(gotext.Get("%s, required by: %s", text.Cyan(key), text.Cyan(pkglist))))
|
||||
}
|
||||
|
||||
return buffer.String(), nil
|
@ -6,7 +6,6 @@ package pgp
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sort"
|
||||
@ -18,13 +17,8 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func newTestLogger() *text.Logger {
|
||||
return text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), true, "test")
|
||||
}
|
||||
|
||||
func makeSrcinfo(pkgbase string, pgpkeys ...string) *gosrc.Srcinfo {
|
||||
srcinfo := gosrc.Srcinfo{}
|
||||
srcinfo.Pkgbase = pkgbase
|
||||
@ -234,7 +228,7 @@ func TestCheckPgpKeys(t *testing.T) {
|
||||
GPGFlags: []string{"--homedir /tmp"},
|
||||
Runner: mockRunner,
|
||||
}
|
||||
problematic, err := CheckPgpKeys(context.Background(), newTestLogger(), tt.pkgs, tt.srcinfos, &cmdBuilder, true)
|
||||
problematic, err := CheckPgpKeys(context.Background(), tt.pkgs, tt.srcinfos, &cmdBuilder, true)
|
||||
|
||||
require.Len(t, mockRunner.ShowCalls, len(tt.wantShow))
|
||||
require.Len(t, mockRunner.CaptureCalls, len(tt.wantCapture))
|
@ -22,6 +22,9 @@ type AURWarnings struct {
|
||||
}
|
||||
|
||||
func NewWarnings(logger *text.Logger) *AURWarnings {
|
||||
if logger == nil {
|
||||
logger = text.GlobalLogger
|
||||
}
|
||||
return &AURWarnings{log: logger}
|
||||
}
|
||||
|
||||
@ -52,14 +55,10 @@ func (warnings *AURWarnings) AddToWarnings(remote map[string]alpm.IPackage, aurP
|
||||
}
|
||||
}
|
||||
|
||||
func (warnings *AURWarnings) CalculateMissing(remoteNames []string,
|
||||
remote map[string]alpm.IPackage, aurData map[string]*aur.Pkg,
|
||||
) {
|
||||
func (warnings *AURWarnings) CalculateMissing(remoteNames []string, remote map[string]alpm.IPackage, aurData map[string]*aur.Pkg) {
|
||||
for _, name := range remoteNames {
|
||||
if _, ok := aurData[name]; !ok && !remote[name].ShouldIgnore() {
|
||||
if _, ok := aurData[strings.TrimSuffix(name, "-debug")]; !ok {
|
||||
warnings.Missing = append(warnings.Missing, name)
|
||||
}
|
||||
warnings.Missing = append(warnings.Missing, name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,19 +7,19 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func RemoveInvalidTargets(logger *text.Logger, targets []string, mode parser.TargetMode) []string {
|
||||
func RemoveInvalidTargets(targets []string, mode parser.TargetMode) []string {
|
||||
filteredTargets := make([]string, 0)
|
||||
|
||||
for _, target := range targets {
|
||||
dbName, _ := text.SplitDBFromName(target)
|
||||
|
||||
if dbName == "aur" && !mode.AtLeastAUR() {
|
||||
logger.Warnln(gotext.Get("%s: can't use target with option --repo -- skipping", text.Cyan(target)))
|
||||
text.Warnln(gotext.Get("%s: can't use target with option --repo -- skipping", text.Cyan(target)))
|
||||
continue
|
||||
}
|
||||
|
||||
if dbName != "aur" && dbName != "" && !mode.AtLeastRepo() {
|
||||
logger.Warnln(gotext.Get("%s: can't use target with option --aur -- skipping", text.Cyan(target)))
|
||||
text.Warnln(gotext.Get("%s: can't use target with option --aur -- skipping", text.Cyan(target)))
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ func (a *abstractResults) Less(i, j int) bool {
|
||||
func (s *SourceQueryBuilder) Execute(ctx context.Context, dbExecutor db.Executor, pkgS []string) {
|
||||
var aurErr error
|
||||
|
||||
pkgS = RemoveInvalidTargets(s.logger, pkgS, s.targetMode)
|
||||
pkgS = RemoveInvalidTargets(pkgS, s.targetMode)
|
||||
|
||||
metric := &metrics.Hamming{
|
||||
CaseSensitive: false,
|
||||
@ -289,7 +289,7 @@ func matchesSearch(pkg *aur.Pkg, terms []string) bool {
|
||||
desc := strings.ToLower(pkg.Description)
|
||||
targ := strings.ToLower(pkgN)
|
||||
|
||||
if !strings.Contains(name, targ) && !strings.Contains(desc, targ) {
|
||||
if !(strings.Contains(name, targ) || strings.Contains(desc, targ)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func GetVersionDiff(oldVersion, newVersion string) (left, right string) {
|
||||
}
|
||||
|
||||
for index, char := range oldVersion {
|
||||
charIsSpecial := !unicode.IsLetter(char) && !unicode.IsNumber(char)
|
||||
charIsSpecial := !(unicode.IsLetter(char) || unicode.IsNumber(char))
|
||||
|
||||
if (index >= len(newVersion)) || (char != rune(newVersion[index])) {
|
||||
if charIsSpecial {
|
||||
|
@ -1,66 +0,0 @@
|
||||
//go:build !integration
|
||||
// +build !integration
|
||||
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/Morganamilo/go-pacmanconf"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
)
|
||||
|
||||
func TestPacmanConf(t *testing.T) {
|
||||
t.Parallel()
|
||||
path := "../../testdata/pacman.conf"
|
||||
|
||||
absPath, err := filepath.Abs(path)
|
||||
require.NoError(t, err)
|
||||
|
||||
// detect the architecture of the system
|
||||
expectedArch := []string{"x86_64"}
|
||||
if runtime.GOARCH == "arm64" {
|
||||
expectedArch = []string{"aarch64"}
|
||||
}
|
||||
|
||||
expectedPacmanConf := &pacmanconf.Config{
|
||||
RootDir: "/", DBPath: "/var/lib/pacman/",
|
||||
CacheDir: []string{"/var/cache/pacman/pkg/"},
|
||||
HookDir: []string{"/etc/pacman.d/hooks/"},
|
||||
GPGDir: "/etc/pacman.d/gnupg/", LogFile: "/var/log/pacman.log",
|
||||
HoldPkg: []string{"pacman", "glibc"}, IgnorePkg: []string{"xorm"},
|
||||
IgnoreGroup: []string{"yorm"}, Architecture: expectedArch,
|
||||
XferCommand: "/usr/bin/wget --passive-ftp -c -O %o %u",
|
||||
NoUpgrade: []string(nil), NoExtract: []string(nil), CleanMethod: []string{"KeepInstalled"},
|
||||
SigLevel: []string{"PackageRequired", "PackageTrustedOnly", "DatabaseOptional", "DatabaseTrustedOnly"},
|
||||
LocalFileSigLevel: []string{"PackageOptional", "PackageTrustedOnly"},
|
||||
RemoteFileSigLevel: []string{"PackageRequired", "PackageTrustedOnly"}, UseSyslog: true,
|
||||
Color: true, UseDelta: 0, TotalDownload: false, CheckSpace: true,
|
||||
VerbosePkgLists: true, DisableDownloadTimeout: false,
|
||||
Repos: []pacmanconf.Repository{
|
||||
{
|
||||
Name: "core", Servers: []string{"Core"},
|
||||
SigLevel: []string(nil), Usage: []string{"All"},
|
||||
},
|
||||
{
|
||||
Name: "extra", Servers: []string{"Extra"}, SigLevel: []string(nil),
|
||||
Usage: []string{"All"},
|
||||
},
|
||||
{
|
||||
Name: "multilib", Servers: []string{"repo3", "multilib"},
|
||||
SigLevel: []string(nil), Usage: []string{"All"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pacmanConf, color, err := retrievePacmanConfig(parser.MakeArguments(), absPath)
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, pacmanConf)
|
||||
assert.Equal(t, color, false)
|
||||
assert.EqualValues(t, expectedPacmanConf, pacmanConf)
|
||||
}
|
@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func (c *Configuration) ParseCommandLine(a *parser.Arguments) error {
|
||||
@ -14,6 +15,9 @@ func (c *Configuration) ParseCommandLine(a *parser.Arguments) error {
|
||||
|
||||
c.extractYayOptions(a)
|
||||
|
||||
// Reload CmdBuilder
|
||||
c.Runtime.CmdBuilder = c.CmdBuilder(nil)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -42,29 +46,29 @@ func (c *Configuration) extractYayOptions(a *parser.Arguments) {
|
||||
}
|
||||
|
||||
func (c *Configuration) handleOption(option, value string) bool {
|
||||
boolValue, err := strconv.ParseBool(value)
|
||||
if err != nil {
|
||||
boolValue = true
|
||||
}
|
||||
|
||||
switch option {
|
||||
case "aururl":
|
||||
c.AURURL = value
|
||||
case "aurrpcurl":
|
||||
c.AURRPCURL = value
|
||||
case "save":
|
||||
c.SaveConfig = boolValue
|
||||
c.SaveConfig = true
|
||||
case "afterclean", "cleanafter":
|
||||
c.CleanAfter = boolValue
|
||||
case "keepsrc":
|
||||
c.KeepSrc = boolValue
|
||||
c.CleanAfter = true
|
||||
case "noafterclean", "nocleanafter":
|
||||
c.CleanAfter = false
|
||||
case "debug":
|
||||
c.Debug = boolValue
|
||||
return !boolValue
|
||||
c.Debug = true
|
||||
text.GlobalLogger.Debug = true
|
||||
return false
|
||||
case "devel":
|
||||
c.Devel = boolValue
|
||||
c.Devel = true
|
||||
case "nodevel":
|
||||
c.Devel = false
|
||||
case "timeupdate":
|
||||
c.TimeUpdate = boolValue
|
||||
c.TimeUpdate = true
|
||||
case "notimeupdate":
|
||||
c.TimeUpdate = false
|
||||
case "topdown":
|
||||
c.BottomUp = false
|
||||
case "bottomup":
|
||||
@ -83,7 +87,7 @@ func (c *Configuration) handleOption(option, value string) bool {
|
||||
case "searchby":
|
||||
c.SearchBy = value
|
||||
case "noconfirm":
|
||||
NoConfirm = boolValue
|
||||
NoConfirm = true
|
||||
case "config":
|
||||
c.PacmanConf = value
|
||||
case "redownload":
|
||||
@ -101,7 +105,9 @@ func (c *Configuration) handleOption(option, value string) bool {
|
||||
case "norebuild":
|
||||
c.ReBuild = parser.RebuildModeNo
|
||||
case "batchinstall":
|
||||
c.BatchInstall = boolValue
|
||||
c.BatchInstall = true
|
||||
case "nobatchinstall":
|
||||
c.BatchInstall = false
|
||||
case "answerclean":
|
||||
c.AnswerClean = value
|
||||
case "noanswerclean":
|
||||
@ -152,24 +158,40 @@ func (c *Configuration) handleOption(option, value string) bool {
|
||||
c.RequestSplitN = n
|
||||
}
|
||||
case "sudoloop":
|
||||
c.SudoLoop = boolValue
|
||||
c.SudoLoop = true
|
||||
case "nosudoloop":
|
||||
c.SudoLoop = false
|
||||
case "provides":
|
||||
c.Provides = boolValue
|
||||
c.Provides = true
|
||||
case "noprovides":
|
||||
c.Provides = false
|
||||
case "pgpfetch":
|
||||
c.PGPFetch = boolValue
|
||||
c.PGPFetch = true
|
||||
case "nopgpfetch":
|
||||
c.PGPFetch = false
|
||||
case "cleanmenu":
|
||||
c.CleanMenu = boolValue
|
||||
c.CleanMenu = true
|
||||
case "nocleanmenu":
|
||||
c.CleanMenu = false
|
||||
case "diffmenu":
|
||||
c.DiffMenu = boolValue
|
||||
c.DiffMenu = true
|
||||
case "nodiffmenu":
|
||||
c.DiffMenu = false
|
||||
case "editmenu":
|
||||
c.EditMenu = boolValue
|
||||
c.EditMenu = true
|
||||
case "noeditmenu":
|
||||
c.EditMenu = false
|
||||
case "useask":
|
||||
c.UseAsk = boolValue
|
||||
c.UseAsk = true
|
||||
case "nouseask":
|
||||
c.UseAsk = false
|
||||
case "combinedupgrade":
|
||||
c.CombinedUpgrade = boolValue
|
||||
c.CombinedUpgrade = true
|
||||
case "nocombinedupgrade":
|
||||
c.CombinedUpgrade = false
|
||||
case "a", "aur":
|
||||
c.Mode = parser.ModeAUR
|
||||
case "N", "repo":
|
||||
case "repo":
|
||||
c.Mode = parser.ModeRepo
|
||||
case "removemake":
|
||||
c.RemoveMake = "yes"
|
||||
@ -180,7 +202,9 @@ func (c *Configuration) handleOption(option, value string) bool {
|
||||
case "askyesremovemake":
|
||||
c.RemoveMake = "askyes"
|
||||
case "separatesources":
|
||||
c.SeparateSources = boolValue
|
||||
c.SeparateSources = true
|
||||
case "noseparatesources":
|
||||
c.SeparateSources = false
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
|
||||
@ -23,53 +24,53 @@ var NoConfirm = false
|
||||
|
||||
// Configuration stores yay's config.
|
||||
type Configuration struct {
|
||||
AURURL string `json:"aururl"`
|
||||
AURRPCURL string `json:"aurrpcurl"`
|
||||
BuildDir string `json:"buildDir"`
|
||||
Editor string `json:"editor"`
|
||||
EditorFlags string `json:"editorflags"`
|
||||
MakepkgBin string `json:"makepkgbin"`
|
||||
MakepkgConf string `json:"makepkgconf"`
|
||||
PacmanBin string `json:"pacmanbin"`
|
||||
PacmanConf string `json:"pacmanconf"`
|
||||
ReDownload string `json:"redownload"`
|
||||
AnswerClean string `json:"answerclean"`
|
||||
AnswerDiff string `json:"answerdiff"`
|
||||
AnswerEdit string `json:"answeredit"`
|
||||
AnswerUpgrade string `json:"answerupgrade"`
|
||||
GitBin string `json:"gitbin"`
|
||||
GpgBin string `json:"gpgbin"`
|
||||
GpgFlags string `json:"gpgflags"`
|
||||
MFlags string `json:"mflags"`
|
||||
SortBy string `json:"sortby"`
|
||||
SearchBy string `json:"searchby"`
|
||||
GitFlags string `json:"gitflags"`
|
||||
RemoveMake string `json:"removemake"`
|
||||
SudoBin string `json:"sudobin"`
|
||||
SudoFlags string `json:"sudoflags"`
|
||||
Version string `json:"version"`
|
||||
RequestSplitN int `json:"requestsplitn"`
|
||||
CompletionInterval int `json:"completionrefreshtime"`
|
||||
MaxConcurrentDownloads int `json:"maxconcurrentdownloads"`
|
||||
BottomUp bool `json:"bottomup"`
|
||||
SudoLoop bool `json:"sudoloop"`
|
||||
TimeUpdate bool `json:"timeupdate"`
|
||||
Devel bool `json:"devel"`
|
||||
CleanAfter bool `json:"cleanAfter"`
|
||||
KeepSrc bool `json:"keepSrc"`
|
||||
Provides bool `json:"provides"`
|
||||
PGPFetch bool `json:"pgpfetch"`
|
||||
CleanMenu bool `json:"cleanmenu"`
|
||||
DiffMenu bool `json:"diffmenu"`
|
||||
EditMenu bool `json:"editmenu"`
|
||||
CombinedUpgrade bool `json:"combinedupgrade"`
|
||||
UseAsk bool `json:"useask"`
|
||||
BatchInstall bool `json:"batchinstall"`
|
||||
SingleLineResults bool `json:"singlelineresults"`
|
||||
SeparateSources bool `json:"separatesources"`
|
||||
Debug bool `json:"debug"`
|
||||
UseRPC bool `json:"rpc"`
|
||||
DoubleConfirm bool `json:"doubleconfirm"` // confirm install before and after build
|
||||
Runtime *Runtime `json:"-"`
|
||||
AURURL string `json:"aururl"`
|
||||
AURRPCURL string `json:"aurrpcurl"`
|
||||
BuildDir string `json:"buildDir"`
|
||||
Editor string `json:"editor"`
|
||||
EditorFlags string `json:"editorflags"`
|
||||
MakepkgBin string `json:"makepkgbin"`
|
||||
MakepkgConf string `json:"makepkgconf"`
|
||||
PacmanBin string `json:"pacmanbin"`
|
||||
PacmanConf string `json:"pacmanconf"`
|
||||
ReDownload string `json:"redownload"`
|
||||
AnswerClean string `json:"answerclean"`
|
||||
AnswerDiff string `json:"answerdiff"`
|
||||
AnswerEdit string `json:"answeredit"`
|
||||
AnswerUpgrade string `json:"answerupgrade"`
|
||||
GitBin string `json:"gitbin"`
|
||||
GpgBin string `json:"gpgbin"`
|
||||
GpgFlags string `json:"gpgflags"`
|
||||
MFlags string `json:"mflags"`
|
||||
SortBy string `json:"sortby"`
|
||||
SearchBy string `json:"searchby"`
|
||||
GitFlags string `json:"gitflags"`
|
||||
RemoveMake string `json:"removemake"`
|
||||
SudoBin string `json:"sudobin"`
|
||||
SudoFlags string `json:"sudoflags"`
|
||||
Version string `json:"version"`
|
||||
RequestSplitN int `json:"requestsplitn"`
|
||||
CompletionInterval int `json:"completionrefreshtime"`
|
||||
MaxConcurrentDownloads int `json:"maxconcurrentdownloads"`
|
||||
BottomUp bool `json:"bottomup"`
|
||||
SudoLoop bool `json:"sudoloop"`
|
||||
TimeUpdate bool `json:"timeupdate"`
|
||||
Devel bool `json:"devel"`
|
||||
CleanAfter bool `json:"cleanAfter"`
|
||||
Provides bool `json:"provides"`
|
||||
PGPFetch bool `json:"pgpfetch"`
|
||||
CleanMenu bool `json:"cleanmenu"`
|
||||
DiffMenu bool `json:"diffmenu"`
|
||||
EditMenu bool `json:"editmenu"`
|
||||
CombinedUpgrade bool `json:"combinedupgrade"`
|
||||
UseAsk bool `json:"useask"`
|
||||
BatchInstall bool `json:"batchinstall"`
|
||||
SingleLineResults bool `json:"singlelineresults"`
|
||||
SeparateSources bool `json:"separatesources"`
|
||||
Debug bool `json:"debug"`
|
||||
UseRPC bool `json:"rpc"`
|
||||
DoubleConfirm bool `json:"doubleconfirm"` // confirm install before and after build
|
||||
|
||||
CompletionPath string `json:"-"`
|
||||
VCSFilePath string `json:"-"`
|
||||
@ -194,7 +195,6 @@ func DefaultConfig(version string) *Configuration {
|
||||
AURURL: "https://aur.archlinux.org",
|
||||
BuildDir: os.ExpandEnv("$HOME/.cache/yay"),
|
||||
CleanAfter: false,
|
||||
KeepSrc: false,
|
||||
Editor: "",
|
||||
EditorFlags: "",
|
||||
Devel: false,
|
||||
@ -208,7 +208,7 @@ func DefaultConfig(version string) *Configuration {
|
||||
GitFlags: "",
|
||||
BottomUp: true,
|
||||
CompletionInterval: 7,
|
||||
MaxConcurrentDownloads: 1,
|
||||
MaxConcurrentDownloads: 0,
|
||||
SortBy: "votes",
|
||||
SearchBy: "name-desc",
|
||||
SudoLoop: false,
|
||||
@ -237,16 +237,19 @@ func DefaultConfig(version string) *Configuration {
|
||||
Debug: false,
|
||||
UseRPC: true,
|
||||
DoubleConfirm: true,
|
||||
Mode: parser.ModeAny,
|
||||
Runtime: &Runtime{
|
||||
Logger: text.GlobalLogger,
|
||||
},
|
||||
Mode: parser.ModeAny,
|
||||
}
|
||||
}
|
||||
|
||||
func NewConfig(logger *text.Logger, configPath, version string) (*Configuration, error) {
|
||||
func NewConfig(configPath, version string) (*Configuration, error) {
|
||||
newConfig := DefaultConfig(version)
|
||||
|
||||
cacheHome, errCache := getCacheHome()
|
||||
if errCache != nil && logger != nil {
|
||||
logger.Errorln(errCache)
|
||||
if errCache != nil {
|
||||
text.Errorln(errCache)
|
||||
}
|
||||
|
||||
newConfig.BuildDir = cacheHome
|
||||
@ -292,3 +295,27 @@ func (c *Configuration) load(configPath string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Configuration) CmdBuilder(runner exe.Runner) exe.ICmdBuilder {
|
||||
if runner == nil {
|
||||
runner = &exe.OSRunner{Log: c.Runtime.Logger.Child("runner")}
|
||||
}
|
||||
|
||||
return &exe.CmdBuilder{
|
||||
GitBin: c.GitBin,
|
||||
GitFlags: strings.Fields(c.GitFlags),
|
||||
GPGBin: c.GpgBin,
|
||||
GPGFlags: strings.Fields(c.GpgFlags),
|
||||
MakepkgFlags: strings.Fields(c.MFlags),
|
||||
MakepkgConfPath: c.MakepkgConf,
|
||||
MakepkgBin: c.MakepkgBin,
|
||||
SudoBin: c.SudoBin,
|
||||
SudoFlags: strings.Fields(c.SudoFlags),
|
||||
SudoLoopEnabled: c.SudoLoop,
|
||||
PacmanBin: c.PacmanBin,
|
||||
PacmanConfigPath: c.PacmanConf,
|
||||
PacmanDBPath: "",
|
||||
Runner: runner,
|
||||
Log: c.Runtime.Logger.Child("cmd_builder"),
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ func TestNewConfig(t *testing.T) {
|
||||
_, err = f.WriteString(string(configJSON))
|
||||
assert.NoError(t, err)
|
||||
|
||||
newConfig, err := NewConfig(nil, GetConfigPath(), "v1.0.0")
|
||||
newConfig, err := NewConfig(GetConfigPath(), "v1.0.0")
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, filepath.Join(cacheDir, "test-build-dir"), newConfig.BuildDir)
|
||||
@ -69,7 +69,7 @@ func TestNewConfigAURDEST(t *testing.T) {
|
||||
_, err = f.WriteString(string(configJSON))
|
||||
assert.NoError(t, err)
|
||||
|
||||
newConfig, err := NewConfig(nil, GetConfigPath(), "v1.0.0")
|
||||
newConfig, err := NewConfig(GetConfigPath(), "v1.0.0")
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, filepath.Join(cacheDir, "test-build-dir"), newConfig.BuildDir)
|
||||
@ -102,7 +102,7 @@ func TestNewConfigAURDESTTildeExpansion(t *testing.T) {
|
||||
_, err = f.WriteString(string(configJSON))
|
||||
assert.NoError(t, err)
|
||||
|
||||
newConfig, err := NewConfig(nil, GetConfigPath(), "v1.0.0")
|
||||
newConfig, err := NewConfig(GetConfigPath(), "v1.0.0")
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, filepath.Join(homeDir, "test-build-dir"), newConfig.BuildDir)
|
||||
|
@ -15,7 +15,6 @@ import (
|
||||
mapset "github.com/deckarep/golang-set/v2"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
@ -39,7 +38,7 @@ type ICmdBuilder interface {
|
||||
BuildMakepkgCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd
|
||||
BuildPacmanCmd(ctx context.Context, args *parser.Arguments, mode parser.TargetMode, noConfirm bool) *exec.Cmd
|
||||
AddMakepkgFlag(string)
|
||||
GetKeepSrc() bool
|
||||
SetPacmanDBPath(string)
|
||||
SudoLoop()
|
||||
}
|
||||
|
||||
@ -57,32 +56,10 @@ type CmdBuilder struct {
|
||||
PacmanBin string
|
||||
PacmanConfigPath string
|
||||
PacmanDBPath string
|
||||
KeepSrc bool
|
||||
Runner Runner
|
||||
Log *text.Logger
|
||||
}
|
||||
|
||||
func NewCmdBuilder(cfg *settings.Configuration, runner Runner, logger *text.Logger, dbPath string) *CmdBuilder {
|
||||
return &CmdBuilder{
|
||||
GitBin: cfg.GitBin,
|
||||
GitFlags: strings.Fields(cfg.GitFlags),
|
||||
GPGBin: cfg.GpgBin,
|
||||
GPGFlags: strings.Fields(cfg.GpgFlags),
|
||||
MakepkgFlags: strings.Fields(cfg.MFlags),
|
||||
MakepkgConfPath: cfg.MakepkgConf,
|
||||
MakepkgBin: cfg.MakepkgBin,
|
||||
SudoBin: cfg.SudoBin,
|
||||
SudoFlags: strings.Fields(cfg.SudoFlags),
|
||||
SudoLoopEnabled: cfg.SudoLoop,
|
||||
PacmanBin: cfg.PacmanBin,
|
||||
PacmanConfigPath: cfg.PacmanConf,
|
||||
PacmanDBPath: dbPath,
|
||||
KeepSrc: cfg.KeepSrc,
|
||||
Runner: runner,
|
||||
Log: logger,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CmdBuilder) BuildGPGCmd(ctx context.Context, extraArgs ...string) *exec.Cmd {
|
||||
args := make([]string, len(c.GPGFlags), len(c.GPGFlags)+len(extraArgs))
|
||||
copy(args, c.GPGFlags)
|
||||
@ -158,6 +135,10 @@ func (c *CmdBuilder) BuildMakepkgCmd(ctx context.Context, dir string, extraArgs
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *CmdBuilder) SetPacmanDBPath(dbPath string) {
|
||||
c.PacmanDBPath = dbPath
|
||||
}
|
||||
|
||||
// deElevateCommand, `systemd-run` code based on pikaur.
|
||||
func (c *CmdBuilder) deElevateCommand(ctx context.Context, cmd *exec.Cmd) *exec.Cmd {
|
||||
if os.Geteuid() != 0 {
|
||||
@ -173,12 +154,11 @@ func (c *CmdBuilder) deElevateCommand(ctx context.Context, cmd *exec.Cmd) *exec.
|
||||
|
||||
if userFound, err := user.Lookup(ogCaller); err == nil {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||
uid64, errUid := strconv.ParseUint(userFound.Uid, 10, 32)
|
||||
gid64, errGid := strconv.ParseUint(userFound.Gid, 10, 32)
|
||||
if errUid == nil && errGid == nil {
|
||||
cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uint32(uid64), Gid: uint32(gid64)}
|
||||
return cmd
|
||||
}
|
||||
uid, _ := strconv.Atoi(userFound.Uid)
|
||||
gid, _ := strconv.Atoi(userFound.Gid)
|
||||
cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uint32(uid), Gid: uint32(gid)}
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
cmdArgs := []string{
|
||||
@ -262,7 +242,7 @@ func (c *CmdBuilder) waitLock(dbPath string) {
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
if _, err := os.Stat(lockDBPath); err != nil {
|
||||
c.Log.Println()
|
||||
fmt.Println()
|
||||
|
||||
return
|
||||
}
|
||||
@ -300,7 +280,3 @@ func (c *CmdBuilder) Show(cmd *exec.Cmd) error {
|
||||
func (c *CmdBuilder) Capture(cmd *exec.Cmd) (stdout, stderr string, err error) {
|
||||
return c.Runner.Capture(cmd)
|
||||
}
|
||||
|
||||
func (c *CmdBuilder) GetKeepSrc() bool {
|
||||
return c.KeepSrc
|
||||
}
|
||||
|
@ -19,10 +19,6 @@ type OSRunner struct {
|
||||
Log *text.Logger
|
||||
}
|
||||
|
||||
func NewOSRunner(log *text.Logger) *OSRunner {
|
||||
return &OSRunner{log}
|
||||
}
|
||||
|
||||
func (r *OSRunner) Show(cmd *exec.Cmd) error {
|
||||
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
|
@ -25,7 +25,6 @@ type MockBuilder struct {
|
||||
BuildMakepkgCmdCalls []Call
|
||||
BuildMakepkgCmdFn func(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd
|
||||
BuildPacmanCmdFn func(ctx context.Context, args *parser.Arguments, mode parser.TargetMode, noConfirm bool) *exec.Cmd
|
||||
GetKeepSrcFn func() bool
|
||||
}
|
||||
|
||||
type MockRunner struct {
|
||||
@ -37,10 +36,6 @@ type MockRunner struct {
|
||||
CaptureFn func(cmd *exec.Cmd) (stdout string, stderr string, err error)
|
||||
}
|
||||
|
||||
func (m *MockBuilder) BuildGPGCmd(ctx context.Context, extraArgs ...string) *exec.Cmd {
|
||||
return exec.CommandContext(ctx, "gpg", extraArgs...)
|
||||
}
|
||||
|
||||
func (m *MockBuilder) BuildMakepkgCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd {
|
||||
var res *exec.Cmd
|
||||
if m.BuildMakepkgCmdFn != nil {
|
||||
@ -96,10 +91,6 @@ func (m *MockBuilder) Show(cmd *exec.Cmd) error {
|
||||
return m.Runner.Show(cmd)
|
||||
}
|
||||
|
||||
func (m *MockBuilder) GetKeepSrc() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *MockRunner) Capture(cmd *exec.Cmd) (stdout, stderr string, err error) {
|
||||
m.CaptureCallsMu.Lock()
|
||||
m.CaptureCalls = append(m.CaptureCalls, Call{
|
||||
|
@ -45,7 +45,7 @@ func DefaultMigrations() []configMigration {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Configuration) RunMigrations(logger *text.Logger, migrations []configMigration,
|
||||
func (c *Configuration) RunMigrations(migrations []configMigration,
|
||||
configPath, newVersion string,
|
||||
) error {
|
||||
saveConfig := false
|
||||
@ -53,7 +53,7 @@ func (c *Configuration) RunMigrations(logger *text.Logger, migrations []configMi
|
||||
for _, migration := range migrations {
|
||||
if db.VerCmp(migration.TargetVersion(), c.Version) > 0 {
|
||||
if migration.Do(c) {
|
||||
logger.Infoln("Config migration executed (",
|
||||
text.Infoln("Config migration executed (",
|
||||
migration.TargetVersion(), "):", migration)
|
||||
|
||||
saveConfig = true
|
||||
|
@ -16,10 +16,6 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func newTestLogger() *text.Logger {
|
||||
return text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), true, "test")
|
||||
}
|
||||
|
||||
func TestMigrationNothingToDo(t *testing.T) {
|
||||
t.Parallel()
|
||||
// Create temporary file for config
|
||||
@ -32,10 +28,13 @@ func TestMigrationNothingToDo(t *testing.T) {
|
||||
config := Configuration{
|
||||
Version: "99.0.0",
|
||||
// Create runtime with runtimeVersion
|
||||
Runtime: &Runtime{
|
||||
Logger: text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), false, "test"),
|
||||
},
|
||||
}
|
||||
|
||||
// Run Migration
|
||||
err = config.RunMigrations(newTestLogger(), DefaultMigrations(), testFilePath, "20.0.0")
|
||||
err = config.RunMigrations(DefaultMigrations(), testFilePath, "20.0.0")
|
||||
require.NoError(t, err)
|
||||
|
||||
// Check file contents if wantSave otherwise check file empty
|
||||
@ -54,6 +53,9 @@ func TestProvidesMigrationDo(t *testing.T) {
|
||||
migration := &configProviderMigration{}
|
||||
config := Configuration{
|
||||
Provides: true,
|
||||
Runtime: &Runtime{
|
||||
Logger: text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), false, "test"),
|
||||
},
|
||||
}
|
||||
|
||||
assert.True(t, migration.Do(&config))
|
||||
@ -133,10 +135,13 @@ func TestProvidesMigration(t *testing.T) {
|
||||
Version: tc.testConfig.Version,
|
||||
Provides: tc.testConfig.Provides,
|
||||
// Create runtime with runtimeVersion
|
||||
Runtime: &Runtime{
|
||||
Logger: text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), false, "test"),
|
||||
},
|
||||
}
|
||||
|
||||
// Run Migration
|
||||
err = tcConfig.RunMigrations(newTestLogger(),
|
||||
err = tcConfig.RunMigrations(
|
||||
[]configMigration{&configProviderMigration{}},
|
||||
testFilePath, tc.newVersion)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package runtime
|
||||
package settings
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
func retrievePacmanConfig(cmdArgs *parser.Arguments, pacmanConfigPath string) (*pacmanconf.Config, bool, error) {
|
||||
func RetrievePacmanConfig(cmdArgs *parser.Arguments, pacmanConfigPath string) (*pacmanconf.Config, bool, error) {
|
||||
root := "/"
|
||||
if value, _, exists := cmdArgs.GetArg("root", "r"); exists {
|
||||
root = value
|
54
pkg/settings/pacman_test.go
Normal file
54
pkg/settings/pacman_test.go
Normal file
@ -0,0 +1,54 @@
|
||||
//go:build !integration
|
||||
// +build !integration
|
||||
|
||||
package settings
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Morganamilo/go-pacmanconf"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
)
|
||||
|
||||
func TestPacmanConf(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
expectedPacmanConf := &pacmanconf.Config{
|
||||
RootDir: "/",
|
||||
DBPath: "//var/lib/pacman/",
|
||||
CacheDir: []string{"/cachedir/", "/another/"},
|
||||
HookDir: []string{"/hookdir/"},
|
||||
GPGDir: "/gpgdir/",
|
||||
LogFile: "/logfile",
|
||||
HoldPkg: []string(nil),
|
||||
IgnorePkg: []string{"ignore", "this", "package"},
|
||||
IgnoreGroup: []string{"ignore", "this", "group"},
|
||||
Architecture: []string{"8086"},
|
||||
XferCommand: "",
|
||||
NoUpgrade: []string{"noupgrade"},
|
||||
NoExtract: []string{"noextract"},
|
||||
CleanMethod: []string{"KeepInstalled"},
|
||||
SigLevel: []string{"PackageOptional", "PackageTrustedOnly", "DatabaseOptional", "DatabaseTrustedOnly"},
|
||||
LocalFileSigLevel: []string(nil),
|
||||
RemoteFileSigLevel: []string(nil),
|
||||
UseSyslog: false,
|
||||
Color: false,
|
||||
UseDelta: 0,
|
||||
TotalDownload: false,
|
||||
CheckSpace: true,
|
||||
VerbosePkgLists: true,
|
||||
DisableDownloadTimeout: false,
|
||||
Repos: []pacmanconf.Repository{
|
||||
{Name: "repo1", Servers: []string{"repo1"}, SigLevel: []string(nil), Usage: []string{"All"}},
|
||||
{Name: "repo2", Servers: []string{"repo2"}, SigLevel: []string(nil), Usage: []string{"All"}},
|
||||
},
|
||||
}
|
||||
|
||||
pacmanConf, color, err := RetrievePacmanConfig(parser.MakeArguments(), "../../testdata/pacman.conf")
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, pacmanConf)
|
||||
assert.Equal(t, color, false)
|
||||
assert.EqualValues(t, expectedPacmanConf, pacmanConf)
|
||||
}
|
@ -25,7 +25,7 @@ func (o *Option) Add(args ...string) {
|
||||
}
|
||||
|
||||
func (o *Option) First() string {
|
||||
if len(o.Args) == 0 {
|
||||
if o.Args == nil || len(o.Args) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
@ -372,15 +372,16 @@ func isArg(arg string) bool {
|
||||
case "y", "refresh":
|
||||
case "x", "regex":
|
||||
case "machinereadable":
|
||||
case "disable-sandbox":
|
||||
// yay options
|
||||
case "aururl":
|
||||
case "aurrpcurl":
|
||||
case "save":
|
||||
case "afterclean", "cleanafter":
|
||||
case "keepsrc":
|
||||
case "noafterclean", "nocleanafter":
|
||||
case "devel":
|
||||
case "nodevel":
|
||||
case "timeupdate":
|
||||
case "notimeupdate":
|
||||
case "topdown":
|
||||
case "bottomup":
|
||||
case "completioninterval":
|
||||
@ -394,6 +395,7 @@ func isArg(arg string) bool {
|
||||
case "rebuildtree":
|
||||
case "norebuild":
|
||||
case "batchinstall":
|
||||
case "nobatchinstall":
|
||||
case "answerclean":
|
||||
case "noanswerclean":
|
||||
case "answerdiff":
|
||||
@ -418,15 +420,23 @@ func isArg(arg string) bool {
|
||||
case "sudoflags":
|
||||
case "requestsplitn":
|
||||
case "sudoloop":
|
||||
case "nosudoloop":
|
||||
case "provides":
|
||||
case "noprovides":
|
||||
case "pgpfetch":
|
||||
case "nopgpfetch":
|
||||
case "cleanmenu":
|
||||
case "nocleanmenu":
|
||||
case "diffmenu":
|
||||
case "nodiffmenu":
|
||||
case "editmenu":
|
||||
case "noeditmenu":
|
||||
case "useask":
|
||||
case "nouseask":
|
||||
case "combinedupgrade":
|
||||
case "nocombinedupgrade":
|
||||
case "a", "aur":
|
||||
case "N", "repo":
|
||||
case "repo":
|
||||
case "removemake":
|
||||
case "noremovemake":
|
||||
case "askremovemake":
|
||||
@ -439,7 +449,7 @@ func isArg(arg string) bool {
|
||||
case "defaultconfig":
|
||||
case "singlelineresults":
|
||||
case "doublelineresults":
|
||||
case "separatesources":
|
||||
case "separatesources", "noseparatesources":
|
||||
default:
|
||||
return false
|
||||
}
|
||||
@ -565,6 +575,7 @@ func (a *Arguments) parseShortOption(arg, param string) (usedNext bool, err erro
|
||||
break
|
||||
} else {
|
||||
err = a.AddArg(char)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package runtime
|
||||
package settings
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -9,8 +9,8 @@ import (
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db"
|
||||
"github.com/Jguer/yay/v12/pkg/query"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
@ -21,12 +21,9 @@ import (
|
||||
"github.com/Jguer/aur/rpc"
|
||||
"github.com/Jguer/votar/pkg/vote"
|
||||
"github.com/Morganamilo/go-pacmanconf"
|
||||
|
||||
"golang.org/x/net/proxy"
|
||||
)
|
||||
|
||||
type Runtime struct {
|
||||
Cfg *settings.Configuration
|
||||
QueryBuilder query.Builder
|
||||
PacmanConf *pacmanconf.Config
|
||||
VCSStore vcs.Store
|
||||
@ -34,27 +31,18 @@ type Runtime struct {
|
||||
HTTPClient *http.Client
|
||||
VoteClient *vote.Client
|
||||
AURClient aur.QueryClient
|
||||
DBExecutor db.Executor
|
||||
Logger *text.Logger
|
||||
}
|
||||
|
||||
func NewRuntime(cfg *settings.Configuration, cmdArgs *parser.Arguments, version string) (*Runtime, error) {
|
||||
func BuildRuntime(cfg *Configuration, cmdArgs *parser.Arguments, version string) (*Runtime, error) {
|
||||
logger := text.NewLogger(os.Stdout, os.Stderr, os.Stdin, cfg.Debug, "runtime")
|
||||
runner := exe.NewOSRunner(logger.Child("runner"))
|
||||
|
||||
transport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
if socks5_proxy := os.Getenv("SOCKS5_PROXY"); socks5_proxy != "" {
|
||||
dialer, err := proxy.SOCKS5("tcp", socks5_proxy, nil, proxy.Direct)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
transport = &http.Transport{Dial: dialer.Dial}
|
||||
}
|
||||
cmdBuilder := cfg.CmdBuilder(nil)
|
||||
|
||||
httpClient := &http.Client{
|
||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||
return http.ErrUseLastResponse
|
||||
},
|
||||
Transport: transport,
|
||||
}
|
||||
|
||||
userAgent := fmt.Sprintf("Yay/%s", version)
|
||||
@ -98,16 +86,6 @@ func NewRuntime(cfg *settings.Configuration, cmdArgs *parser.Arguments, version
|
||||
aurCache = aurClient
|
||||
}
|
||||
|
||||
pacmanConf, useColor, err := retrievePacmanConfig(cmdArgs, cfg.PacmanConf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// FIXME: get rid of global
|
||||
text.UseColor = useColor
|
||||
|
||||
cmdBuilder := exe.NewCmdBuilder(cfg, runner, logger.Child("cmdbuilder"), pacmanConf.DBPath)
|
||||
|
||||
vcsStore := vcs.NewInfoStore(
|
||||
cfg.VCSFilePath, cmdBuilder,
|
||||
logger.Child("vcs"))
|
||||
@ -116,23 +94,17 @@ func NewRuntime(cfg *settings.Configuration, cmdArgs *parser.Arguments, version
|
||||
return nil, err
|
||||
}
|
||||
|
||||
queryBuilder := query.NewSourceQueryBuilder(
|
||||
aurClient,
|
||||
logger.Child("mixed.querybuilder"), cfg.SortBy,
|
||||
cfg.Mode, cfg.SearchBy,
|
||||
cfg.BottomUp, cfg.SingleLineResults, cfg.SeparateSources)
|
||||
|
||||
run := &Runtime{
|
||||
Cfg: cfg,
|
||||
QueryBuilder: queryBuilder,
|
||||
PacmanConf: pacmanConf,
|
||||
runtime := &Runtime{
|
||||
QueryBuilder: nil,
|
||||
PacmanConf: nil,
|
||||
VCSStore: vcsStore,
|
||||
CmdBuilder: cmdBuilder,
|
||||
HTTPClient: &http.Client{},
|
||||
VoteClient: voteClient,
|
||||
AURClient: aurCache,
|
||||
Logger: logger,
|
||||
DBExecutor: nil,
|
||||
Logger: text.NewLogger(os.Stdout, os.Stderr, os.Stdin, cfg.Debug, "runtime"),
|
||||
}
|
||||
|
||||
return run, nil
|
||||
return runtime, nil
|
||||
}
|
@ -1,27 +1,20 @@
|
||||
//go:build !integration
|
||||
// +build !integration
|
||||
|
||||
package runtime_test
|
||||
package settings_test
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func TestBuildRuntime(t *testing.T) {
|
||||
t.Parallel()
|
||||
path := "../../testdata/pacman.conf"
|
||||
|
||||
absPath, err := filepath.Abs(path)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Prepare test inputs
|
||||
cfg := &settings.Configuration{
|
||||
Debug: true,
|
||||
@ -30,23 +23,24 @@ func TestBuildRuntime(t *testing.T) {
|
||||
AURRPCURL: "https://aur.archlinux.org/rpc",
|
||||
BuildDir: "/tmp",
|
||||
VCSFilePath: "",
|
||||
PacmanConf: absPath,
|
||||
Runtime: &settings.Runtime{Logger: text.NewLogger(nil, nil, nil, false, "")},
|
||||
}
|
||||
cmdArgs := parser.MakeArguments()
|
||||
version := "1.0.0"
|
||||
|
||||
// Call the function being tested
|
||||
run, err := runtime.NewRuntime(cfg, cmdArgs, version)
|
||||
require.NoError(t, err)
|
||||
runtime, err := settings.BuildRuntime(cfg, cmdArgs, version)
|
||||
|
||||
// Assert the function's output
|
||||
assert.NotNil(t, run)
|
||||
assert.NotNil(t, run.QueryBuilder)
|
||||
assert.NotNil(t, run.PacmanConf)
|
||||
assert.NotNil(t, run.VCSStore)
|
||||
assert.NotNil(t, run.CmdBuilder)
|
||||
assert.NotNil(t, run.HTTPClient)
|
||||
assert.NotNil(t, run.VoteClient)
|
||||
assert.NotNil(t, run.AURClient)
|
||||
assert.NotNil(t, run.Logger)
|
||||
assert.NotNil(t, runtime)
|
||||
assert.Nil(t, err)
|
||||
assert.Nil(t, runtime.QueryBuilder)
|
||||
assert.Nil(t, runtime.PacmanConf)
|
||||
assert.NotNil(t, runtime.VCSStore)
|
||||
assert.NotNil(t, runtime.CmdBuilder)
|
||||
assert.NotNil(t, runtime.HTTPClient)
|
||||
assert.NotNil(t, runtime.VoteClient)
|
||||
assert.NotNil(t, runtime.AURClient)
|
||||
assert.Nil(t, runtime.DBExecutor)
|
||||
assert.NotNil(t, runtime.Logger)
|
||||
}
|
@ -11,28 +11,28 @@ import (
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db"
|
||||
"github.com/Jguer/yay/v12/pkg/dep"
|
||||
"github.com/Jguer/yay/v12/pkg/pgp"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/sync/srcinfo/pgp"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
"github.com/Jguer/yay/v12/pkg/vcs"
|
||||
)
|
||||
|
||||
// TODO: add tests
|
||||
type Service struct {
|
||||
dbExecutor db.Executor
|
||||
cfg *settings.Configuration
|
||||
cmdBuilder pgp.GPGCmdBuilder
|
||||
cmdBuilder exe.ICmdBuilder
|
||||
vcsStore vcs.Store
|
||||
log *text.Logger
|
||||
|
||||
pkgBuildDirs map[string]string
|
||||
srcInfos map[string]*gosrc.Srcinfo
|
||||
}
|
||||
|
||||
func NewService(dbExecutor db.Executor, cfg *settings.Configuration, logger *text.Logger,
|
||||
func NewService(dbExecutor db.Executor, cfg *settings.Configuration,
|
||||
cmdBuilder exe.ICmdBuilder, vcsStore vcs.Store, pkgBuildDirs map[string]string,
|
||||
) (*Service, error) {
|
||||
srcinfos, err := ParseSrcinfoFilesByBase(logger, pkgBuildDirs, true)
|
||||
srcinfos, err := ParseSrcinfoFilesByBase(pkgBuildDirs, true)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -43,7 +43,6 @@ func NewService(dbExecutor db.Executor, cfg *settings.Configuration, logger *tex
|
||||
vcsStore: vcsStore,
|
||||
pkgBuildDirs: pkgBuildDirs,
|
||||
srcInfos: srcinfos,
|
||||
log: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -69,7 +68,7 @@ nextpkg:
|
||||
}
|
||||
|
||||
func (s *Service) CheckPGPKeys(ctx context.Context) error {
|
||||
_, errCPK := pgp.CheckPgpKeys(ctx, s.log.Child("pgp"), s.pkgBuildDirs, s.srcInfos, s.cmdBuilder, settings.NoConfirm)
|
||||
_, errCPK := pgp.CheckPgpKeys(ctx, s.pkgBuildDirs, s.srcInfos, s.cmdBuilder, settings.NoConfirm)
|
||||
return errCPK
|
||||
}
|
||||
|
||||
@ -84,15 +83,15 @@ func (s *Service) UpdateVCSStore(ctx context.Context, targets []map[string]*dep.
|
||||
for i := range srcinfo.Packages {
|
||||
for j := range targets {
|
||||
if _, ok := targets[j][srcinfo.Packages[i].Pkgname]; !ok {
|
||||
s.log.Debugln("skipping VCS update for", srcinfo.Packages[i].Pkgname, "not in targets")
|
||||
text.Debugln("skipping VCS update for", srcinfo.Packages[i].Pkgname, "not in targets")
|
||||
continue
|
||||
}
|
||||
if _, ok := ignore[srcinfo.Packages[i].Pkgname]; ok {
|
||||
s.log.Debugln("skipping VCS update for", srcinfo.Packages[i].Pkgname, "due to install error")
|
||||
text.Debugln("skipping VCS update for", srcinfo.Packages[i].Pkgname, "due to install error")
|
||||
continue
|
||||
}
|
||||
|
||||
s.log.Debugln("checking VCS entry for", srcinfo.Packages[i].Pkgname, fmt.Sprintf("source: %v", srcinfo.Source))
|
||||
text.Debugln("checking VCS entry for", srcinfo.Packages[i].Pkgname, fmt.Sprintf("source: %v", srcinfo.Source))
|
||||
s.vcsStore.Update(ctx, srcinfo.Packages[i].Pkgname, srcinfo.Source)
|
||||
}
|
||||
}
|
||||
@ -101,17 +100,17 @@ func (s *Service) UpdateVCSStore(ctx context.Context, targets []map[string]*dep.
|
||||
return nil
|
||||
}
|
||||
|
||||
func ParseSrcinfoFilesByBase(logger *text.Logger, pkgBuildDirs map[string]string, errIsFatal bool) (map[string]*gosrc.Srcinfo, error) {
|
||||
func ParseSrcinfoFilesByBase(pkgBuildDirs map[string]string, errIsFatal bool) (map[string]*gosrc.Srcinfo, error) {
|
||||
srcinfos := make(map[string]*gosrc.Srcinfo)
|
||||
|
||||
k := 0
|
||||
for base, dir := range pkgBuildDirs {
|
||||
logger.OperationInfoln(gotext.Get("(%d/%d) Parsing SRCINFO: %s", k+1, len(pkgBuildDirs), text.Cyan(base)))
|
||||
text.OperationInfoln(gotext.Get("(%d/%d) Parsing SRCINFO: %s", k+1, len(pkgBuildDirs), text.Cyan(base)))
|
||||
|
||||
pkgbuild, err := gosrc.ParseFile(filepath.Join(dir, ".SRCINFO"))
|
||||
if err != nil {
|
||||
if !errIsFatal {
|
||||
logger.Warnln(gotext.Get("failed to parse %s -- skipping: %s", base, err))
|
||||
text.Warnln(gotext.Get("failed to parse %s -- skipping: %s", base, err))
|
||||
continue
|
||||
}
|
||||
|
@ -1,67 +0,0 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
)
|
||||
|
||||
var ErrInstallRepoPkgs = errors.New(gotext.Get("error installing repo packages"))
|
||||
|
||||
type FailedIgnoredPkgError struct {
|
||||
pkgErrors map[string]error
|
||||
}
|
||||
|
||||
func (e *FailedIgnoredPkgError) Error() string {
|
||||
var sb strings.Builder
|
||||
sb.WriteString(gotext.Get("Failed to install the following packages. Manual intervention is required:"))
|
||||
|
||||
for pkg, err := range e.pkgErrors {
|
||||
sb.WriteString("\n")
|
||||
sb.WriteString(pkg)
|
||||
sb.WriteString(" - ")
|
||||
sb.WriteString(err.Error())
|
||||
}
|
||||
|
||||
return sb.String()
|
||||
}
|
||||
|
||||
type PkgDestNotInListError struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func (e *PkgDestNotInListError) Error() string {
|
||||
return gotext.Get("could not find PKGDEST for: %s", e.name)
|
||||
}
|
||||
|
||||
type FindPkgDestError struct {
|
||||
name, pkgDest string
|
||||
}
|
||||
|
||||
func (e *FindPkgDestError) Error() string {
|
||||
return gotext.Get(
|
||||
"the PKGDEST for %s is listed by makepkg but does not exist: %s",
|
||||
e.name, e.pkgDest)
|
||||
}
|
||||
|
||||
type SetPkgReasonError struct {
|
||||
exp bool // explicit
|
||||
}
|
||||
|
||||
func (e *SetPkgReasonError) Error() string {
|
||||
reason := gotext.Get("explicit")
|
||||
if !e.exp {
|
||||
reason = gotext.Get("dependency")
|
||||
}
|
||||
|
||||
return gotext.Get("error updating package install reason to %s", reason)
|
||||
}
|
||||
|
||||
type NoPkgDestsFoundError struct {
|
||||
dir string
|
||||
}
|
||||
|
||||
func (e *NoPkgDestsFoundError) Error() string {
|
||||
return gotext.Get("could not find any package archives listed in %s", e.dir)
|
||||
}
|
@ -1,167 +0,0 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
)
|
||||
|
||||
func TestParsePackageList(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
type testCase struct {
|
||||
desc string
|
||||
mockStdout string
|
||||
mockStderr string
|
||||
mockErr error
|
||||
wantPkgDests map[string]string
|
||||
wantPkgVersion string
|
||||
wantErr bool
|
||||
wantErrText string // Optional: specific error text to check
|
||||
}
|
||||
|
||||
testCases := []testCase{
|
||||
{
|
||||
desc: "Standard package",
|
||||
mockStdout: "/path/to/package-1.2.3-4-x86_64.pkg.tar.zst\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"package": "/path/to/package-1.2.3-4-x86_64.pkg.tar.zst",
|
||||
},
|
||||
wantPkgVersion: "1.2.3-4",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
desc: "Package with dash in name",
|
||||
mockStdout: "/path/to/package-name-with-dash-1.0.0-1-any.pkg.tar.gz\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"package-name-with-dash": "/path/to/package-name-with-dash-1.0.0-1-any.pkg.tar.gz",
|
||||
},
|
||||
wantPkgVersion: "1.0.0-1",
|
||||
wantErr: false, // This should fail with current logic but pass with regex
|
||||
},
|
||||
{
|
||||
desc: "Multiple packages",
|
||||
mockStdout: "/path/to/pkg1-1.0-1-x86_64.pkg.tar.zst\n/other/path/pkg2-2.5-3-any.pkg.tar.xz\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"pkg1": "/path/to/pkg1-1.0-1-x86_64.pkg.tar.zst",
|
||||
"pkg2": "/other/path/pkg2-2.5-3-any.pkg.tar.xz",
|
||||
},
|
||||
wantPkgVersion: "2.5-3", // Version of the last package processed
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
desc: "Empty input",
|
||||
mockStdout: "",
|
||||
wantErr: true, // Expect NoPkgDestsFoundError
|
||||
},
|
||||
{
|
||||
desc: "Input with only newline",
|
||||
mockStdout: "\n",
|
||||
wantErr: true, // Expect NoPkgDestsFoundError
|
||||
},
|
||||
{
|
||||
desc: "Makepkg error",
|
||||
mockStderr: "makepkg failed",
|
||||
mockErr: fmt.Errorf("exit status 1"),
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
desc: "Malformed filename (too few dashes)",
|
||||
mockStdout: "/path/to/malformed-package.pkg.tar.zst\n",
|
||||
wantErr: true, // Expect "cannot find package name" error
|
||||
},
|
||||
{
|
||||
desc: "Package with epoch",
|
||||
mockStdout: "/path/to/epochpkg-1:2.0.0-1-x86_64.pkg.tar.zst\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"epochpkg": "/path/to/epochpkg-1:2.0.0-1-x86_64.pkg.tar.zst",
|
||||
},
|
||||
wantPkgVersion: "1:2.0.0-1",
|
||||
wantErr: false, // This might fail with current logic
|
||||
},
|
||||
{
|
||||
desc: "Package with .zst extension",
|
||||
mockStdout: "/path/to/zstdpkg-3.3-1-any.pkg.tar.zst\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"zstdpkg": "/path/to/zstdpkg-3.3-1-any.pkg.tar.zst",
|
||||
},
|
||||
wantPkgVersion: "3.3-1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
desc: "Package with .gz extension",
|
||||
mockStdout: "/path/to/gzpkg-3.3-1-any.pkg.tar.gz\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"gzpkg": "/path/to/gzpkg-3.3-1-any.pkg.tar.gz",
|
||||
},
|
||||
wantPkgVersion: "3.3-1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
desc: "Package with .xz extension",
|
||||
mockStdout: "/path/to/xzpkg-3.3-1-any.pkg.tar.xz\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"xzpkg": "/path/to/xzpkg-3.3-1-any.pkg.tar.xz",
|
||||
},
|
||||
wantPkgVersion: "3.3-1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
desc: "Package with .bz2 extension",
|
||||
mockStdout: "/path/to/bz2pkg-3.3-1-any.pkg.tar.bz2\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"bz2pkg": "/path/to/bz2pkg-3.3-1-any.pkg.tar.bz2",
|
||||
},
|
||||
wantPkgVersion: "3.3-1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
desc: "Package with .tar extension (uncompressed)",
|
||||
mockStdout: "/path/to/tarpkg-3.3-1-any.pkg.tar\n",
|
||||
wantPkgDests: map[string]string{
|
||||
"tarpkg": "/path/to/tarpkg-3.3-1-any.pkg.tar",
|
||||
},
|
||||
wantPkgVersion: "3.3-1",
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc // capture range variable
|
||||
t.Run(tc.desc, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
mockRunner := &exe.MockRunner{
|
||||
CaptureFn: func(cmd *exec.Cmd) (string, string, error) {
|
||||
// Basic check to ensure the command looks right
|
||||
require.Contains(t, cmd.String(), "--packagelist")
|
||||
return tc.mockStdout, tc.mockStderr, tc.mockErr
|
||||
},
|
||||
}
|
||||
cmdBuilder := &exe.CmdBuilder{Runner: mockRunner} // Simplified for this test
|
||||
|
||||
pkgdests, pkgVersion, err := parsePackageList(context.Background(), cmdBuilder, "/fake/dir")
|
||||
|
||||
if tc.wantErr {
|
||||
assert.Error(t, err)
|
||||
if tc.wantErrText != "" {
|
||||
assert.Contains(t, err.Error(), tc.wantErrText)
|
||||
}
|
||||
// Check for specific error types if needed
|
||||
if tc.desc == "Empty input" || tc.desc == "Input with only newline" {
|
||||
assert.IsType(t, &NoPkgDestsFoundError{}, err)
|
||||
}
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, tc.wantPkgDests, pkgdests)
|
||||
assert.Equal(t, tc.wantPkgVersion, pkgVersion)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
package srcinfo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
gosrc "github.com/Morganamilo/go-srcinfo"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db/mock"
|
||||
"github.com/Jguer/yay/v12/pkg/dep"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
"github.com/Jguer/yay/v12/pkg/vcs"
|
||||
)
|
||||
|
||||
func newTestLogger() *text.Logger {
|
||||
return text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), true, "test")
|
||||
}
|
||||
|
||||
func TestNewService(t *testing.T) {
|
||||
dbExecutor := &mock.DBExecutor{}
|
||||
cfg := &settings.Configuration{}
|
||||
cmdBuilder := &exe.MockBuilder{}
|
||||
vcsStore := &vcs.Mock{}
|
||||
pkgBuildDirs := map[string]string{
|
||||
"jellyfin": "../../../testdata/jfin",
|
||||
"cephbin": "../../../testdata/cephbin",
|
||||
}
|
||||
|
||||
srv, err := NewService(dbExecutor, cfg, newTestLogger(), cmdBuilder, vcsStore, pkgBuildDirs)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, srv)
|
||||
assert.Equal(t, dbExecutor, srv.dbExecutor)
|
||||
assert.Equal(t, cfg, srv.cfg)
|
||||
assert.Equal(t, cmdBuilder, srv.cmdBuilder)
|
||||
assert.Equal(t, vcsStore, srv.vcsStore)
|
||||
assert.Equal(t, pkgBuildDirs, srv.pkgBuildDirs)
|
||||
assert.NotNil(t, srv.srcInfos)
|
||||
}
|
||||
|
||||
func TestService_IncompatiblePkgs(t *testing.T) {
|
||||
srv := &Service{
|
||||
dbExecutor: &mock.DBExecutor{AlpmArchitecturesFn: func() ([]string, error) {
|
||||
return []string{"x86_64"}, nil
|
||||
}},
|
||||
srcInfos: map[string]*gosrc.Srcinfo{
|
||||
"pkg1": {
|
||||
Package: gosrc.Package{
|
||||
Arch: []string{"x86_64", "any"},
|
||||
},
|
||||
},
|
||||
"pkg2": {
|
||||
Package: gosrc.Package{
|
||||
Arch: []string{"any"},
|
||||
},
|
||||
},
|
||||
"pkg3": {
|
||||
Package: gosrc.Package{
|
||||
Arch: []string{"armv7h"},
|
||||
},
|
||||
},
|
||||
"pkg4": {
|
||||
Package: gosrc.Package{
|
||||
Arch: []string{"i683", "x86_64"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
incompatible, err := srv.IncompatiblePkgs(context.Background())
|
||||
assert.NoError(t, err)
|
||||
assert.ElementsMatch(t, []string{"pkg3"}, incompatible)
|
||||
}
|
||||
|
||||
func TestService_CheckPGPKeys(t *testing.T) {
|
||||
srv := &Service{
|
||||
log: newTestLogger(),
|
||||
pkgBuildDirs: map[string]string{
|
||||
"pkg1": "/path/to/pkg1",
|
||||
"pkg2": "/path/to/pkg2",
|
||||
},
|
||||
srcInfos: map[string]*gosrc.Srcinfo{
|
||||
"pkg1": {
|
||||
Packages: []gosrc.Package{
|
||||
{Pkgname: "pkg1"},
|
||||
},
|
||||
},
|
||||
"pkg2": {
|
||||
Packages: []gosrc.Package{
|
||||
{Pkgname: "pkg2"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
err := srv.CheckPGPKeys(context.Background())
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestService_UpdateVCSStore(t *testing.T) {
|
||||
srv := &Service{
|
||||
srcInfos: map[string]*gosrc.Srcinfo{
|
||||
"pkg1": {
|
||||
Packages: []gosrc.Package{
|
||||
{Pkgname: "pkg1"},
|
||||
},
|
||||
},
|
||||
"pkg2": {
|
||||
Packages: []gosrc.Package{
|
||||
{Pkgname: "pkg2"},
|
||||
},
|
||||
},
|
||||
},
|
||||
vcsStore: &vcs.Mock{},
|
||||
}
|
||||
|
||||
targets := []map[string]*dep.InstallInfo{
|
||||
{
|
||||
"pkg1": {},
|
||||
"pkg2": {},
|
||||
},
|
||||
}
|
||||
ignore := map[string]error{}
|
||||
|
||||
err := srv.UpdateVCSStore(context.Background(), targets, ignore)
|
||||
assert.NoError(t, err)
|
||||
}
|
138
pkg/sync/sync.go
138
pkg/sync/sync.go
@ -1,138 +0,0 @@
|
||||
package sync
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/completion"
|
||||
"github.com/Jguer/yay/v12/pkg/db"
|
||||
"github.com/Jguer/yay/v12/pkg/dep"
|
||||
"github.com/Jguer/yay/v12/pkg/multierror"
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/sync/build"
|
||||
"github.com/Jguer/yay/v12/pkg/sync/srcinfo"
|
||||
"github.com/Jguer/yay/v12/pkg/sync/workdir"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
)
|
||||
|
||||
type OperationService struct {
|
||||
ctx context.Context
|
||||
cfg *settings.Configuration
|
||||
dbExecutor db.Executor
|
||||
logger *text.Logger
|
||||
}
|
||||
|
||||
func NewOperationService(ctx context.Context,
|
||||
dbExecutor db.Executor,
|
||||
run *runtime.Runtime,
|
||||
) *OperationService {
|
||||
return &OperationService{
|
||||
ctx: ctx,
|
||||
cfg: run.Cfg,
|
||||
dbExecutor: dbExecutor,
|
||||
logger: run.Logger.Child("operation"),
|
||||
}
|
||||
}
|
||||
|
||||
func (o *OperationService) Run(ctx context.Context, run *runtime.Runtime,
|
||||
cmdArgs *parser.Arguments,
|
||||
targets []map[string]*dep.InstallInfo, excluded []string,
|
||||
) error {
|
||||
if len(targets) == 0 {
|
||||
o.logger.Println("", gotext.Get("there is nothing to do"))
|
||||
return nil
|
||||
}
|
||||
preparer := workdir.NewPreparer(o.dbExecutor, run.CmdBuilder, o.cfg, o.logger.Child("workdir"))
|
||||
installer := build.NewInstaller(o.dbExecutor, run.CmdBuilder,
|
||||
run.VCSStore, o.cfg.Mode, o.cfg.ReBuild,
|
||||
cmdArgs.ExistsArg("w", "downloadonly"), run.Logger.Child("installer"))
|
||||
|
||||
pkgBuildDirs, errInstall := preparer.Run(ctx, run, targets)
|
||||
if errInstall != nil {
|
||||
return errInstall
|
||||
}
|
||||
|
||||
if cleanFunc := preparer.ShouldCleanMakeDeps(run, cmdArgs); cleanFunc != nil {
|
||||
installer.AddPostInstallHook(cleanFunc)
|
||||
}
|
||||
|
||||
if cleanAURDirsFunc := preparer.ShouldCleanAURDirs(run, pkgBuildDirs); cleanAURDirsFunc != nil {
|
||||
installer.AddPostInstallHook(cleanAURDirsFunc)
|
||||
}
|
||||
|
||||
go func() {
|
||||
errComp := completion.Update(ctx, run.HTTPClient, o.dbExecutor,
|
||||
o.cfg.AURURL, o.cfg.CompletionPath, o.cfg.CompletionInterval, false)
|
||||
if errComp != nil {
|
||||
o.logger.Warnln(errComp)
|
||||
}
|
||||
}()
|
||||
|
||||
srcInfo, errInstall := srcinfo.NewService(o.dbExecutor, o.cfg,
|
||||
o.logger.Child("srcinfo"), run.CmdBuilder, run.VCSStore, pkgBuildDirs)
|
||||
if errInstall != nil {
|
||||
return errInstall
|
||||
}
|
||||
|
||||
incompatible, errInstall := srcInfo.IncompatiblePkgs(ctx)
|
||||
if errInstall != nil {
|
||||
return errInstall
|
||||
}
|
||||
|
||||
if errIncompatible := confirmIncompatible(o.logger, incompatible); errIncompatible != nil {
|
||||
return errIncompatible
|
||||
}
|
||||
|
||||
if errPGP := srcInfo.CheckPGPKeys(ctx); errPGP != nil {
|
||||
return errPGP
|
||||
}
|
||||
|
||||
if errInstall := installer.Install(ctx, cmdArgs, targets, pkgBuildDirs,
|
||||
excluded, o.manualConfirmRequired(cmdArgs)); errInstall != nil {
|
||||
return errInstall
|
||||
}
|
||||
|
||||
var multiErr multierror.MultiError
|
||||
|
||||
failedAndIgnored, err := installer.CompileFailedAndIgnored()
|
||||
if err != nil {
|
||||
multiErr.Add(err)
|
||||
}
|
||||
|
||||
if !cmdArgs.ExistsArg("w", "downloadonly") {
|
||||
if err := srcInfo.UpdateVCSStore(ctx, targets, failedAndIgnored); err != nil {
|
||||
o.logger.Warnln(err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := installer.RunPostInstallHooks(ctx); err != nil {
|
||||
multiErr.Add(err)
|
||||
}
|
||||
|
||||
return multiErr.Return()
|
||||
}
|
||||
|
||||
func (o *OperationService) manualConfirmRequired(cmdArgs *parser.Arguments) bool {
|
||||
return (!cmdArgs.ExistsArg("u", "sysupgrade") && cmdArgs.Op != "Y") || o.cfg.DoubleConfirm
|
||||
}
|
||||
|
||||
func confirmIncompatible(logger *text.Logger, incompatible []string) error {
|
||||
if len(incompatible) > 0 {
|
||||
logger.Warnln(gotext.Get("The following packages are not compatible with your architecture:"))
|
||||
|
||||
for _, pkg := range incompatible {
|
||||
logger.Print(" " + text.Cyan(pkg))
|
||||
}
|
||||
|
||||
logger.Println()
|
||||
|
||||
if !logger.ContinueTask(gotext.Get("Try to build them anyway?"), true, settings.NoConfirm) {
|
||||
return &settings.ErrUserAbort{}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
package workdir
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/runtime"
|
||||
"github.com/Jguer/yay/v12/pkg/settings"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
"github.com/Jguer/yay/v12/pkg/settings/parser"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func removeMake(ctx context.Context, config *settings.Configuration,
|
||||
cmdBuilder exe.ICmdBuilder, makeDeps []string, cmdArgs *parser.Arguments,
|
||||
) error {
|
||||
removeArguments := cmdArgs.CopyGlobal()
|
||||
|
||||
err := removeArguments.AddArg("R", "s", "u")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, pkg := range makeDeps {
|
||||
removeArguments.AddTarget(pkg)
|
||||
}
|
||||
|
||||
oldValue := settings.NoConfirm
|
||||
settings.NoConfirm = true
|
||||
err = cmdBuilder.Show(cmdBuilder.BuildPacmanCmd(ctx,
|
||||
removeArguments, config.Mode, settings.NoConfirm))
|
||||
settings.NoConfirm = oldValue
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func cleanAfter(ctx context.Context, run *runtime.Runtime,
|
||||
cmdBuilder exe.ICmdBuilder, pkgbuildDirs map[string]string,
|
||||
) {
|
||||
run.Logger.Println(gotext.Get("removing untracked AUR files from cache..."))
|
||||
|
||||
i := 0
|
||||
for _, dir := range pkgbuildDirs {
|
||||
run.Logger.OperationInfoln(gotext.Get("Cleaning (%d/%d): %s", i+1, len(pkgbuildDirs), text.Cyan(dir)))
|
||||
|
||||
_, stderr, err := cmdBuilder.Capture(
|
||||
cmdBuilder.BuildGitCmd(
|
||||
ctx, dir, "reset", "--hard", "HEAD"))
|
||||
if err != nil {
|
||||
run.Logger.Errorln(gotext.Get("error resetting %s: %s", dir, stderr))
|
||||
}
|
||||
|
||||
if err := run.CmdBuilder.Show(
|
||||
run.CmdBuilder.BuildGitCmd(
|
||||
ctx, dir, "clean", "-fx", "--exclude", "*.pkg.*")); err != nil {
|
||||
run.Logger.Errorln(err)
|
||||
}
|
||||
|
||||
i++
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package workdir
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/settings/exe"
|
||||
)
|
||||
|
||||
func gitMerge(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) error {
|
||||
_, stderr, err := cmdBuilder.Capture(
|
||||
cmdBuilder.BuildGitCmd(ctx,
|
||||
dir, "reset", "--hard", "HEAD"))
|
||||
if err != nil {
|
||||
return errors.New(gotext.Get("error resetting %s: %s", dir, stderr))
|
||||
}
|
||||
|
||||
_, stderr, err = cmdBuilder.Capture(
|
||||
cmdBuilder.BuildGitCmd(ctx,
|
||||
dir, "merge", "--no-edit", "--ff"))
|
||||
if err != nil {
|
||||
return errors.New(gotext.Get("error merging %s: %s", dir, stderr))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func mergePkgbuilds(ctx context.Context, cmdBuilder exe.ICmdBuilder, pkgbuildDirs map[string]string) error {
|
||||
for _, dir := range pkgbuildDirs {
|
||||
err := gitMerge(ctx, cmdBuilder, dir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
@ -3,18 +3,14 @@ package text
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
"io"
|
||||
)
|
||||
|
||||
func (l *Logger) GetInput(defaultValue string, noConfirm bool) (string, error) {
|
||||
l.Info()
|
||||
Info()
|
||||
|
||||
if defaultValue != "" || noConfirm {
|
||||
l.Println(defaultValue)
|
||||
fmt.Println(defaultValue)
|
||||
return defaultValue, nil
|
||||
}
|
||||
|
||||
@ -32,48 +28,6 @@ func (l *Logger) GetInput(defaultValue string, noConfirm bool) (string, error) {
|
||||
return string(buf), nil
|
||||
}
|
||||
|
||||
// ContinueTask prompts if user wants to continue task.
|
||||
// If NoConfirm is set the action will continue without user input.
|
||||
func (l *Logger) ContinueTask(s string, preset, noConfirm bool) bool {
|
||||
if noConfirm {
|
||||
return preset
|
||||
}
|
||||
|
||||
var (
|
||||
response string
|
||||
postFix string
|
||||
n string
|
||||
y string
|
||||
yes = gotext.Get("yes")
|
||||
no = gotext.Get("no")
|
||||
)
|
||||
|
||||
// Only use localized "y" and "n" if they are latin characters.
|
||||
if nRune, _ := utf8.DecodeRuneInString(no); unicode.Is(unicode.Latin, nRune) {
|
||||
n = string(nRune)
|
||||
} else {
|
||||
n = nDefault
|
||||
}
|
||||
|
||||
if yRune, _ := utf8.DecodeRuneInString(yes); unicode.Is(unicode.Latin, yRune) {
|
||||
y = string(yRune)
|
||||
} else {
|
||||
y = yDefault
|
||||
}
|
||||
|
||||
if preset { // If default behavior is true, use y as default.
|
||||
postFix = fmt.Sprintf(" [%s/%s] ", strings.ToUpper(y), n)
|
||||
} else { // If default behavior is anything else, use n as default.
|
||||
postFix = fmt.Sprintf(" [%s/%s] ", y, strings.ToUpper(n))
|
||||
}
|
||||
|
||||
l.OperationInfo(Bold(s), Bold(postFix))
|
||||
|
||||
if _, err := fmt.Fscanln(l.r, &response); err != nil {
|
||||
return preset
|
||||
}
|
||||
|
||||
return strings.EqualFold(response, yes) ||
|
||||
strings.EqualFold(response, y) ||
|
||||
(!strings.EqualFold(yDefault, n) && strings.EqualFold(response, yDefault))
|
||||
func GetInput(r io.Reader, defaultValue string, noConfirm bool) (string, error) {
|
||||
return GlobalLogger.GetInput(defaultValue, noConfirm)
|
||||
}
|
||||
|
139
pkg/text/print.go
Normal file
139
pkg/text/print.go
Normal file
@ -0,0 +1,139 @@
|
||||
package text
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unicode"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const (
|
||||
arrow = "==>"
|
||||
smallArrow = " ->"
|
||||
opSymbol = "::"
|
||||
)
|
||||
|
||||
var (
|
||||
cachedColumnCount = -1
|
||||
GlobalLogger = NewLogger(os.Stdout, os.Stderr, os.Stdin, false, "global")
|
||||
)
|
||||
|
||||
func Debugln(a ...interface{}) {
|
||||
GlobalLogger.Debugln(a...)
|
||||
}
|
||||
|
||||
func OperationInfoln(a ...interface{}) {
|
||||
GlobalLogger.OperationInfoln(a...)
|
||||
}
|
||||
|
||||
func OperationInfo(a ...interface{}) {
|
||||
GlobalLogger.OperationInfo(a...)
|
||||
}
|
||||
|
||||
func SprintOperationInfo(a ...interface{}) string {
|
||||
return GlobalLogger.SprintOperationInfo(a...)
|
||||
}
|
||||
|
||||
func Info(a ...interface{}) {
|
||||
GlobalLogger.Info(a...)
|
||||
}
|
||||
|
||||
func Infoln(a ...interface{}) {
|
||||
GlobalLogger.Infoln(a...)
|
||||
}
|
||||
|
||||
func SprintWarn(a ...interface{}) string {
|
||||
return GlobalLogger.SprintWarn(a...)
|
||||
}
|
||||
|
||||
func Warn(a ...interface{}) {
|
||||
GlobalLogger.Warn(a...)
|
||||
}
|
||||
|
||||
func Warnln(a ...interface{}) {
|
||||
GlobalLogger.Warnln(a...)
|
||||
}
|
||||
|
||||
func SprintError(a ...interface{}) string {
|
||||
return GlobalLogger.SprintError(a...)
|
||||
}
|
||||
|
||||
func Error(a ...interface{}) {
|
||||
GlobalLogger.Error(a...)
|
||||
}
|
||||
|
||||
func Errorln(a ...interface{}) {
|
||||
GlobalLogger.Errorln(a...)
|
||||
}
|
||||
|
||||
func getColumnCount() int {
|
||||
if cachedColumnCount > 0 {
|
||||
return cachedColumnCount
|
||||
}
|
||||
|
||||
if count, err := strconv.Atoi(os.Getenv("COLUMNS")); err == nil {
|
||||
cachedColumnCount = count
|
||||
return cachedColumnCount
|
||||
}
|
||||
|
||||
if ws, err := unix.IoctlGetWinsize(syscall.Stdout, unix.TIOCGWINSZ); err == nil {
|
||||
cachedColumnCount = int(ws.Col)
|
||||
return cachedColumnCount
|
||||
}
|
||||
|
||||
return 80
|
||||
}
|
||||
|
||||
func PrintInfoValue(key string, values ...string) {
|
||||
const (
|
||||
keyLength = 32
|
||||
delimCount = 2
|
||||
)
|
||||
|
||||
specialWordsCount := 0
|
||||
|
||||
for _, runeValue := range key {
|
||||
// CJK handling: the character 'ー' is Katakana
|
||||
// but if use unicode.Katakana, it will return false
|
||||
if unicode.IsOneOf([]*unicode.RangeTable{
|
||||
unicode.Han,
|
||||
unicode.Hiragana,
|
||||
unicode.Katakana,
|
||||
unicode.Hangul,
|
||||
}, runeValue) || runeValue == 'ー' {
|
||||
specialWordsCount++
|
||||
}
|
||||
}
|
||||
|
||||
keyTextCount := specialWordsCount - keyLength + delimCount
|
||||
str := fmt.Sprintf(Bold("%-*s: "), keyTextCount, key)
|
||||
|
||||
if len(values) == 0 || (len(values) == 1 && values[0] == "") {
|
||||
fmt.Fprintf(os.Stdout, "%s%s\n", str, gotext.Get("None"))
|
||||
return
|
||||
}
|
||||
|
||||
maxCols := getColumnCount()
|
||||
cols := keyLength + len(values[0])
|
||||
str += values[0]
|
||||
|
||||
for _, value := range values[1:] {
|
||||
if maxCols > keyLength && cols+len(value)+delimCount >= maxCols {
|
||||
cols = keyLength
|
||||
str += "\n" + strings.Repeat(" ", keyLength)
|
||||
} else if cols != keyLength {
|
||||
str += strings.Repeat(" ", delimCount)
|
||||
cols += delimCount
|
||||
}
|
||||
|
||||
str += value
|
||||
cols += len(value)
|
||||
}
|
||||
|
||||
fmt.Println(str)
|
||||
}
|
@ -5,12 +5,6 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
const (
|
||||
arrow = "==>"
|
||||
smallArrow = " ->"
|
||||
opSymbol = "::"
|
||||
)
|
||||
|
||||
type Logger struct {
|
||||
name string
|
||||
Debug bool
|
||||
|
@ -1,8 +1,13 @@
|
||||
package text
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -23,12 +28,12 @@ func SplitDBFromName(pkg string) (db, name string) {
|
||||
|
||||
// LessRunes compares two rune values, and returns true if the first argument is lexicographicaly smaller.
|
||||
func LessRunes(iRunes, jRunes []rune) bool {
|
||||
maxLen := len(iRunes)
|
||||
if maxLen > len(jRunes) {
|
||||
maxLen = len(jRunes)
|
||||
max := len(iRunes)
|
||||
if max > len(jRunes) {
|
||||
max = len(jRunes)
|
||||
}
|
||||
|
||||
for idx := 0; idx < maxLen; idx++ {
|
||||
for idx := 0; idx < max; idx++ {
|
||||
ir := iRunes[idx]
|
||||
jr := jRunes[idx]
|
||||
|
||||
@ -47,3 +52,49 @@ func LessRunes(iRunes, jRunes []rune) bool {
|
||||
|
||||
return len(iRunes) < len(jRunes)
|
||||
}
|
||||
|
||||
// ContinueTask prompts if user wants to continue task.
|
||||
// If NoConfirm is set the action will continue without user input.
|
||||
func ContinueTask(input io.Reader, s string, preset, noConfirm bool) bool {
|
||||
if noConfirm {
|
||||
return preset
|
||||
}
|
||||
|
||||
var (
|
||||
response string
|
||||
postFix string
|
||||
n string
|
||||
y string
|
||||
yes = gotext.Get("yes")
|
||||
no = gotext.Get("no")
|
||||
)
|
||||
|
||||
// Only use localized "y" and "n" if they are latin characters.
|
||||
if nRune, _ := utf8.DecodeRuneInString(no); unicode.Is(unicode.Latin, nRune) {
|
||||
n = string(nRune)
|
||||
} else {
|
||||
n = nDefault
|
||||
}
|
||||
|
||||
if yRune, _ := utf8.DecodeRuneInString(yes); unicode.Is(unicode.Latin, yRune) {
|
||||
y = string(yRune)
|
||||
} else {
|
||||
y = yDefault
|
||||
}
|
||||
|
||||
if preset { // If default behavior is true, use y as default.
|
||||
postFix = fmt.Sprintf(" [%s/%s] ", strings.ToUpper(y), n)
|
||||
} else { // If default behavior is anything else, use n as default.
|
||||
postFix = fmt.Sprintf(" [%s/%s] ", y, strings.ToUpper(n))
|
||||
}
|
||||
|
||||
OperationInfo(Bold(s), Bold(postFix))
|
||||
|
||||
if _, err := fmt.Fscanln(input, &response); err != nil {
|
||||
return preset
|
||||
}
|
||||
|
||||
return strings.EqualFold(response, yes) ||
|
||||
strings.EqualFold(response, y) ||
|
||||
(!strings.EqualFold(yDefault, n) && strings.EqualFold(response, yDefault))
|
||||
}
|
||||
|
@ -4,7 +4,6 @@
|
||||
package text
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
@ -75,8 +74,7 @@ func TestContinueTask(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
// create io.Reader with value of input
|
||||
in := strings.NewReader(tt.args.input)
|
||||
logger := NewLogger(io.Discard, io.Discard, in, false, "test")
|
||||
got := logger.ContinueTask(tt.args.s, tt.args.preset, tt.args.noConfirm)
|
||||
got := ContinueTask(in, tt.args.s, tt.args.preset, tt.args.noConfirm)
|
||||
require.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
@ -122,8 +120,7 @@ msgstr "да"
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
in := strings.NewReader(tt.args.input)
|
||||
logger := NewLogger(io.Discard, io.Discard, in, false, "test")
|
||||
got := logger.ContinueTask(tt.args.s, tt.args.preset, tt.args.noConfirm)
|
||||
got := ContinueTask(in, tt.args.s, tt.args.preset, tt.args.noConfirm)
|
||||
require.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
@ -171,8 +168,7 @@ msgstr "ja"
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
in := strings.NewReader(tt.args.input)
|
||||
logger := NewLogger(io.Discard, io.Discard, in, false, "test")
|
||||
got := logger.ContinueTask(tt.args.s, tt.args.preset, tt.args.noConfirm)
|
||||
got := ContinueTask(in, tt.args.s, tt.args.preset, tt.args.noConfirm)
|
||||
require.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package upgrade
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
@ -194,15 +195,14 @@ func (u *UpgradeService) graphToUpSlice(graph *topo.Graph[string, *dep.InstallIn
|
||||
parents := graph.ImmediateDependencies(name)
|
||||
extra := ""
|
||||
if len(parents) > 0 && !info.Upgrade && info.Reason == dep.MakeDep {
|
||||
reducedParents := parents.Slice()[:min(cutOffExtra, len(parents))]
|
||||
reducedParents := parents.Slice()[:int(math.Min(cutOffExtra, float64(len(parents))))]
|
||||
if len(parents) > cutOffExtra {
|
||||
reducedParents = append(reducedParents, "...")
|
||||
}
|
||||
extra = fmt.Sprintf(" (%s of %s)", dep.ReasonNames[info.Reason], strings.Join(reducedParents, ", "))
|
||||
}
|
||||
|
||||
switch info.Source {
|
||||
case dep.AUR:
|
||||
if info.Source == dep.AUR {
|
||||
aurRepo := "aur"
|
||||
if info.Devel {
|
||||
aurRepo = "devel"
|
||||
@ -216,7 +216,7 @@ func (u *UpgradeService) graphToUpSlice(graph *topo.Graph[string, *dep.InstallIn
|
||||
Reason: alpmReason,
|
||||
Extra: extra,
|
||||
})
|
||||
case dep.Sync:
|
||||
} else if info.Source == dep.Sync {
|
||||
repoUp.Up = append(repoUp.Up, Upgrade{
|
||||
Name: name,
|
||||
RemoteVersion: info.Version,
|
||||
@ -246,6 +246,10 @@ func (u *UpgradeService) GraphUpgrades(ctx context.Context,
|
||||
return graph, err
|
||||
}
|
||||
|
||||
if graph.Len() == 0 {
|
||||
return graph, nil
|
||||
}
|
||||
|
||||
return graph, nil
|
||||
}
|
||||
|
||||
@ -299,37 +303,28 @@ func (u *UpgradeService) UserExcludeUpgrades(graph *topo.Graph[string, *dep.Inst
|
||||
// upgrade menu asks you which packages to NOT upgrade so in this case
|
||||
// exclude and include are kind of swapped
|
||||
exclude, include, otherExclude, otherInclude := intrange.ParseNumberMenu(numbers)
|
||||
|
||||
// true if user doesn't want to include specific repositories/packages
|
||||
noIncludes := len(include) == 0 && otherInclude.Cardinality() == 0
|
||||
|
||||
// No exclusions or inclusions specified, return early
|
||||
if noIncludes && len(exclude) == 0 && otherExclude.Cardinality() == 0 {
|
||||
return []string{}, nil
|
||||
}
|
||||
isInclude := len(include) == 0 && otherInclude.Cardinality() == 0
|
||||
|
||||
excluded := make([]string, 0)
|
||||
for i := range allUp.Up {
|
||||
up := &allUp.Up[i]
|
||||
upgradeID := len(allUp.Up) - i
|
||||
|
||||
// check if user wants to exclude specific things (true) or include specific things
|
||||
if noIncludes {
|
||||
// exclude repositories mentioned by the user
|
||||
if otherExclude.Contains(up.Repository) {
|
||||
u.log.Debugln("pruning", up.Name)
|
||||
excluded = append(excluded, graph.Prune(up.Name)...)
|
||||
}
|
||||
// exclude packages mentioned by the user
|
||||
if exclude.Get(upgradeID) {
|
||||
u.log.Debugln("pruning", up.Name)
|
||||
excluded = append(excluded, graph.Prune(up.Name)...)
|
||||
}
|
||||
|
||||
// If the user explicitly wants to include a package/repository, exclude everything else
|
||||
} else if !include.Get(upgradeID) && !otherInclude.Contains(up.Repository) {
|
||||
if isInclude && otherExclude.Contains(up.Repository) {
|
||||
u.log.Debugln("pruning", up.Name)
|
||||
excluded = append(excluded, graph.Prune(up.Name)...)
|
||||
continue
|
||||
}
|
||||
|
||||
if isInclude && exclude.Get(len(allUp.Up)-i) {
|
||||
u.log.Debugln("pruning", up.Name)
|
||||
excluded = append(excluded, graph.Prune(up.Name)...)
|
||||
continue
|
||||
}
|
||||
|
||||
if !isInclude && !(include.Get(len(allUp.Up)-i) || otherInclude.Contains(up.Repository)) {
|
||||
u.log.Debugln("pruning", up.Name)
|
||||
excluded = append(excluded, graph.Prune(up.Name)...)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/db"
|
||||
"github.com/Jguer/yay/v12/pkg/intrange"
|
||||
"github.com/Jguer/yay/v12/pkg/query"
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
// Filter decides if specific package should be included in the results.
|
||||
// Filter decides if specific package should be included in theincluded in the results.
|
||||
type Filter func(*Upgrade) bool
|
||||
|
||||
// Upgrade type describes a system upgrade.
|
||||
@ -38,10 +39,9 @@ func (u UpSlice) Less(i, j int) bool {
|
||||
}
|
||||
|
||||
for _, db := range u.Repos {
|
||||
switch db {
|
||||
case u.Up[i].Repository:
|
||||
if db == u.Up[i].Repository {
|
||||
return true
|
||||
case u.Up[j].Repository:
|
||||
} else if db == u.Up[j].Repository {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@ -52,27 +52,21 @@ func (u UpSlice) Less(i, j int) bool {
|
||||
return text.LessRunes(iRunes, jRunes)
|
||||
}
|
||||
|
||||
// calculateFormatting calculates formatting parameters for printing upgrades
|
||||
func calculateFormatting(upgrades []Upgrade) (longestName, longestVersion, longestNumber int) {
|
||||
for i := range upgrades {
|
||||
upgrade := &upgrades[i]
|
||||
// Print prints the details of the packages to upgrade.
|
||||
func (u UpSlice) Print(logger *text.Logger) {
|
||||
longestName, longestVersion := 0, 0
|
||||
|
||||
for k := range u.Up {
|
||||
upgrade := &u.Up[k]
|
||||
packNameLen := len(StylizedNameWithRepository(upgrade))
|
||||
packVersion, _ := query.GetVersionDiff(upgrade.LocalVersion, upgrade.RemoteVersion)
|
||||
packVersionLen := len(packVersion)
|
||||
longestName = max(packNameLen, longestName)
|
||||
longestVersion = max(packVersionLen, longestVersion)
|
||||
longestName = intrange.Max(packNameLen, longestName)
|
||||
longestVersion = intrange.Max(packVersionLen, longestVersion)
|
||||
}
|
||||
|
||||
lenUp := len(upgrades)
|
||||
longestNumber = len(fmt.Sprintf("%v", lenUp))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Print prints the details of the packages to upgrade.
|
||||
func (u UpSlice) Print(logger *text.Logger) {
|
||||
longestName, longestVersion, longestNumber := calculateFormatting(u.Up)
|
||||
|
||||
lenUp := len(u.Up)
|
||||
longestNumber := len(fmt.Sprintf("%v", lenUp))
|
||||
namePadding := fmt.Sprintf("%%-%ds ", longestName)
|
||||
versionPadding := fmt.Sprintf("%%-%ds", longestVersion)
|
||||
numberPadding := fmt.Sprintf("%%%dd ", longestNumber)
|
||||
@ -81,8 +75,10 @@ func (u UpSlice) Print(logger *text.Logger) {
|
||||
upgrade := &u.Up[k]
|
||||
left, right := query.GetVersionDiff(upgrade.LocalVersion, upgrade.RemoteVersion)
|
||||
|
||||
logger.Printf(text.Magenta(fmt.Sprintf(numberPadding, len(u.Up)-k)))
|
||||
logger.Printf(text.Magenta(fmt.Sprintf(numberPadding, lenUp-k)))
|
||||
|
||||
logger.Printf(namePadding, StylizedNameWithRepository(upgrade))
|
||||
|
||||
logger.Printf("%s -> %s\n", fmt.Sprintf(versionPadding, left), right)
|
||||
if upgrade.Extra != "" {
|
||||
logger.Println(strings.Repeat(" ", longestNumber), upgrade.Extra)
|
||||
@ -91,8 +87,19 @@ func (u UpSlice) Print(logger *text.Logger) {
|
||||
}
|
||||
|
||||
func (u UpSlice) PrintDeps(logger *text.Logger) {
|
||||
longestName, longestVersion, longestNumber := calculateFormatting(u.PulledDeps)
|
||||
longestName, longestVersion := 0, 0
|
||||
|
||||
for k := range u.PulledDeps {
|
||||
upgrade := &u.PulledDeps[k]
|
||||
packNameLen := len(StylizedNameWithRepository(upgrade))
|
||||
packVersion, _ := query.GetVersionDiff(upgrade.LocalVersion, upgrade.RemoteVersion)
|
||||
packVersionLen := len(packVersion)
|
||||
longestName = intrange.Max(packNameLen, longestName)
|
||||
longestVersion = intrange.Max(packVersionLen, longestVersion)
|
||||
}
|
||||
|
||||
lenUp := len(u.PulledDeps)
|
||||
longestNumber := len(fmt.Sprintf("%v", lenUp))
|
||||
namePadding := fmt.Sprintf(" %s%%-%ds ", strings.Repeat(" ", longestNumber), longestName)
|
||||
versionPadding := fmt.Sprintf("%%-%ds", longestVersion)
|
||||
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
@ -23,10 +24,6 @@ import (
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
func newTestLogger() *text.Logger {
|
||||
return text.NewLogger(io.Discard, io.Discard, strings.NewReader(""), true, "test")
|
||||
}
|
||||
|
||||
func TestParsing(t *testing.T) {
|
||||
t.Parallel()
|
||||
type source struct {
|
||||
@ -235,7 +232,7 @@ func TestInfoStoreToUpgrade(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
v := &InfoStore{
|
||||
logger: newTestLogger(),
|
||||
logger: text.GlobalLogger,
|
||||
CmdBuilder: tt.fields.CmdBuilder,
|
||||
OriginsByPackage: map[string]OriginInfoByURL{
|
||||
"yay": tt.args.infos,
|
||||
@ -368,7 +365,7 @@ func TestInfoStore_NeedsUpdate(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
v := &InfoStore{
|
||||
logger: newTestLogger(),
|
||||
logger: text.GlobalLogger,
|
||||
CmdBuilder: tt.fields.CmdBuilder,
|
||||
}
|
||||
got := v.needsUpdate(context.Background(), tt.args.infos)
|
||||
@ -418,7 +415,7 @@ func TestInfoStore_Update(t *testing.T) {
|
||||
t.Parallel()
|
||||
v := &InfoStore{
|
||||
OriginsByPackage: tt.fields.OriginsByPackage,
|
||||
logger: newTestLogger(),
|
||||
logger: text.GlobalLogger,
|
||||
FilePath: filePath,
|
||||
CmdBuilder: tt.fields.CmdBuilder,
|
||||
}
|
||||
@ -432,6 +429,7 @@ func TestInfoStore_Update(t *testing.T) {
|
||||
cupaloy.SnapshotT(t, marshalledinfo)
|
||||
|
||||
v.Load()
|
||||
fmt.Println(v.OriginsByPackage)
|
||||
assert.Len(t, tt.fields.OriginsByPackage, 1)
|
||||
|
||||
marshalledinfo, err = json.MarshalIndent(tt.fields.OriginsByPackage, "", "\t")
|
||||
@ -481,7 +479,7 @@ func TestInfoStore_Remove(t *testing.T) {
|
||||
t.Parallel()
|
||||
v := &InfoStore{
|
||||
OriginsByPackage: tt.fields.OriginsByPackage,
|
||||
logger: newTestLogger(),
|
||||
logger: text.GlobalLogger,
|
||||
FilePath: filePath,
|
||||
}
|
||||
v.RemovePackages(tt.args.pkgs)
|
||||
|
360
po/ca.po
360
po/ca.po
@ -1,10 +1,10 @@
|
||||
#
|
||||
# Translators:
|
||||
# Davidmp <medipas@gmail.com>, 2024
|
||||
# Davidmp <medipas@gmail.com>, 2023
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Last-Translator: Davidmp <medipas@gmail.com>, 2024\n"
|
||||
"Last-Translator: Davidmp <medipas@gmail.com>, 2023\n"
|
||||
"Language-Team: Catalan (https://app.transifex.com/yay-1/teams/123732/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -13,67 +13,51 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: xgotext\n"
|
||||
|
||||
#: clean.go:83
|
||||
msgid ""
|
||||
"\n"
|
||||
"Build directory:"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Directori de construcció:"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:201 pkg/dep/dep_graph.go:740
|
||||
msgid ""
|
||||
"\n"
|
||||
"Enter a number (default=1): "
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Introduïu un número (per defecte = 1):"
|
||||
|
||||
#: pkg/menus/menu.go:32
|
||||
#: pkg/menus/menu.go:31
|
||||
msgid " (Build Files Exist)"
|
||||
msgstr "(Els fitxers de compilació ja existeixen)"
|
||||
|
||||
#: pkg/menus/menu.go:27
|
||||
#: pkg/menus/menu.go:26
|
||||
msgid " (Installed)"
|
||||
msgstr "(Instal·lat)"
|
||||
|
||||
#: cmd.go:453
|
||||
#: cmd.go:461
|
||||
msgid " [Installed]"
|
||||
msgstr "[Instal·lat]"
|
||||
|
||||
#: cmd.go:410 vote.go:36
|
||||
#: cmd.go:418 vote.go:35
|
||||
msgid " there is nothing to do"
|
||||
msgstr "No hi ha res per fer."
|
||||
|
||||
#: pkg/menus/menu.go:49
|
||||
#: pkg/menus/menu.go:48
|
||||
msgid "%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"
|
||||
msgstr "%s [T]ot [Av]orta [I]nstal·lat [No] instal·lat o (1 2 3, 1-3, ^4)"
|
||||
|
||||
#: pkg/sync/build/installer.go:308
|
||||
#: aur_install.go:304
|
||||
msgid "%s already made -- skipping build"
|
||||
msgstr "%s ja fet: se n'omet la construcció."
|
||||
|
||||
#: pkg/menus/edit_menu.go:57
|
||||
#: pkg/menus/edit_menu.go:56
|
||||
msgid "%s is not set"
|
||||
msgstr "%s no està establert."
|
||||
|
||||
#: pkg/settings/exe/cmd_builder.go:257
|
||||
#: pkg/settings/exe/cmd_builder.go:238
|
||||
msgid "%s is present."
|
||||
msgstr "%s és present."
|
||||
|
||||
#: pkg/dep/dep_graph.go:460 pkg/sync/build/installer.go:305
|
||||
#: pkg/dep/dep_graph.go:431 aur_install.go:301
|
||||
msgid "%s is up to date -- skipping"
|
||||
msgstr "%s està al dia: s'omet."
|
||||
|
||||
#: pkg/upgrade/service.go:291
|
||||
#: pkg/upgrade/service.go:304
|
||||
msgid "%s to upgrade/install."
|
||||
msgstr "%s per actualitzar / instal·lar."
|
||||
|
||||
#: pkg/upgrade/service.go:285
|
||||
#: pkg/upgrade/service.go:298
|
||||
msgid "%s will also be installed for this operation."
|
||||
msgstr "%s també s'instal·larà per a aquesta operació."
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:124
|
||||
#: pkg/pgp/keys.go:127
|
||||
msgid "%s, required by: %s"
|
||||
msgstr "%s, requerit per %s"
|
||||
|
||||
@ -93,11 +77,11 @@ msgstr "%s: no es pot usar l'objectiu amb l'opció --repo, s'omet."
|
||||
msgid "%s: ignoring package upgrade (%s => %s)"
|
||||
msgstr "%s: s'ignora l'actualització del paquet (%s => %s)"
|
||||
|
||||
#: pkg/query/aur_warnings.go:46
|
||||
#: pkg/query/aur_warnings.go:51
|
||||
msgid "%s: local (%s) is newer than AUR (%s)"
|
||||
msgstr "%s: el paquet local (%s) és més nou que el de l'AUR (%s)"
|
||||
|
||||
#: vote.go:51
|
||||
#: vote.go:50
|
||||
msgid ""
|
||||
"%s: please set AUR_USERNAME and AUR_PASSWORD environment variables for "
|
||||
"voting"
|
||||
@ -109,23 +93,19 @@ msgstr ""
|
||||
msgid "(%d/%d) Downloaded PKGBUILD from ABS: %s"
|
||||
msgstr "(%d/%d) PKGBUILD baixat de l'ABS: %s"
|
||||
|
||||
#: pkg/download/aur.go:92 pkg/download/unified.go:188
|
||||
#: pkg/download/aur.go:84 pkg/download/unified.go:188
|
||||
msgid "(%d/%d) Downloaded PKGBUILD: %s"
|
||||
msgstr "(%d/%d) PKGBUILD baixat: %s"
|
||||
|
||||
#: pkg/download/aur.go:82
|
||||
msgid "(%d/%d) Failed to download PKGBUILD: %s"
|
||||
msgstr "(%d/%d) Ha fallat baixar el PKGBUILD: %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:109
|
||||
#: pkg/srcinfo/service.go:108
|
||||
msgid "(%d/%d) Parsing SRCINFO: %s"
|
||||
msgstr "(%d/%d) S'analitza SRCINFO: %s"
|
||||
|
||||
#: pkg/query/types.go:103 pkg/query/types.go:72
|
||||
#: pkg/query/types.go:72 pkg/query/types.go:103
|
||||
msgid "(Installed)"
|
||||
msgstr "(Instal·lat)"
|
||||
|
||||
#: pkg/query/types.go:101 pkg/query/types.go:70
|
||||
#: pkg/query/types.go:70 pkg/query/types.go:101
|
||||
msgid "(Installed: %s)"
|
||||
msgstr "(Instal·lat: %s)"
|
||||
|
||||
@ -137,15 +117,15 @@ msgstr "(Orfes)"
|
||||
msgid "(Out-of-date: %s)"
|
||||
msgstr "(Obsolet: %s)"
|
||||
|
||||
#: print.go:31
|
||||
msgid "AUR URL"
|
||||
msgstr "URL de l'AUR"
|
||||
|
||||
#: pkg/dep/dep_graph.go:75
|
||||
msgid "AUR"
|
||||
msgstr "AUR"
|
||||
|
||||
#: print.go:44
|
||||
msgid "AUR URL"
|
||||
msgstr "URL de l'AUR"
|
||||
|
||||
#: pkg/menus/edit_menu.go:58
|
||||
#: pkg/menus/edit_menu.go:57
|
||||
msgid "Add %s or %s to your environment variables"
|
||||
msgstr "Afegiu %s o %s a les variables d'entorn."
|
||||
|
||||
@ -157,23 +137,23 @@ msgstr "Eviteu executar el yay com a root / sudo."
|
||||
msgid "Check Dependency"
|
||||
msgstr "Comprova'n la dependència"
|
||||
|
||||
#: print.go:41
|
||||
#: print.go:37
|
||||
msgid "Check Deps"
|
||||
msgstr "Comprova les dependències"
|
||||
|
||||
#: pkg/upgrade/service.go:89
|
||||
#: pkg/upgrade/service.go:90
|
||||
msgid "Checking development packages..."
|
||||
msgstr "Es comproven els paquets de desenvolupament..."
|
||||
|
||||
#: pkg/sync/workdir/clean.go:45
|
||||
#: clean.go:217
|
||||
msgid "Cleaning (%d/%d): %s"
|
||||
msgstr "Es neteja (%d/%d): %s"
|
||||
|
||||
#: print.go:42
|
||||
#: print.go:39
|
||||
msgid "Conflicts With"
|
||||
msgstr "Té conflicte amb"
|
||||
|
||||
#: pkg/menus/clean_menu.go:62
|
||||
#: pkg/menus/clean_menu.go:60
|
||||
msgid "Deleting (%d/%d): %s"
|
||||
msgstr "Se suprimeix (%d/%d): %s"
|
||||
|
||||
@ -181,15 +161,15 @@ msgstr "Se suprimeix (%d/%d): %s"
|
||||
msgid "Dependency"
|
||||
msgstr "Dependència"
|
||||
|
||||
#: print.go:38
|
||||
#: print.go:35
|
||||
msgid "Depends On"
|
||||
msgstr "Depèn de"
|
||||
|
||||
#: print.go:33
|
||||
#: print.go:29
|
||||
msgid "Description"
|
||||
msgstr "Descripció"
|
||||
|
||||
#: pkg/menus/diff_menu.go:160
|
||||
#: pkg/menus/diff_menu.go:158
|
||||
msgid "Diffs to show?"
|
||||
msgstr "Diferències per mostrar?"
|
||||
|
||||
@ -197,19 +177,19 @@ msgstr "Diferències per mostrar?"
|
||||
msgid "Disable 'provides' setting by default"
|
||||
msgstr "Desactiva la configuració de \"proporciona\" per defecte."
|
||||
|
||||
#: clean.go:78
|
||||
#: clean.go:79
|
||||
msgid "Do you want to remove ALL AUR packages from cache?"
|
||||
msgstr "Voleu suprimir TOTS els paquets de l'AUR de la memòria cau?"
|
||||
|
||||
#: clean.go:95
|
||||
#: clean.go:96
|
||||
msgid "Do you want to remove ALL untracked AUR files?"
|
||||
msgstr "Voleu suprimir TOTS els fitxers de l'AUR sense seguiment?"
|
||||
|
||||
#: clean.go:80
|
||||
#: clean.go:81
|
||||
msgid "Do you want to remove all other AUR packages from cache?"
|
||||
msgstr "Voleu suprimir tots els altres paquets de l'AUR de la memòria cau?"
|
||||
|
||||
#: pkg/menus/edit_menu.go:61
|
||||
#: pkg/menus/edit_menu.go:60
|
||||
msgid "Edit PKGBUILD with?"
|
||||
msgstr "Amb què voleu editar el PKGBUILD?"
|
||||
|
||||
@ -217,7 +197,7 @@ msgstr "Amb què voleu editar el PKGBUILD?"
|
||||
msgid "Error during AUR search: %s\n"
|
||||
msgstr "Error durant la cerca a l'AUR: %s\n"
|
||||
|
||||
#: pkg/upgrade/service.go:295
|
||||
#: pkg/upgrade/service.go:308
|
||||
msgid "Excluding packages may cause partial upgrades and break systems"
|
||||
msgstr ""
|
||||
"L'exclusió de paquets pot provocar actualitzacions parcials i trencar els "
|
||||
@ -227,32 +207,32 @@ msgstr ""
|
||||
msgid "Explicit"
|
||||
msgstr "Explícit"
|
||||
|
||||
#: print.go:91
|
||||
#: print.go:85
|
||||
msgid "Explicitly installed packages: %s"
|
||||
msgstr "Paquets instal·lats explícitament: %s"
|
||||
|
||||
#: pkg/dep/dep_graph.go:437 pkg/dep/dep_graph.go:535
|
||||
#: pkg/dep/dep_graph.go:408 pkg/dep/dep_graph.go:506
|
||||
msgid "Failed to find AUR package for"
|
||||
msgstr "No s'ha pogut trobar el paquet de l'AUR per a"
|
||||
|
||||
#: pkg/sync/build/installer.go:120
|
||||
#: aur_install.go:120
|
||||
msgid "Failed to install layer, rolling up to next layer."
|
||||
msgstr "Ha fallat instal·lar la capa. Es passa a la següent."
|
||||
|
||||
#: pkg/sync/build/errors.go:16
|
||||
#: errors.go:55
|
||||
msgid ""
|
||||
"Failed to install the following packages. Manual intervention is required:"
|
||||
msgstr "Ha fallat instal·lar els paquets següents. Cal intervenció manual:"
|
||||
|
||||
#: print.go:45
|
||||
#: print.go:43
|
||||
msgid "First Submitted"
|
||||
msgstr "Enviat primer"
|
||||
|
||||
#: pkg/query/aur_warnings.go:83
|
||||
#: pkg/query/aur_warnings.go:84
|
||||
msgid "Flagged Out Of Date AUR Packages:"
|
||||
msgstr "Paquets de l'AUR obsolets marcats:"
|
||||
|
||||
#: print.go:90
|
||||
#: print.go:84
|
||||
msgid "Foreign installed packages: %s"
|
||||
msgstr "Paquets forans instal·lats: %s"
|
||||
|
||||
@ -260,31 +240,31 @@ msgstr "Paquets forans instal·lats: %s"
|
||||
msgid "Found git repo: %s"
|
||||
msgstr "S'ha trobat el repositori git: %s"
|
||||
|
||||
#: vcs.go:72
|
||||
#: vcs.go:73
|
||||
msgid "GenDB finished. No packages were installed"
|
||||
msgstr "GenDB ha acabat. No s'ha instal·lat cap paquet."
|
||||
|
||||
#: print.go:36
|
||||
#: print.go:32
|
||||
msgid "Groups"
|
||||
msgstr "Grups"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:88
|
||||
#: pkg/pgp/keys.go:91
|
||||
msgid "Import?"
|
||||
msgstr "Ho importo?"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:97
|
||||
#: pkg/pgp/keys.go:100
|
||||
msgid "Importing keys with gpg..."
|
||||
msgstr "S'importen claus amb gpg..."
|
||||
|
||||
#: print.go:46
|
||||
#: print.go:27
|
||||
msgid "Keywords"
|
||||
msgstr "Paraules clau"
|
||||
|
||||
#: print.go:47
|
||||
#: print.go:44
|
||||
msgid "Last Modified"
|
||||
msgstr "Darrera modificació"
|
||||
|
||||
#: print.go:35
|
||||
#: print.go:33
|
||||
msgid "Licenses"
|
||||
msgstr "Llicències"
|
||||
|
||||
@ -292,7 +272,7 @@ msgstr "Llicències"
|
||||
msgid "Local"
|
||||
msgstr "Local"
|
||||
|
||||
#: print.go:48
|
||||
#: print.go:40
|
||||
msgid "Maintainer"
|
||||
msgstr "Mantenidor"
|
||||
|
||||
@ -300,51 +280,47 @@ msgstr "Mantenidor"
|
||||
msgid "Make Dependency"
|
||||
msgstr "Dependència de construcció"
|
||||
|
||||
#: print.go:40
|
||||
#: print.go:36
|
||||
msgid "Make Deps"
|
||||
msgstr "Dependències de construcció"
|
||||
|
||||
#: pkg/query/aur_warnings.go:76
|
||||
msgid "Missing AUR Debug Packages:"
|
||||
msgstr "Manquen paquets de depuració de l'AUR:"
|
||||
|
||||
#: pkg/dep/dep_graph.go:79
|
||||
msgid "Missing"
|
||||
msgstr "Manca"
|
||||
|
||||
#: pkg/query/aur_warnings.go:75
|
||||
msgid "Missing AUR Debug Packages:"
|
||||
msgstr "Manquen paquets de depuració de l'AUR:"
|
||||
|
||||
#: print.go:31
|
||||
#: print.go:26
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#: pkg/dep/dep_graph.go:442 pkg/dep/dep_graph.go:548
|
||||
#: pkg/dep/dep_graph.go:413 pkg/dep/dep_graph.go:519
|
||||
msgid "No AUR package found for"
|
||||
msgstr "No s'ha trobat cap paquet d'AUR per a"
|
||||
|
||||
#: pkg/dep/dep_graph.go:182
|
||||
msgid "No package found for"
|
||||
msgstr "No s'ha trobat cap paquet per"
|
||||
|
||||
#: print.go:225
|
||||
#: pkg/text/print.go:117
|
||||
msgid "None"
|
||||
msgstr "Cap"
|
||||
|
||||
#: print.go:39
|
||||
#: print.go:38
|
||||
msgid "Optional Deps"
|
||||
msgstr "Dependències opcionals"
|
||||
|
||||
#: pkg/query/aur_warnings.go:79
|
||||
#: pkg/query/aur_warnings.go:80
|
||||
msgid "Orphan (unmaintained) AUR Packages:"
|
||||
msgstr "Paquets d'AUR orfes (no mantinguts):"
|
||||
|
||||
#: print.go:53 print.go:55
|
||||
#: print.go:47 print.go:49
|
||||
msgid "Out-of-date"
|
||||
msgstr "Obsolet"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:115
|
||||
#: pkg/pgp/keys.go:118
|
||||
msgid "PGP keys need importing:"
|
||||
msgstr "Cal importar claus PGP:"
|
||||
|
||||
#: pkg/sync/workdir/preparer.go:252
|
||||
#: preparer.go:242
|
||||
msgid "PKGBUILD up to date, skipping download: %s"
|
||||
msgstr "PKGBUILD actualitzat, s'omet la baixada: %s"
|
||||
|
||||
@ -352,72 +328,68 @@ msgstr "PKGBUILD actualitzat, s'omet la baixada: %s"
|
||||
msgid "PKGBUILDs to edit?"
|
||||
msgstr "PKGBUILDs per editar?"
|
||||
|
||||
#: print.go:61
|
||||
msgid "Package Base"
|
||||
msgstr "Base de paquets"
|
||||
|
||||
#: print.go:60
|
||||
#: print.go:54
|
||||
msgid "Package Base ID"
|
||||
msgstr "ID de la base de paquets"
|
||||
|
||||
#: pkg/query/aur_warnings.go:71
|
||||
#: print.go:55
|
||||
msgid "Package Base"
|
||||
msgstr "Base de paquets"
|
||||
|
||||
#: pkg/query/aur_warnings.go:72
|
||||
msgid "Packages not in AUR:"
|
||||
msgstr "Paquets no a l'AUR:"
|
||||
|
||||
#: pkg/menus/clean_menu.go:54
|
||||
#: pkg/menus/clean_menu.go:52
|
||||
msgid "Packages to cleanBuild?"
|
||||
msgstr "Paquets per a la neteja de la construcció?"
|
||||
|
||||
#: pkg/dep/dep_graph.go:202
|
||||
#: pkg/dep/dep_graph.go:216
|
||||
msgid "Packages to exclude"
|
||||
msgstr "Paquets per excloure"
|
||||
|
||||
#: pkg/upgrade/service.go:294
|
||||
#: pkg/upgrade/service.go:307
|
||||
msgid "Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"
|
||||
msgstr "Paquets per excloure: (p. ex.: \"1 2 3\", \"1-3\", \"^4\" o nom del repositori)"
|
||||
|
||||
#: cmd.go:392
|
||||
#: cmd.go:400
|
||||
msgid "Packages to install (eg: 1 2 3, 1-3 or ^4)"
|
||||
msgstr "Paquets per instal·lar (p. ex.: 1 2 3, 1-3 o ^4)"
|
||||
|
||||
#: print.go:49
|
||||
#: print.go:42
|
||||
msgid "Popularity"
|
||||
msgstr "Popularitat"
|
||||
|
||||
#: pkg/menus/diff_menu.go:172 pkg/menus/edit_menu.go:143
|
||||
#: pkg/menus/diff_menu.go:170 pkg/menus/edit_menu.go:143
|
||||
msgid "Proceed with install?"
|
||||
msgstr "Voleu continuar la instal·lació?"
|
||||
|
||||
#: print.go:37
|
||||
#: print.go:34
|
||||
msgid "Provides"
|
||||
msgstr "Proporciona"
|
||||
|
||||
#: pkg/sync/workdir/preparer.go:125
|
||||
#: preparer.go:119
|
||||
msgid "Remove make dependencies after install?"
|
||||
msgstr ""
|
||||
"Suprimeixo les dependències de construcció després de la instal·lació?"
|
||||
|
||||
#: print.go:43
|
||||
msgid "Replaces"
|
||||
msgstr "Reemplaça"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:191 print.go:30
|
||||
msgid "Repository"
|
||||
msgstr "Repositori"
|
||||
|
||||
#: pkg/dep/dep_graph.go:730
|
||||
#: pkg/dep/dep_graph.go:701
|
||||
msgid "Repository AUR"
|
||||
msgstr "Repositori de l'AUR"
|
||||
|
||||
#: print.go:25 pkg/db/ialpm/alpm.go:191
|
||||
msgid "Repository"
|
||||
msgstr "Repositori"
|
||||
|
||||
#: pkg/dep/dep_graph.go:78
|
||||
msgid "SRCINFO"
|
||||
msgstr "SRCINFO"
|
||||
|
||||
#: pkg/upgrade/service.go:71
|
||||
#: pkg/upgrade/service.go:72
|
||||
msgid "Searching AUR for updates..."
|
||||
msgstr "Se cerquen actualitzacions a l'AUR..."
|
||||
|
||||
#: pkg/upgrade/service.go:159
|
||||
#: pkg/upgrade/service.go:160
|
||||
msgid "Searching databases for updates..."
|
||||
msgstr "Se cerquen actualitzacions a les bases de dades..."
|
||||
|
||||
@ -425,15 +397,15 @@ msgstr "Se cerquen actualitzacions a les bases de dades..."
|
||||
msgid "Showing repo packages only"
|
||||
msgstr "Es mostren només paquets dels repositoris."
|
||||
|
||||
#: print.go:95
|
||||
#: print.go:89
|
||||
msgid "Size of pacman cache %s: %s"
|
||||
msgstr "Mida de la memòria cau del pacman %s: %s"
|
||||
|
||||
#: print.go:98
|
||||
#: print.go:92
|
||||
msgid "Size of yay cache %s: %s"
|
||||
msgstr "Mida de la memòria cau del yay %s: %s"
|
||||
|
||||
#: print.go:62
|
||||
#: print.go:56
|
||||
msgid "Snapshot URL"
|
||||
msgstr "URL de la instantània"
|
||||
|
||||
@ -441,88 +413,104 @@ msgstr "URL de la instantània"
|
||||
msgid "Sync"
|
||||
msgstr "Sincronització"
|
||||
|
||||
#: print.go:100
|
||||
#: print.go:94
|
||||
msgid "Ten biggest packages:"
|
||||
msgstr "Els deu paquets més grossos:"
|
||||
|
||||
#: pkg/sync/sync.go:124
|
||||
#: sync.go:190
|
||||
msgid "The following packages are not compatible with your architecture:"
|
||||
msgstr "Els paquets següents no són compatibles amb la vostra arquitectura:"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:179 pkg/dep/dep_graph.go:726
|
||||
msgid "There are %[1]d providers available for %[2]s:"
|
||||
msgstr "Hi ha %[1]d proveïdors disponibles per a %[2]s:"
|
||||
#: pkg/dep/dep_graph.go:697 pkg/db/ialpm/alpm.go:179
|
||||
msgid "There are %d providers available for %s:"
|
||||
msgstr "Hi ha %d proveïdors disponibles per a %s:"
|
||||
|
||||
#: pkg/settings/exe/cmd_builder.go:258
|
||||
#: pkg/settings/exe/cmd_builder.go:239
|
||||
msgid "There may be another Pacman instance running. Waiting..."
|
||||
msgstr ""
|
||||
"Pot ser que hi hagi una altra instància del Pacman en execució. S'espera..."
|
||||
|
||||
#: print.go:92
|
||||
#: print.go:86
|
||||
msgid "Total Size occupied by packages: %s"
|
||||
msgstr "Mida total ocupada pels paquets: %s"
|
||||
|
||||
#: print.go:89
|
||||
#: print.go:83
|
||||
msgid "Total installed packages: %s"
|
||||
msgstr "Total de paquets instal·lats: %s"
|
||||
|
||||
#: pkg/sync/sync.go:132
|
||||
#: sync.go:198
|
||||
msgid "Try to build them anyway?"
|
||||
msgstr "Intento construir-los tanmateix?"
|
||||
|
||||
#: print.go:34
|
||||
#: print.go:30
|
||||
msgid "URL"
|
||||
msgstr "URL"
|
||||
|
||||
#: clean.go:194 pkg/menus/clean_menu.go:65 pkg/menus/clean_menu.go:71
|
||||
#: clean.go:195 pkg/menus/clean_menu.go:63 pkg/menus/clean_menu.go:69
|
||||
msgid "Unable to clean:"
|
||||
msgstr "No es pot netejar:"
|
||||
|
||||
#: get.go:42 get.go:74
|
||||
#: get.go:44 get.go:76
|
||||
msgid "Unable to find the following packages:"
|
||||
msgstr "No s'han pogut trobar els paquets següents:"
|
||||
|
||||
#: vote.go:20
|
||||
#: vote.go:19
|
||||
msgid "Unable to handle package vote for: %s. err: %s"
|
||||
msgstr "No es pot gestionar el vot del paquet per a %s. Error: %s"
|
||||
|
||||
#: clean.go:170
|
||||
#: clean.go:171
|
||||
msgid "Unable to remove %s: %s"
|
||||
msgstr "No es pot suprimir %s: %s"
|
||||
|
||||
#: print.go:32
|
||||
#: print.go:28
|
||||
msgid "Version"
|
||||
msgstr "Versió"
|
||||
|
||||
#: print.go:50
|
||||
#: print.go:41
|
||||
msgid "Votes"
|
||||
msgstr "Vots"
|
||||
|
||||
#: print.go:87
|
||||
#: print.go:81
|
||||
msgid "Yay version v%s"
|
||||
msgstr "Versió del yay: v%s"
|
||||
|
||||
#: pkg/menus/menu.go:49
|
||||
#: pkg/menus/menu.go:48
|
||||
msgid "[N]one"
|
||||
msgstr "Ca[p]"
|
||||
|
||||
#: clean.go:84
|
||||
msgid ""
|
||||
"\n"
|
||||
"Build directory:"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Directori de construcció:"
|
||||
|
||||
#: pkg/dep/dep_graph.go:711 pkg/db/ialpm/alpm.go:201
|
||||
msgid ""
|
||||
"\n"
|
||||
"Enter a number (default=1): "
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Introduïu un número (per defecte = 1):"
|
||||
|
||||
#: pkg/settings/errors.go:29
|
||||
msgid "aborting due to user"
|
||||
msgstr "s'avorta a causa de l'usuari"
|
||||
|
||||
#: pkg/settings/parser/parser.go:608
|
||||
#: pkg/settings/parser/parser.go:619
|
||||
msgid "argument '-' specified without input on stdin"
|
||||
msgstr "argument '-' especificat sense entrada a stdin"
|
||||
|
||||
#: local_install.go:26
|
||||
#: local_install.go:27
|
||||
msgid "cannot find PKGBUILD and .SRCINFO in directory"
|
||||
msgstr "no es pot trobar PKGBUILD i SRCINFO al directori"
|
||||
|
||||
#: pkg/sync/build/pkg_archive.go:148
|
||||
#: install.go:130
|
||||
msgid "cannot find package name: %v"
|
||||
msgstr "no es pot trobar el nom del paquet: %v"
|
||||
|
||||
#: pkg/sync/build/errors.go:30
|
||||
#: errors.go:47
|
||||
msgid "could not find PKGDEST for: %s"
|
||||
msgstr "no s'ha pogut trobar PKGDEST per a %s"
|
||||
|
||||
@ -530,23 +518,23 @@ msgstr "no s'ha pogut trobar PKGDEST per a %s"
|
||||
msgid "could not find all required packages"
|
||||
msgstr "no s'han pogut trobar tots els paquets necessaris"
|
||||
|
||||
#: pkg/sync/build/errors.go:61
|
||||
#: errors.go:16
|
||||
msgid "could not find any package archives listed in %s"
|
||||
msgstr "no s'ha pogut trobar cap arxiu de paquets llistat a %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:50 pkg/upgrade/service.go:286
|
||||
#: errors.go:26 pkg/upgrade/service.go:299
|
||||
msgid "dependency"
|
||||
msgstr "dependència"
|
||||
|
||||
#: pkg/vcs/vcs.go:100 pkg/vcs/vcs.go:96
|
||||
#: pkg/vcs/vcs.go:96 pkg/vcs/vcs.go:100
|
||||
msgid "devel check for package failed: '%s' encountered an error"
|
||||
msgstr "la comprovació del paquet ha fallat: %s ha trobat un error"
|
||||
|
||||
#: pkg/menus/edit_menu.go:110
|
||||
#: pkg/menus/edit_menu.go:109
|
||||
msgid "editor did not exit successfully, aborting: %s"
|
||||
msgstr "l'editor no ha sortit correctament, s'avorta: %s"
|
||||
|
||||
#: pkg/sync/workdir/aur_source.go:24
|
||||
#: aur_source.go:24
|
||||
msgid "error downloading sources: %s"
|
||||
msgstr "error en baixar les fonts: %s"
|
||||
|
||||
@ -554,19 +542,19 @@ msgstr "error en baixar les fonts: %s"
|
||||
msgid "error fetching %s: %s"
|
||||
msgstr "error en obtenir %s: %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:9
|
||||
#: local_install.go:26
|
||||
msgid "error installing repo packages"
|
||||
msgstr "error en instal·lar paquets dels repositoris"
|
||||
|
||||
#: pkg/sync/build/installer.go:266 pkg/sync/build/installer.go:270
|
||||
#: aur_install.go:266 aur_install.go:270
|
||||
msgid "error installing:"
|
||||
msgstr "error d'instal·lació:"
|
||||
|
||||
#: pkg/sync/build/installer.go:233 pkg/sync/build/installer.go:237
|
||||
#: aur_install.go:233 aur_install.go:237
|
||||
msgid "error making: %s"
|
||||
msgstr "error de construcció: %s"
|
||||
|
||||
#: pkg/sync/workdir/merge.go:24
|
||||
#: install.go:160
|
||||
msgid "error merging %s: %s"
|
||||
msgstr "error en combinar %s: %s"
|
||||
|
||||
@ -574,19 +562,19 @@ msgstr "error en combinar %s: %s"
|
||||
msgid "error reading %s"
|
||||
msgstr "error en llegir %s"
|
||||
|
||||
#: sync.go:36
|
||||
#: sync.go:37
|
||||
msgid "error refreshing databases"
|
||||
msgstr "error en actualitzar les bases de dades"
|
||||
|
||||
#: pkg/sync/workdir/clean.go:51 pkg/sync/workdir/merge.go:17
|
||||
#: clean.go:223 install.go:153
|
||||
msgid "error resetting %s: %s"
|
||||
msgstr "error en restablir %s: %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:53
|
||||
#: errors.go:29
|
||||
msgid "error updating package install reason to %s"
|
||||
msgstr "error en actualitzar el motiu d'instal·lació del paquet a %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:48
|
||||
#: errors.go:24
|
||||
msgid "explicit"
|
||||
msgstr "explícit"
|
||||
|
||||
@ -594,27 +582,27 @@ msgstr "explícit"
|
||||
msgid "failed to create directory '%s': %s"
|
||||
msgstr "ha fallat crear el directori %s: %s"
|
||||
|
||||
#: pkg/settings/config.go:281
|
||||
#: pkg/settings/config.go:284
|
||||
msgid "failed to open config file '%s': %s"
|
||||
msgstr "ha fallat obrir el fitxer de configuració %s: %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:114
|
||||
#: pkg/srcinfo/service.go:113
|
||||
msgid "failed to parse %s -- skipping: %s"
|
||||
msgstr "ha fallat analitzar %s, s'omet: %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:118
|
||||
#: pkg/srcinfo/service.go:117
|
||||
msgid "failed to parse %s: %s"
|
||||
msgstr "no s'ha pogut analitzar %s: %s"
|
||||
|
||||
#: local_install.go:77
|
||||
#: local_install.go:79
|
||||
msgid "failed to parse .SRCINFO"
|
||||
msgstr "ha fallat analitzar .SRCINFO"
|
||||
|
||||
#: pkg/settings/config.go:291
|
||||
#: pkg/settings/config.go:294
|
||||
msgid "failed to read config file '%s': %s"
|
||||
msgstr "ha fallat llegir el fitxer de configuració %s: %s"
|
||||
|
||||
#: pkg/cmd/graph/main.go:46 pkg/runtime/runtime.go:73
|
||||
#: pkg/settings/runtime.go:73
|
||||
msgid "failed to retrieve aur Cache"
|
||||
msgstr "ha fallat obtenir la cau de l'AUR"
|
||||
|
||||
@ -628,7 +616,7 @@ msgstr ""
|
||||
msgid "input too long"
|
||||
msgstr "entrada massa llarga"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:222 pkg/dep/dep_graph.go:761
|
||||
#: pkg/dep/dep_graph.go:732 pkg/db/ialpm/alpm.go:222
|
||||
msgid "invalid number: %s"
|
||||
msgstr "número no vàlid: %s"
|
||||
|
||||
@ -636,7 +624,7 @@ msgstr "número no vàlid: %s"
|
||||
msgid "invalid option '%s'"
|
||||
msgstr "opció no vàlida: %s"
|
||||
|
||||
#: cmd.go:197
|
||||
#: cmd.go:206
|
||||
msgid "invalid option: '--deps' and '--explicit' may not be used together"
|
||||
msgstr "opció no vàlida: \"--deps\" i \"--explicit\" no es poden usar juntes"
|
||||
|
||||
@ -644,15 +632,11 @@ msgstr "opció no vàlida: \"--deps\" i \"--explicit\" no es poden usar juntes"
|
||||
msgid "invalid repository"
|
||||
msgstr "repositori no vàlid"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:227 pkg/dep/dep_graph.go:767
|
||||
#: pkg/dep/dep_graph.go:738 pkg/db/ialpm/alpm.go:227
|
||||
msgid "invalid value: %d is not between %d and %d"
|
||||
msgstr "valor no vàlid: %d no és entre %d i %d"
|
||||
|
||||
#: pkg/text/input.go:48
|
||||
msgid "no"
|
||||
msgstr "no"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:110
|
||||
#: pkg/pgp/keys.go:113
|
||||
msgid "no keys to import"
|
||||
msgstr "sense claus per importar"
|
||||
|
||||
@ -660,11 +644,15 @@ msgstr "sense claus per importar"
|
||||
msgid "no query was executed"
|
||||
msgstr "no s'ha executat cap consulta"
|
||||
|
||||
#: local_install.go:66
|
||||
#: local_install.go:68
|
||||
msgid "no target directories specified"
|
||||
msgstr "no s'han especificat directoris de destinació"
|
||||
|
||||
#: pkg/sync/build/installer.go:242
|
||||
#: pkg/text/text.go:69
|
||||
msgid "no"
|
||||
msgstr "no"
|
||||
|
||||
#: aur_install.go:242
|
||||
msgid "nothing to install for %s"
|
||||
msgstr "no hi ha res per instal·lar per %s"
|
||||
|
||||
@ -672,17 +660,7 @@ msgstr "no hi ha res per instal·lar per %s"
|
||||
msgid "only one operation may be used at a time"
|
||||
msgstr "només es pot usar una operació alhora"
|
||||
|
||||
#: pkg/cmd/graph/main.go:70
|
||||
msgid "only one target is allowed"
|
||||
msgstr "només es permet una destinació"
|
||||
|
||||
#: pkg/upgrade/service.go:291
|
||||
msgid "package"
|
||||
msgid_plural "packages"
|
||||
msgstr[0] "paquet"
|
||||
msgstr[1] "paquets"
|
||||
|
||||
#: print.go:187
|
||||
#: print.go:181
|
||||
msgid "package '%s' was not found"
|
||||
msgstr "no s'ha trobat el paquet %s"
|
||||
|
||||
@ -694,24 +672,30 @@ msgstr "paquet no trobat a l'AUR"
|
||||
msgid "package not found in repos"
|
||||
msgstr "paquet no trobat als repositoris"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:100
|
||||
#: pkg/upgrade/service.go:304
|
||||
msgid "package"
|
||||
msgid_plural "packages"
|
||||
msgstr[0] "paquet"
|
||||
msgstr[1] "paquets"
|
||||
|
||||
#: pkg/pgp/keys.go:103
|
||||
msgid "problem importing keys"
|
||||
msgstr "problema d'importació de claus"
|
||||
|
||||
#: clean.go:105
|
||||
#: clean.go:106
|
||||
msgid "removing AUR packages from cache..."
|
||||
msgstr "se suprimeixen paquets de l'AUR de la memòria cau..."
|
||||
|
||||
#: clean.go:178 pkg/sync/workdir/clean.go:41
|
||||
#: clean.go:179 clean.go:213
|
||||
msgid "removing untracked AUR files from cache..."
|
||||
msgstr ""
|
||||
"se suprimeixen els fitxers de l'AUR sense seguiment de la memòria cau..."
|
||||
|
||||
#: pkg/sync/build/errors.go:38
|
||||
#: errors.go:37
|
||||
msgid "the PKGDEST for %s is listed by makepkg but does not exist: %s"
|
||||
msgstr "el PKGDEST per a %s està llistat per makepkg però no existeix:%s"
|
||||
|
||||
#: pkg/sync/sync.go:45
|
||||
#: sync.go:113
|
||||
msgid "there is nothing to do"
|
||||
msgstr "No hi ha res per fer."
|
||||
|
||||
@ -719,14 +703,14 @@ msgstr "No hi ha res per fer."
|
||||
msgid "unable to CreateHandle: %s"
|
||||
msgstr "no se'n pot crear el maneig: %s"
|
||||
|
||||
#: cmd.go:186
|
||||
#: cmd.go:195
|
||||
msgid "unhandled operation"
|
||||
msgstr "operació no manejada"
|
||||
|
||||
#: cmd.go:450
|
||||
#: cmd.go:458
|
||||
msgid "unknown-version"
|
||||
msgstr "versió desconeguda"
|
||||
|
||||
#: pkg/text/input.go:47
|
||||
#: pkg/text/text.go:68
|
||||
msgid "yes"
|
||||
msgstr "sí"
|
||||
|
732
po/ca_ES.po
732
po/ca_ES.po
@ -1,732 +0,0 @@
|
||||
#
|
||||
# Translators:
|
||||
# Davidmp <medipas@gmail.com>, 2024
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Last-Translator: Davidmp <medipas@gmail.com>, 2024\n"
|
||||
"Language-Team: Catalan (Spain) (https://app.transifex.com/yay-1/teams/123732/ca_ES/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca_ES\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: xgotext\n"
|
||||
|
||||
#: clean.go:83
|
||||
msgid ""
|
||||
"\n"
|
||||
"Build directory:"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Directori de construcció:"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:201 pkg/dep/dep_graph.go:740
|
||||
msgid ""
|
||||
"\n"
|
||||
"Enter a number (default=1): "
|
||||
msgstr ""
|
||||
"\n"
|
||||
"Introduïu un número (per defecte = 1):"
|
||||
|
||||
#: pkg/menus/menu.go:32
|
||||
msgid " (Build Files Exist)"
|
||||
msgstr "(Els fitxers de compilació ja existeixen)"
|
||||
|
||||
#: pkg/menus/menu.go:27
|
||||
msgid " (Installed)"
|
||||
msgstr "(Instal·lat)"
|
||||
|
||||
#: cmd.go:453
|
||||
msgid " [Installed]"
|
||||
msgstr "[Instal·lat]"
|
||||
|
||||
#: cmd.go:410 vote.go:36
|
||||
msgid " there is nothing to do"
|
||||
msgstr "No hi ha res per fer."
|
||||
|
||||
#: pkg/menus/menu.go:49
|
||||
msgid "%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"
|
||||
msgstr "%s [T]ot [Av]orta [I]nstal·lat [No] instal·lat o (1 2 3, 1-3, ^4)"
|
||||
|
||||
#: pkg/sync/build/installer.go:308
|
||||
msgid "%s already made -- skipping build"
|
||||
msgstr "%s ja fet: se n'omet la construcció."
|
||||
|
||||
#: pkg/menus/edit_menu.go:57
|
||||
msgid "%s is not set"
|
||||
msgstr "%s no està establert."
|
||||
|
||||
#: pkg/settings/exe/cmd_builder.go:257
|
||||
msgid "%s is present."
|
||||
msgstr "%s és present."
|
||||
|
||||
#: pkg/dep/dep_graph.go:460 pkg/sync/build/installer.go:305
|
||||
msgid "%s is up to date -- skipping"
|
||||
msgstr "%s està al dia: s'omet."
|
||||
|
||||
#: pkg/upgrade/service.go:291
|
||||
msgid "%s to upgrade/install."
|
||||
msgstr "%s per actualitzar / instal·lar."
|
||||
|
||||
#: pkg/upgrade/service.go:285
|
||||
msgid "%s will also be installed for this operation."
|
||||
msgstr "%s també s'instal·larà per a aquesta operació."
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:124
|
||||
msgid "%s, required by: %s"
|
||||
msgstr "%s, requerit per %s"
|
||||
|
||||
#: pkg/menus/diff_menu.go:49
|
||||
msgid "%s: No changes -- skipping"
|
||||
msgstr "%s: sense canvis, s'omet."
|
||||
|
||||
#: pkg/query/filter.go:22
|
||||
msgid "%s: can't use target with option --aur -- skipping"
|
||||
msgstr "%s: no es pot usar l'objectiu amb l'opció --aur, s'omet."
|
||||
|
||||
#: pkg/query/filter.go:17
|
||||
msgid "%s: can't use target with option --repo -- skipping"
|
||||
msgstr "%s: no es pot usar l'objectiu amb l'opció --repo, s'omet."
|
||||
|
||||
#: pkg/upgrade/sources.go:57
|
||||
msgid "%s: ignoring package upgrade (%s => %s)"
|
||||
msgstr "%s: s'ignora l'actualització del paquet (%s => %s)"
|
||||
|
||||
#: pkg/query/aur_warnings.go:46
|
||||
msgid "%s: local (%s) is newer than AUR (%s)"
|
||||
msgstr "%s: el paquet local (%s) és més nou que el de l'AUR (%s)"
|
||||
|
||||
#: vote.go:51
|
||||
msgid ""
|
||||
"%s: please set AUR_USERNAME and AUR_PASSWORD environment variables for "
|
||||
"voting"
|
||||
msgstr ""
|
||||
"%s: establiu les variables d'entorn AUR_NOMDUSUARI i AUR_CONTRASENYA per "
|
||||
"votar."
|
||||
|
||||
#: pkg/download/unified.go:192
|
||||
msgid "(%d/%d) Downloaded PKGBUILD from ABS: %s"
|
||||
msgstr "(%d/%d) PKGBUILD baixat de l'ABS: %s"
|
||||
|
||||
#: pkg/download/aur.go:92 pkg/download/unified.go:188
|
||||
msgid "(%d/%d) Downloaded PKGBUILD: %s"
|
||||
msgstr "(%d/%d) PKGBUILD baixat: %s"
|
||||
|
||||
#: pkg/download/aur.go:82
|
||||
msgid "(%d/%d) Failed to download PKGBUILD: %s"
|
||||
msgstr "(%d/%d) Ha fallat baixar el PKGBUILD: %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:109
|
||||
msgid "(%d/%d) Parsing SRCINFO: %s"
|
||||
msgstr "(%d/%d) S'analitza SRCINFO: %s"
|
||||
|
||||
#: pkg/query/types.go:103 pkg/query/types.go:72
|
||||
msgid "(Installed)"
|
||||
msgstr "(Instal·lat)"
|
||||
|
||||
#: pkg/query/types.go:101 pkg/query/types.go:70
|
||||
msgid "(Installed: %s)"
|
||||
msgstr "(Instal·lat: %s)"
|
||||
|
||||
#: pkg/query/types.go:61
|
||||
msgid "(Orphaned)"
|
||||
msgstr "(Orfes)"
|
||||
|
||||
#: pkg/query/types.go:65
|
||||
msgid "(Out-of-date: %s)"
|
||||
msgstr "(Obsolet: %s)"
|
||||
|
||||
#: pkg/dep/dep_graph.go:75
|
||||
msgid "AUR"
|
||||
msgstr "AUR"
|
||||
|
||||
#: print.go:44
|
||||
msgid "AUR URL"
|
||||
msgstr "URL de l'AUR"
|
||||
|
||||
#: pkg/menus/edit_menu.go:58
|
||||
msgid "Add %s or %s to your environment variables"
|
||||
msgstr "Afegiu %s o %s a les variables d'entorn."
|
||||
|
||||
#: main.go:60
|
||||
msgid "Avoid running yay as root/sudo."
|
||||
msgstr "Eviteu executar el yay com a root / sudo."
|
||||
|
||||
#: pkg/dep/dep_graph.go:63
|
||||
msgid "Check Dependency"
|
||||
msgstr "Comprova'n la dependència"
|
||||
|
||||
#: print.go:41
|
||||
msgid "Check Deps"
|
||||
msgstr "Comprova les dependències"
|
||||
|
||||
#: pkg/upgrade/service.go:89
|
||||
msgid "Checking development packages..."
|
||||
msgstr "Es comproven els paquets de desenvolupament..."
|
||||
|
||||
#: pkg/sync/workdir/clean.go:45
|
||||
msgid "Cleaning (%d/%d): %s"
|
||||
msgstr "Es neteja (%d/%d): %s"
|
||||
|
||||
#: print.go:42
|
||||
msgid "Conflicts With"
|
||||
msgstr "Té conflicte amb"
|
||||
|
||||
#: pkg/menus/clean_menu.go:62
|
||||
msgid "Deleting (%d/%d): %s"
|
||||
msgstr "Se suprimeix (%d/%d): %s"
|
||||
|
||||
#: pkg/dep/dep_graph.go:61
|
||||
msgid "Dependency"
|
||||
msgstr "Dependència"
|
||||
|
||||
#: print.go:38
|
||||
msgid "Depends On"
|
||||
msgstr "Depèn de"
|
||||
|
||||
#: print.go:33
|
||||
msgid "Description"
|
||||
msgstr "Descripció"
|
||||
|
||||
#: pkg/menus/diff_menu.go:160
|
||||
msgid "Diffs to show?"
|
||||
msgstr "Diferències per mostrar?"
|
||||
|
||||
#: pkg/settings/migrations.go:25
|
||||
msgid "Disable 'provides' setting by default"
|
||||
msgstr "Desactiva la configuració de \"proporciona\" per defecte."
|
||||
|
||||
#: clean.go:78
|
||||
msgid "Do you want to remove ALL AUR packages from cache?"
|
||||
msgstr "Voleu suprimir TOTS els paquets de l'AUR de la memòria cau?"
|
||||
|
||||
#: clean.go:95
|
||||
msgid "Do you want to remove ALL untracked AUR files?"
|
||||
msgstr "Voleu suprimir TOTS els fitxers de l'AUR sense seguiment?"
|
||||
|
||||
#: clean.go:80
|
||||
msgid "Do you want to remove all other AUR packages from cache?"
|
||||
msgstr "Voleu suprimir tots els altres paquets de l'AUR de la memòria cau?"
|
||||
|
||||
#: pkg/menus/edit_menu.go:61
|
||||
msgid "Edit PKGBUILD with?"
|
||||
msgstr "Amb què voleu editar el PKGBUILD?"
|
||||
|
||||
#: pkg/query/errors.go:13
|
||||
msgid "Error during AUR search: %s\n"
|
||||
msgstr "Error durant la cerca a l'AUR: %s\n"
|
||||
|
||||
#: pkg/upgrade/service.go:295
|
||||
msgid "Excluding packages may cause partial upgrades and break systems"
|
||||
msgstr ""
|
||||
"L'exclusió de paquets pot provocar actualitzacions parcials i trencar els "
|
||||
"sistemes."
|
||||
|
||||
#: pkg/dep/dep_graph.go:60
|
||||
msgid "Explicit"
|
||||
msgstr "Explícit"
|
||||
|
||||
#: print.go:91
|
||||
msgid "Explicitly installed packages: %s"
|
||||
msgstr "Paquets instal·lats explícitament: %s"
|
||||
|
||||
#: pkg/dep/dep_graph.go:437 pkg/dep/dep_graph.go:535
|
||||
msgid "Failed to find AUR package for"
|
||||
msgstr "No s'ha pogut trobar el paquet de l'AUR per a"
|
||||
|
||||
#: pkg/sync/build/installer.go:120
|
||||
msgid "Failed to install layer, rolling up to next layer."
|
||||
msgstr "Ha fallat instal·lar la capa. Es passa a la següent."
|
||||
|
||||
#: pkg/sync/build/errors.go:16
|
||||
msgid ""
|
||||
"Failed to install the following packages. Manual intervention is required:"
|
||||
msgstr "Ha fallat instal·lar els paquets següents. Cal intervenció manual:"
|
||||
|
||||
#: print.go:45
|
||||
msgid "First Submitted"
|
||||
msgstr "Enviat primer"
|
||||
|
||||
#: pkg/query/aur_warnings.go:83
|
||||
msgid "Flagged Out Of Date AUR Packages:"
|
||||
msgstr "Paquets de l'AUR obsolets marcats:"
|
||||
|
||||
#: print.go:90
|
||||
msgid "Foreign installed packages: %s"
|
||||
msgstr "Paquets forans instal·lats: %s"
|
||||
|
||||
#: pkg/vcs/vcs.go:144
|
||||
msgid "Found git repo: %s"
|
||||
msgstr "S'ha trobat el repositori git: %s"
|
||||
|
||||
#: vcs.go:72
|
||||
msgid "GenDB finished. No packages were installed"
|
||||
msgstr "GenDB ha acabat. No s'ha instal·lat cap paquet."
|
||||
|
||||
#: print.go:36
|
||||
msgid "Groups"
|
||||
msgstr "Grups"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:88
|
||||
msgid "Import?"
|
||||
msgstr "Ho importo?"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:97
|
||||
msgid "Importing keys with gpg..."
|
||||
msgstr "S'importen claus amb gpg..."
|
||||
|
||||
#: print.go:46
|
||||
msgid "Keywords"
|
||||
msgstr "Paraules clau"
|
||||
|
||||
#: print.go:47
|
||||
msgid "Last Modified"
|
||||
msgstr "Darrera modificació"
|
||||
|
||||
#: print.go:35
|
||||
msgid "Licenses"
|
||||
msgstr "Llicències"
|
||||
|
||||
#: pkg/dep/dep_graph.go:77
|
||||
msgid "Local"
|
||||
msgstr "Local"
|
||||
|
||||
#: print.go:48
|
||||
msgid "Maintainer"
|
||||
msgstr "Mantenidor"
|
||||
|
||||
#: pkg/dep/dep_graph.go:62
|
||||
msgid "Make Dependency"
|
||||
msgstr "Dependència de construcció"
|
||||
|
||||
#: print.go:40
|
||||
msgid "Make Deps"
|
||||
msgstr "Dependències de construcció"
|
||||
|
||||
#: pkg/dep/dep_graph.go:79
|
||||
msgid "Missing"
|
||||
msgstr "Manca"
|
||||
|
||||
#: pkg/query/aur_warnings.go:75
|
||||
msgid "Missing AUR Debug Packages:"
|
||||
msgstr "Manquen paquets de depuració de l'AUR:"
|
||||
|
||||
#: print.go:31
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#: pkg/dep/dep_graph.go:442 pkg/dep/dep_graph.go:548
|
||||
msgid "No AUR package found for"
|
||||
msgstr "No s'ha trobat cap paquet d'AUR per a"
|
||||
|
||||
#: pkg/dep/dep_graph.go:182
|
||||
msgid "No package found for"
|
||||
msgstr "No s'ha trobat cap paquet per"
|
||||
|
||||
#: print.go:225
|
||||
msgid "None"
|
||||
msgstr "Cap"
|
||||
|
||||
#: print.go:39
|
||||
msgid "Optional Deps"
|
||||
msgstr "Dependències opcionals"
|
||||
|
||||
#: pkg/query/aur_warnings.go:79
|
||||
msgid "Orphan (unmaintained) AUR Packages:"
|
||||
msgstr "Paquets d'AUR orfes (no mantinguts):"
|
||||
|
||||
#: print.go:53 print.go:55
|
||||
msgid "Out-of-date"
|
||||
msgstr "Obsolet"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:115
|
||||
msgid "PGP keys need importing:"
|
||||
msgstr "Cal importar claus PGP:"
|
||||
|
||||
#: pkg/sync/workdir/preparer.go:252
|
||||
msgid "PKGBUILD up to date, skipping download: %s"
|
||||
msgstr "PKGBUILD actualitzat, s'omet la baixada: %s"
|
||||
|
||||
#: pkg/menus/edit_menu.go:130
|
||||
msgid "PKGBUILDs to edit?"
|
||||
msgstr "PKGBUILDs per editar?"
|
||||
|
||||
#: print.go:61
|
||||
msgid "Package Base"
|
||||
msgstr "Base de paquets"
|
||||
|
||||
#: print.go:60
|
||||
msgid "Package Base ID"
|
||||
msgstr "ID de la base de paquets"
|
||||
|
||||
#: pkg/query/aur_warnings.go:71
|
||||
msgid "Packages not in AUR:"
|
||||
msgstr "Paquets no a l'AUR:"
|
||||
|
||||
#: pkg/menus/clean_menu.go:54
|
||||
msgid "Packages to cleanBuild?"
|
||||
msgstr "Paquets per a la neteja de la construcció?"
|
||||
|
||||
#: pkg/dep/dep_graph.go:202
|
||||
msgid "Packages to exclude"
|
||||
msgstr "Paquets per excloure"
|
||||
|
||||
#: pkg/upgrade/service.go:294
|
||||
msgid "Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"
|
||||
msgstr "Paquets per excloure: (p. ex.: \"1 2 3\", \"1-3\", \"^4\" o nom del repositori)"
|
||||
|
||||
#: cmd.go:392
|
||||
msgid "Packages to install (eg: 1 2 3, 1-3 or ^4)"
|
||||
msgstr "Paquets per instal·lar (p. ex.: 1 2 3, 1-3 o ^4)"
|
||||
|
||||
#: print.go:49
|
||||
msgid "Popularity"
|
||||
msgstr "Popularitat"
|
||||
|
||||
#: pkg/menus/diff_menu.go:172 pkg/menus/edit_menu.go:143
|
||||
msgid "Proceed with install?"
|
||||
msgstr "Voleu continuar la instal·lació?"
|
||||
|
||||
#: print.go:37
|
||||
msgid "Provides"
|
||||
msgstr "Proporciona"
|
||||
|
||||
#: pkg/sync/workdir/preparer.go:125
|
||||
msgid "Remove make dependencies after install?"
|
||||
msgstr ""
|
||||
"Suprimeixo les dependències de construcció després de la instal·lació?"
|
||||
|
||||
#: print.go:43
|
||||
msgid "Replaces"
|
||||
msgstr "Reemplaça"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:191 print.go:30
|
||||
msgid "Repository"
|
||||
msgstr "Repositori"
|
||||
|
||||
#: pkg/dep/dep_graph.go:730
|
||||
msgid "Repository AUR"
|
||||
msgstr "Repositori de l'AUR"
|
||||
|
||||
#: pkg/dep/dep_graph.go:78
|
||||
msgid "SRCINFO"
|
||||
msgstr "SRCINFO"
|
||||
|
||||
#: pkg/upgrade/service.go:71
|
||||
msgid "Searching AUR for updates..."
|
||||
msgstr "Se cerquen actualitzacions a l'AUR..."
|
||||
|
||||
#: pkg/upgrade/service.go:159
|
||||
msgid "Searching databases for updates..."
|
||||
msgstr "Se cerquen actualitzacions a les bases de dades..."
|
||||
|
||||
#: pkg/query/query_builder.go:214
|
||||
msgid "Showing repo packages only"
|
||||
msgstr "Es mostren només paquets dels repositoris."
|
||||
|
||||
#: print.go:95
|
||||
msgid "Size of pacman cache %s: %s"
|
||||
msgstr "Mida de la memòria cau del pacman %s: %s"
|
||||
|
||||
#: print.go:98
|
||||
msgid "Size of yay cache %s: %s"
|
||||
msgstr "Mida de la memòria cau del yay %s: %s"
|
||||
|
||||
#: print.go:62
|
||||
msgid "Snapshot URL"
|
||||
msgstr "URL de la instantània"
|
||||
|
||||
#: pkg/dep/dep_graph.go:76
|
||||
msgid "Sync"
|
||||
msgstr "Sincronització"
|
||||
|
||||
#: print.go:100
|
||||
msgid "Ten biggest packages:"
|
||||
msgstr "Els deu paquets més grossos:"
|
||||
|
||||
#: pkg/sync/sync.go:124
|
||||
msgid "The following packages are not compatible with your architecture:"
|
||||
msgstr "Els paquets següents no són compatibles amb la vostra arquitectura:"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:179 pkg/dep/dep_graph.go:726
|
||||
msgid "There are %[1]d providers available for %[2]s:"
|
||||
msgstr "Hi ha %[1]d proveïdors disponibles per a %[2]s:"
|
||||
|
||||
#: pkg/settings/exe/cmd_builder.go:258
|
||||
msgid "There may be another Pacman instance running. Waiting..."
|
||||
msgstr ""
|
||||
"Pot ser que hi hagi una altra instància del Pacman en execució. S'espera..."
|
||||
|
||||
#: print.go:92
|
||||
msgid "Total Size occupied by packages: %s"
|
||||
msgstr "Mida total ocupada pels paquets: %s"
|
||||
|
||||
#: print.go:89
|
||||
msgid "Total installed packages: %s"
|
||||
msgstr "Total de paquets instal·lats: %s"
|
||||
|
||||
#: pkg/sync/sync.go:132
|
||||
msgid "Try to build them anyway?"
|
||||
msgstr "Intento construir-los tanmateix?"
|
||||
|
||||
#: print.go:34
|
||||
msgid "URL"
|
||||
msgstr "URL"
|
||||
|
||||
#: clean.go:194 pkg/menus/clean_menu.go:65 pkg/menus/clean_menu.go:71
|
||||
msgid "Unable to clean:"
|
||||
msgstr "No es pot netejar:"
|
||||
|
||||
#: get.go:42 get.go:74
|
||||
msgid "Unable to find the following packages:"
|
||||
msgstr "No s'han pogut trobar els paquets següents:"
|
||||
|
||||
#: vote.go:20
|
||||
msgid "Unable to handle package vote for: %s. err: %s"
|
||||
msgstr "No es pot gestionar el vot del paquet per a %s. Error: %s"
|
||||
|
||||
#: clean.go:170
|
||||
msgid "Unable to remove %s: %s"
|
||||
msgstr "No es pot suprimir %s: %s"
|
||||
|
||||
#: print.go:32
|
||||
msgid "Version"
|
||||
msgstr "Versió"
|
||||
|
||||
#: print.go:50
|
||||
msgid "Votes"
|
||||
msgstr "Vots"
|
||||
|
||||
#: print.go:87
|
||||
msgid "Yay version v%s"
|
||||
msgstr "Versió del yay: v%s"
|
||||
|
||||
#: pkg/menus/menu.go:49
|
||||
msgid "[N]one"
|
||||
msgstr "Ca[p]"
|
||||
|
||||
#: pkg/settings/errors.go:29
|
||||
msgid "aborting due to user"
|
||||
msgstr "s'avorta a causa de l'usuari"
|
||||
|
||||
#: pkg/settings/parser/parser.go:608
|
||||
msgid "argument '-' specified without input on stdin"
|
||||
msgstr "argument '-' especificat sense entrada a stdin"
|
||||
|
||||
#: local_install.go:26
|
||||
msgid "cannot find PKGBUILD and .SRCINFO in directory"
|
||||
msgstr "no es pot trobar PKGBUILD i SRCINFO al directori"
|
||||
|
||||
#: pkg/sync/build/pkg_archive.go:148
|
||||
msgid "cannot find package name: %v"
|
||||
msgstr "no es pot trobar el nom del paquet: %v"
|
||||
|
||||
#: pkg/sync/build/errors.go:30
|
||||
msgid "could not find PKGDEST for: %s"
|
||||
msgstr "no s'ha pogut trobar PKGDEST per a %s"
|
||||
|
||||
#: errors.go:9
|
||||
msgid "could not find all required packages"
|
||||
msgstr "no s'han pogut trobar tots els paquets necessaris"
|
||||
|
||||
#: pkg/sync/build/errors.go:61
|
||||
msgid "could not find any package archives listed in %s"
|
||||
msgstr "no s'ha pogut trobar cap arxiu de paquets llistat a %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:50 pkg/upgrade/service.go:286
|
||||
msgid "dependency"
|
||||
msgstr "dependència"
|
||||
|
||||
#: pkg/vcs/vcs.go:100 pkg/vcs/vcs.go:96
|
||||
msgid "devel check for package failed: '%s' encountered an error"
|
||||
msgstr "la comprovació del paquet ha fallat: %s ha trobat un error"
|
||||
|
||||
#: pkg/menus/edit_menu.go:110
|
||||
msgid "editor did not exit successfully, aborting: %s"
|
||||
msgstr "l'editor no ha sortit correctament, s'avorta: %s"
|
||||
|
||||
#: pkg/sync/workdir/aur_source.go:24
|
||||
msgid "error downloading sources: %s"
|
||||
msgstr "error en baixar les fonts: %s"
|
||||
|
||||
#: pkg/download/errors.go:25
|
||||
msgid "error fetching %s: %s"
|
||||
msgstr "error en obtenir %s: %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:9
|
||||
msgid "error installing repo packages"
|
||||
msgstr "error en instal·lar paquets dels repositoris"
|
||||
|
||||
#: pkg/sync/build/installer.go:266 pkg/sync/build/installer.go:270
|
||||
msgid "error installing:"
|
||||
msgstr "error d'instal·lació:"
|
||||
|
||||
#: pkg/sync/build/installer.go:233 pkg/sync/build/installer.go:237
|
||||
msgid "error making: %s"
|
||||
msgstr "error de construcció: %s"
|
||||
|
||||
#: pkg/sync/workdir/merge.go:24
|
||||
msgid "error merging %s: %s"
|
||||
msgstr "error en combinar %s: %s"
|
||||
|
||||
#: pkg/download/unified.go:59
|
||||
msgid "error reading %s"
|
||||
msgstr "error en llegir %s"
|
||||
|
||||
#: sync.go:36
|
||||
msgid "error refreshing databases"
|
||||
msgstr "error en actualitzar les bases de dades"
|
||||
|
||||
#: pkg/sync/workdir/clean.go:51 pkg/sync/workdir/merge.go:17
|
||||
msgid "error resetting %s: %s"
|
||||
msgstr "error en restablir %s: %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:53
|
||||
msgid "error updating package install reason to %s"
|
||||
msgstr "error en actualitzar el motiu d'instal·lació del paquet a %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:48
|
||||
msgid "explicit"
|
||||
msgstr "explícit"
|
||||
|
||||
#: pkg/settings/errors.go:23
|
||||
msgid "failed to create directory '%s': %s"
|
||||
msgstr "ha fallat crear el directori %s: %s"
|
||||
|
||||
#: pkg/settings/config.go:281
|
||||
msgid "failed to open config file '%s': %s"
|
||||
msgstr "ha fallat obrir el fitxer de configuració %s: %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:114
|
||||
msgid "failed to parse %s -- skipping: %s"
|
||||
msgstr "ha fallat analitzar %s, s'omet: %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:118
|
||||
msgid "failed to parse %s: %s"
|
||||
msgstr "no s'ha pogut analitzar %s: %s"
|
||||
|
||||
#: local_install.go:77
|
||||
msgid "failed to parse .SRCINFO"
|
||||
msgstr "ha fallat analitzar .SRCINFO"
|
||||
|
||||
#: pkg/settings/config.go:291
|
||||
msgid "failed to read config file '%s': %s"
|
||||
msgstr "ha fallat llegir el fitxer de configuració %s: %s"
|
||||
|
||||
#: pkg/cmd/graph/main.go:46 pkg/runtime/runtime.go:73
|
||||
msgid "failed to retrieve aur Cache"
|
||||
msgstr "ha fallat obtenir la cau de l'AUR"
|
||||
|
||||
#: pkg/upgrade/sources.go:27
|
||||
msgid "ignoring package devel upgrade (no AUR info found):"
|
||||
msgstr ""
|
||||
"s'ignora l'actualització del paquet de desenvolupament (no se n'ha trobat "
|
||||
"cap informació a l'AUR):"
|
||||
|
||||
#: pkg/text/errors.go:8
|
||||
msgid "input too long"
|
||||
msgstr "entrada massa llarga"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:222 pkg/dep/dep_graph.go:761
|
||||
msgid "invalid number: %s"
|
||||
msgstr "número no vàlid: %s"
|
||||
|
||||
#: pkg/settings/parser/parser.go:174
|
||||
msgid "invalid option '%s'"
|
||||
msgstr "opció no vàlida: %s"
|
||||
|
||||
#: cmd.go:197
|
||||
msgid "invalid option: '--deps' and '--explicit' may not be used together"
|
||||
msgstr "opció no vàlida: \"--deps\" i \"--explicit\" no es poden usar juntes"
|
||||
|
||||
#: pkg/download/abs.go:22
|
||||
msgid "invalid repository"
|
||||
msgstr "repositori no vàlid"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:227 pkg/dep/dep_graph.go:767
|
||||
msgid "invalid value: %d is not between %d and %d"
|
||||
msgstr "valor no vàlid: %d no és entre %d i %d"
|
||||
|
||||
#: pkg/text/input.go:48
|
||||
msgid "no"
|
||||
msgstr "no"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:110
|
||||
msgid "no keys to import"
|
||||
msgstr "sense claus per importar"
|
||||
|
||||
#: pkg/query/errors.go:20
|
||||
msgid "no query was executed"
|
||||
msgstr "no s'ha executat cap consulta"
|
||||
|
||||
#: local_install.go:66
|
||||
msgid "no target directories specified"
|
||||
msgstr "no s'han especificat directoris de destinació"
|
||||
|
||||
#: pkg/sync/build/installer.go:242
|
||||
msgid "nothing to install for %s"
|
||||
msgstr "no hi ha res per instal·lar per %s"
|
||||
|
||||
#: pkg/settings/parser/parser.go:164
|
||||
msgid "only one operation may be used at a time"
|
||||
msgstr "només es pot usar una operació alhora"
|
||||
|
||||
#: pkg/cmd/graph/main.go:70
|
||||
msgid "only one target is allowed"
|
||||
msgstr "només es permet una destinació"
|
||||
|
||||
#: pkg/upgrade/service.go:291
|
||||
msgid "package"
|
||||
msgid_plural "packages"
|
||||
msgstr[0] "paquet"
|
||||
msgstr[1] "paquets"
|
||||
|
||||
#: print.go:187
|
||||
msgid "package '%s' was not found"
|
||||
msgstr "no s'ha trobat el paquet %s"
|
||||
|
||||
#: pkg/download/errors.go:15
|
||||
msgid "package not found in AUR"
|
||||
msgstr "paquet no trobat a l'AUR"
|
||||
|
||||
#: pkg/download/abs.go:23
|
||||
msgid "package not found in repos"
|
||||
msgstr "paquet no trobat als repositoris"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:100
|
||||
msgid "problem importing keys"
|
||||
msgstr "problema d'importació de claus"
|
||||
|
||||
#: clean.go:105
|
||||
msgid "removing AUR packages from cache..."
|
||||
msgstr "se suprimeixen paquets de l'AUR de la memòria cau..."
|
||||
|
||||
#: clean.go:178 pkg/sync/workdir/clean.go:41
|
||||
msgid "removing untracked AUR files from cache..."
|
||||
msgstr ""
|
||||
"se suprimeixen els fitxers de l'AUR sense seguiment de la memòria cau..."
|
||||
|
||||
#: pkg/sync/build/errors.go:38
|
||||
msgid "the PKGDEST for %s is listed by makepkg but does not exist: %s"
|
||||
msgstr "el PKGDEST per a %s està llistat per makepkg però no existeix:%s"
|
||||
|
||||
#: pkg/sync/sync.go:45
|
||||
msgid "there is nothing to do"
|
||||
msgstr "No hi ha res per fer."
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:247
|
||||
msgid "unable to CreateHandle: %s"
|
||||
msgstr "no se'n pot crear el maneig: %s"
|
||||
|
||||
#: cmd.go:186
|
||||
msgid "unhandled operation"
|
||||
msgstr "operació no manejada"
|
||||
|
||||
#: cmd.go:450
|
||||
msgid "unknown-version"
|
||||
msgstr "versió desconeguda"
|
||||
|
||||
#: pkg/text/input.go:47
|
||||
msgid "yes"
|
||||
msgstr "sí"
|
408
po/cs.po
408
po/cs.po
@ -1,13 +1,13 @@
|
||||
#
|
||||
#
|
||||
# Translators:
|
||||
# Fjuro Fjuro, 2022
|
||||
# a30a45d5047eb877c4dc397ded846f36_1de9be1, 2023
|
||||
# walken, 2023
|
||||
# Matej Borsky, 2023
|
||||
# Matyáš Černý, 2023
|
||||
# walken, 2024
|
||||
#
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Last-Translator: walken, 2024\n"
|
||||
"Last-Translator: Matyáš Černý, 2023\n"
|
||||
"Language-Team: Czech (https://app.transifex.com/yay-1/teams/123732/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -16,53 +16,57 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
|
||||
"X-Generator: xgotext\n"
|
||||
|
||||
#: pkg/menus/menu.go:32
|
||||
#: pkg/menus/menu.go:31
|
||||
msgid " (Build Files Exist)"
|
||||
msgstr "(Soubory sestavení existují)"
|
||||
|
||||
#: pkg/menus/menu.go:27
|
||||
#: pkg/menus/menu.go:26
|
||||
msgid " (Installed)"
|
||||
msgstr "(Nainstalováno)"
|
||||
|
||||
#: cmd.go:453
|
||||
#: pkg/dep/depCheck.go:310
|
||||
msgid " (Target"
|
||||
msgstr "(Cíl"
|
||||
|
||||
#: pkg/dep/depCheck.go:312
|
||||
msgid " (Wanted by: "
|
||||
msgstr "(Požaduje:"
|
||||
|
||||
#: cmd.go:472
|
||||
msgid " [Installed]"
|
||||
msgstr "[Nainstalováno]"
|
||||
|
||||
#: cmd.go:410 vote.go:36
|
||||
#: cmd.go:425 install.go:172 install.go:206 vote.go:34
|
||||
msgid " there is nothing to do"
|
||||
msgstr "není co dělat"
|
||||
|
||||
#: pkg/menus/menu.go:49
|
||||
#: pkg/menus/menu.go:48
|
||||
msgid "%s [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)"
|
||||
msgstr ""
|
||||
"%s [A]Vše [Ab]Zrušit [I]Nainstalováno [No]Nenainstalováno nebo (1 2 3, 1-3, "
|
||||
"^4)"
|
||||
|
||||
#: pkg/sync/build/installer.go:308
|
||||
#: aur_install.go:274 install.go:741
|
||||
msgid "%s already made -- skipping build"
|
||||
msgstr "%sjiž existuje -- přeskakuji sestavení"
|
||||
|
||||
#: pkg/menus/edit_menu.go:57
|
||||
#: pkg/menus/edit_menu.go:58
|
||||
msgid "%s is not set"
|
||||
msgstr "%s není nastaven"
|
||||
|
||||
#: pkg/settings/exe/cmd_builder.go:257
|
||||
#: pkg/settings/exe/cmd_builder.go:238
|
||||
msgid "%s is present."
|
||||
msgstr "%s je přítomný"
|
||||
|
||||
#: pkg/dep/dep_graph.go:460 pkg/sync/build/installer.go:305
|
||||
#: pkg/dep/dep_graph.go:385 aur_install.go:271 install.go:727
|
||||
msgid "%s is up to date -- skipping"
|
||||
msgstr "%s je aktualizován -- přeskakuji"
|
||||
|
||||
#: pkg/upgrade/service.go:292
|
||||
msgid "%s to upgrade/install."
|
||||
msgstr " %s k povýšení/instalaci."
|
||||
#: install.go:642
|
||||
msgid "%s not satisfied, flushing install queue"
|
||||
msgstr "%s není uspokojen, vymazávání fronty instalací"
|
||||
|
||||
#: pkg/upgrade/service.go:286
|
||||
msgid "%s will also be installed for this operation."
|
||||
msgstr "%s bude také nainstalován pro tuto operaci. "
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:124
|
||||
#: pkg/pgp/keys.go:127
|
||||
msgid "%s, required by: %s"
|
||||
msgstr "%s, vyžadován balíčkem %s"
|
||||
|
||||
@ -78,15 +82,15 @@ msgstr "%s: nelze použít cíl s možností --aur -- přeskakuji"
|
||||
msgid "%s: can't use target with option --repo -- skipping"
|
||||
msgstr "%s: nelze použít cíl s možností --repo -- přeskakuji"
|
||||
|
||||
#: pkg/upgrade/sources.go:57
|
||||
#: pkg/upgrade/sources.go:60
|
||||
msgid "%s: ignoring package upgrade (%s => %s)"
|
||||
msgstr "%s: ignoruji aktualizaci balíčku (%s => %s)"
|
||||
|
||||
#: pkg/query/aur_warnings.go:46
|
||||
#: upgrade.go:165
|
||||
msgid "%s: local (%s) is newer than AUR (%s)"
|
||||
msgstr "%s: místní (%s) je novější než AUR (%s) "
|
||||
|
||||
#: vote.go:51
|
||||
#: vote.go:49
|
||||
msgid ""
|
||||
"%s: please set AUR_USERNAME and AUR_PASSWORD environment variables for "
|
||||
"voting"
|
||||
@ -97,43 +101,39 @@ msgstr ""
|
||||
msgid "(%d/%d) Downloaded PKGBUILD from ABS: %s"
|
||||
msgstr "(%d/%d) Stažen PKGBUILD z ABS: %s"
|
||||
|
||||
#: pkg/download/aur.go:92 pkg/download/unified.go:188
|
||||
#: pkg/download/aur.go:84 pkg/download/unified.go:188
|
||||
msgid "(%d/%d) Downloaded PKGBUILD: %s"
|
||||
msgstr "(%d/%d) Stažen PKGBUILD: %s"
|
||||
|
||||
#: pkg/download/aur.go:82
|
||||
msgid "(%d/%d) Failed to download PKGBUILD: %s"
|
||||
msgstr "(%d/%d) Nepodařilo se stáhnout PKGBUILD\\: %s "
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:109
|
||||
#: pkg/srcinfo/service.go:108
|
||||
msgid "(%d/%d) Parsing SRCINFO: %s"
|
||||
msgstr "(%d/%d) Parsování SRCINFO: %s"
|
||||
|
||||
#: pkg/query/types.go:72 pkg/query/types.go:103
|
||||
#: pkg/query/types.go:70 pkg/query/types.go:101
|
||||
msgid "(Installed)"
|
||||
msgstr "(Nainstalováno)"
|
||||
|
||||
#: pkg/query/types.go:70 pkg/query/types.go:101
|
||||
#: pkg/query/types.go:68 pkg/query/types.go:99
|
||||
msgid "(Installed: %s)"
|
||||
msgstr "(Nainstalováno: %s)"
|
||||
|
||||
#: pkg/query/types.go:61
|
||||
#: pkg/query/types.go:59
|
||||
msgid "(Orphaned)"
|
||||
msgstr "(Osamocené)"
|
||||
|
||||
#: pkg/query/types.go:65
|
||||
#: pkg/query/types.go:63
|
||||
msgid "(Out-of-date: %s)"
|
||||
msgstr "(Zastaralé: %s)"
|
||||
|
||||
#: print.go:44
|
||||
#: print.go:31
|
||||
msgid "AUR URL"
|
||||
msgstr "URL AUR"
|
||||
|
||||
#: pkg/dep/dep_graph.go:75
|
||||
#: pkg/dep/dep_graph.go:74
|
||||
msgid "AUR"
|
||||
msgstr "AUR"
|
||||
|
||||
#: pkg/menus/edit_menu.go:58
|
||||
#: pkg/menus/edit_menu.go:59
|
||||
msgid "Add %s or %s to your environment variables"
|
||||
msgstr "Přidejte %s nebo %s do svých proměnných prostředí "
|
||||
|
||||
@ -141,43 +141,55 @@ msgstr "Přidejte %s nebo %s do svých proměnných prostředí "
|
||||
msgid "Avoid running yay as root/sudo."
|
||||
msgstr "Vyhněte se spuštění yay jako root/sudo."
|
||||
|
||||
#: pkg/dep/dep_graph.go:63
|
||||
#: pkg/dep/dep_graph.go:62
|
||||
msgid "Check Dependency"
|
||||
msgstr "Zkontrolovat závislost"
|
||||
|
||||
#: print.go:41
|
||||
#: print.go:37
|
||||
msgid "Check Deps"
|
||||
msgstr "Zkontrolovat závislosti"
|
||||
|
||||
#: pkg/upgrade/service.go:90
|
||||
#: pkg/upgrade/service.go:78 upgrade.go:95
|
||||
msgid "Checking development packages..."
|
||||
msgstr "Kontrola vývojových balíčků..."
|
||||
|
||||
#: pkg/sync/workdir/clean.go:45
|
||||
#: pkg/dep/depCheck.go:137
|
||||
msgid "Checking for conflicts..."
|
||||
msgstr "Kontrola konfliktů..."
|
||||
|
||||
#: pkg/dep/depCheck.go:145
|
||||
msgid "Checking for inner conflicts..."
|
||||
msgstr "Kontrola vnitřních konfliktů..."
|
||||
|
||||
#: clean.go:214
|
||||
msgid "Cleaning (%d/%d): %s"
|
||||
msgstr "Čištění (%d/%d): %s"
|
||||
|
||||
#: print.go:42
|
||||
#: pkg/dep/depCheck.go:200
|
||||
msgid "Conflicting packages will have to be confirmed manually"
|
||||
msgstr "Konfliktní balíčky budou muset být ručně potvrzeny"
|
||||
|
||||
#: print.go:39
|
||||
msgid "Conflicts With"
|
||||
msgstr "Konflikt s"
|
||||
|
||||
#: pkg/menus/clean_menu.go:62
|
||||
#: pkg/menus/clean_menu.go:61 pkg/menus/clean_menu.go:108
|
||||
msgid "Deleting (%d/%d): %s"
|
||||
msgstr "Mazání (%d/%d): %s"
|
||||
|
||||
#: pkg/dep/dep_graph.go:61
|
||||
#: pkg/dep/dep_graph.go:60
|
||||
msgid "Dependency"
|
||||
msgstr "Závislost"
|
||||
|
||||
#: print.go:38
|
||||
#: print.go:35
|
||||
msgid "Depends On"
|
||||
msgstr "Závisí na"
|
||||
|
||||
#: print.go:33
|
||||
#: print.go:29
|
||||
msgid "Description"
|
||||
msgstr "Popis"
|
||||
|
||||
#: pkg/menus/diff_menu.go:160
|
||||
#: pkg/menus/diff_menu.go:161 pkg/menus/diff_menu.go:194
|
||||
msgid "Diffs to show?"
|
||||
msgstr "Zobrazit rozdíly?"
|
||||
|
||||
@ -185,19 +197,19 @@ msgstr "Zobrazit rozdíly?"
|
||||
msgid "Disable 'provides' setting by default"
|
||||
msgstr "Zákaz nastavení 'provides' jako výchozí"
|
||||
|
||||
#: clean.go:78
|
||||
#: clean.go:79
|
||||
msgid "Do you want to remove ALL AUR packages from cache?"
|
||||
msgstr "Chcete odstranit VŠECHNY balíčky AUR z mezipaměti?"
|
||||
|
||||
#: clean.go:95
|
||||
#: clean.go:96
|
||||
msgid "Do you want to remove ALL untracked AUR files?"
|
||||
msgstr "Chcete odstranit VŠECHNY nesledované soubory AUR?"
|
||||
|
||||
#: clean.go:80
|
||||
#: clean.go:81
|
||||
msgid "Do you want to remove all other AUR packages from cache?"
|
||||
msgstr "Chcete odstranit všechny ostatní balíčky AUR z mezipaměti?"
|
||||
|
||||
#: pkg/menus/edit_menu.go:61
|
||||
#: pkg/menus/edit_menu.go:62
|
||||
msgid "Edit PKGBUILD with?"
|
||||
msgstr "Upravit PKGBUILD pomocí?"
|
||||
|
||||
@ -205,293 +217,314 @@ msgstr "Upravit PKGBUILD pomocí?"
|
||||
msgid "Error during AUR search: %s\n"
|
||||
msgstr "Chyby při hledání v AUR: %s\n"
|
||||
|
||||
#: pkg/upgrade/service.go:296
|
||||
#: pkg/upgrade/service.go:256
|
||||
msgid "Excluding packages may cause partial upgrades and break systems"
|
||||
msgstr ""
|
||||
"Vyjímání balíčků může způsobovat částečné aktualizace a rozbíjet systémy."
|
||||
|
||||
#: pkg/dep/dep_graph.go:60
|
||||
#: pkg/dep/dep_graph.go:59
|
||||
msgid "Explicit"
|
||||
msgstr "Explicitní"
|
||||
|
||||
#: print.go:91
|
||||
#: print.go:84
|
||||
msgid "Explicitly installed packages: %s"
|
||||
msgstr "Explicitně nainstalované balíčky: %s"
|
||||
|
||||
#: pkg/dep/dep_graph.go:437 pkg/dep/dep_graph.go:535
|
||||
#: pkg/dep/dep_graph.go:365 pkg/dep/dep_graph.go:454
|
||||
msgid "Failed to find AUR package for"
|
||||
msgstr "Chyba hledání balíčku AUR:"
|
||||
|
||||
#: pkg/sync/build/installer.go:120
|
||||
#: aur_install.go:104
|
||||
msgid "Failed to install layer, rolling up to next layer."
|
||||
msgstr "Chyba instalace vrstvy, zabaluji k další vrstvě."
|
||||
|
||||
#: pkg/sync/build/errors.go:16
|
||||
#: errors.go:55
|
||||
msgid ""
|
||||
"Failed to install the following packages. Manual intervention is required:"
|
||||
msgstr "Selhala instalace těchto balíčků. Ruční zásah je vyžadován."
|
||||
|
||||
#: print.go:45
|
||||
#: print.go:43
|
||||
msgid "First Submitted"
|
||||
msgstr "První odeslané"
|
||||
|
||||
#: pkg/query/aur_warnings.go:79
|
||||
#: pkg/query/aur_warnings.go:43
|
||||
msgid "Flagged Out Of Date AUR Packages:"
|
||||
msgstr "Označené zastaralé balíčky AUR:"
|
||||
|
||||
#: print.go:90
|
||||
#: print.go:83
|
||||
msgid "Foreign installed packages: %s"
|
||||
msgstr "Neznámé nainstalované balíčky: %s"
|
||||
|
||||
#: pkg/vcs/vcs.go:144
|
||||
#: pkg/vcs/vcs.go:142
|
||||
msgid "Found git repo: %s"
|
||||
msgstr "Nalezen repozitář git: %s"
|
||||
|
||||
#: vcs.go:72
|
||||
#: vcs.go:73
|
||||
msgid "GenDB finished. No packages were installed"
|
||||
msgstr "GenDB dokončena. Nebyly nainstalovány žádné balíčky"
|
||||
|
||||
#: print.go:36
|
||||
#: print.go:32
|
||||
msgid "Groups"
|
||||
msgstr "Skupiny"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:88
|
||||
#: pkg/pgp/keys.go:91
|
||||
msgid "Import?"
|
||||
msgstr "Importovat?"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:97
|
||||
#: pkg/pgp/keys.go:100
|
||||
msgid "Importing keys with gpg..."
|
||||
msgstr "Importování klíčů pomocí gpg..."
|
||||
|
||||
#: print.go:46
|
||||
#: pkg/dep/depCheck.go:155
|
||||
msgid "Inner conflicts found:"
|
||||
msgstr "Nalezeny vnitřní konflikty:"
|
||||
|
||||
#: pkg/dep/depCheck.go:173
|
||||
msgid "Installing %s will remove:"
|
||||
msgstr "Instalací %s odstraníte:"
|
||||
|
||||
#: print.go:27
|
||||
msgid "Keywords"
|
||||
msgstr "Klíčová slova"
|
||||
|
||||
#: print.go:47
|
||||
#: print.go:44
|
||||
msgid "Last Modified"
|
||||
msgstr "Naposledy upraveno"
|
||||
|
||||
#: print.go:35
|
||||
#: print.go:33
|
||||
msgid "Licenses"
|
||||
msgstr "Licence"
|
||||
|
||||
#: pkg/dep/dep_graph.go:77
|
||||
#: pkg/dep/dep_graph.go:76
|
||||
msgid "Local"
|
||||
msgstr "Místní"
|
||||
|
||||
#: print.go:48
|
||||
#: print.go:40
|
||||
msgid "Maintainer"
|
||||
msgstr "Správce"
|
||||
|
||||
#: pkg/dep/dep_graph.go:62
|
||||
#: pkg/dep/dep_graph.go:61
|
||||
msgid "Make Dependency"
|
||||
msgstr "Závislosti pro sestavení"
|
||||
|
||||
#: print.go:40
|
||||
#: print.go:36
|
||||
msgid "Make Deps"
|
||||
msgstr "Vytvořit závislosti"
|
||||
|
||||
#: pkg/query/aur_warnings.go:71
|
||||
#: pkg/query/aur_warnings.go:33
|
||||
msgid "Missing AUR Debug Packages:"
|
||||
msgstr "Chybějící ladicí balíčky AUR:"
|
||||
|
||||
#: pkg/dep/dep_graph.go:79
|
||||
#: pkg/dep/dep_graph.go:78
|
||||
msgid "Missing"
|
||||
msgstr "Chybějící"
|
||||
|
||||
#: print.go:31
|
||||
#: print.go:26
|
||||
msgid "Name"
|
||||
msgstr "Název"
|
||||
|
||||
#: pkg/dep/dep_graph.go:442 pkg/dep/dep_graph.go:548
|
||||
#: pkg/dep/dep_graph.go:370 pkg/dep/dep_graph.go:467
|
||||
msgid "No AUR package found for"
|
||||
msgstr "AUR balíček nenalezen pro"
|
||||
|
||||
#: pkg/dep/dep_graph.go:182
|
||||
msgid "No package found for"
|
||||
msgstr "Nebyly nalezeny žádné balíčky pro"
|
||||
|
||||
#: print.go:225
|
||||
#: pkg/text/print.go:117
|
||||
msgid "None"
|
||||
msgstr "Žádné"
|
||||
|
||||
#: print.go:39
|
||||
#: print.go:38
|
||||
msgid "Optional Deps"
|
||||
msgstr "Volitelné závislosti"
|
||||
|
||||
#: pkg/query/aur_warnings.go:75
|
||||
#: pkg/query/aur_warnings.go:38
|
||||
msgid "Orphan (unmaintained) AUR Packages:"
|
||||
msgstr "Osamocené (neudržované) balíčky AUR:"
|
||||
|
||||
#: print.go:53 print.go:55
|
||||
#: print.go:47 print.go:49
|
||||
msgid "Out-of-date"
|
||||
msgstr "Zastaralé"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:115
|
||||
#: pkg/pgp/keys.go:118
|
||||
msgid "PGP keys need importing:"
|
||||
msgstr "Je třeba importovat klíče PGP:"
|
||||
|
||||
#: pkg/sync/workdir/preparer.go:252
|
||||
#: install.go:265 vcs.go:46
|
||||
msgid "PKGBUILD up to date, Skipping (%d/%d): %s"
|
||||
msgstr "PKGBUILD je aktuální, přeskakuji (%d/%d): %s"
|
||||
|
||||
#: preparer.go:226
|
||||
msgid "PKGBUILD up to date, skipping download: %s"
|
||||
msgstr "PKGBUILD je aktuální, přeskakuji: %s"
|
||||
|
||||
#: pkg/menus/edit_menu.go:130
|
||||
#: pkg/menus/edit_menu.go:132 pkg/menus/edit_menu.go:164
|
||||
msgid "PKGBUILDs to edit?"
|
||||
msgstr "PKGBUILDy k upravení?"
|
||||
|
||||
#: print.go:60
|
||||
#: print.go:54
|
||||
msgid "Package Base ID"
|
||||
msgstr "Základní ID aplikace"
|
||||
|
||||
#: print.go:61
|
||||
#: print.go:55
|
||||
msgid "Package Base"
|
||||
msgstr "Základ aplikace"
|
||||
|
||||
#: pkg/query/aur_warnings.go:67
|
||||
#: pkg/dep/depCheck.go:170
|
||||
msgid "Package conflicts found:"
|
||||
msgstr "Nalezeny konflikty balíčků:"
|
||||
|
||||
#: pkg/query/aur_warnings.go:28
|
||||
msgid "Packages not in AUR:"
|
||||
msgstr "Balíčky mimo AUR:"
|
||||
|
||||
#: pkg/menus/clean_menu.go:54
|
||||
#: pkg/menus/clean_menu.go:53 pkg/menus/clean_menu.go:100
|
||||
msgid "Packages to cleanBuild?"
|
||||
msgstr "Balíčky ke cleanBuild?"
|
||||
|
||||
#: pkg/dep/dep_graph.go:202
|
||||
#: pkg/dep/dep_graph.go:215 upgrade.go:213
|
||||
msgid "Packages to exclude"
|
||||
msgstr "Balíčky k vyjmutí."
|
||||
|
||||
#: pkg/upgrade/service.go:295
|
||||
#: pkg/upgrade/service.go:255
|
||||
msgid "Packages to exclude: (eg: \"1 2 3\", \"1-3\", \"^4\" or repo name)"
|
||||
msgstr "Balíčky k vyloučení: (např.: \"1 2 3\", \"1-3\", \"^4\" nebo název repozitáře)"
|
||||
|
||||
#: cmd.go:392
|
||||
#: cmd.go:406
|
||||
msgid "Packages to install (eg: 1 2 3, 1-3 or ^4)"
|
||||
msgstr "Balíčky k instalaci (např.: 1 2 3, 1-3 nebo ^4)"
|
||||
|
||||
#: print.go:49
|
||||
#: upgrade.go:210
|
||||
msgid "Packages to upgrade."
|
||||
msgstr "Balíčky k aktualizaci"
|
||||
|
||||
#: pkg/upgrade/service.go:252
|
||||
msgid "Packages to upgrade/install."
|
||||
msgstr "Balíčky k aktualizaci/instalaci."
|
||||
|
||||
#: print.go:42
|
||||
msgid "Popularity"
|
||||
msgstr "Popularita"
|
||||
|
||||
#: pkg/menus/diff_menu.go:172 pkg/menus/edit_menu.go:143
|
||||
#: pkg/menus/diff_menu.go:173 pkg/menus/diff_menu.go:206
|
||||
#: pkg/menus/edit_menu.go:143 pkg/menus/edit_menu.go:177
|
||||
msgid "Proceed with install?"
|
||||
msgstr "Pokračovat v instalaci?"
|
||||
|
||||
#: print.go:37
|
||||
#: print.go:34
|
||||
msgid "Provides"
|
||||
msgstr "Poskytuje"
|
||||
|
||||
#: pkg/sync/workdir/preparer.go:125
|
||||
#: pkg/query/aur_info.go:89
|
||||
msgid "Querying AUR..."
|
||||
msgstr "Prohledávání AUR..."
|
||||
|
||||
#: install.go:236 preparer.go:108
|
||||
msgid "Remove make dependencies after install?"
|
||||
msgstr "Odstranit vytvořené závislosti po instalaci?"
|
||||
|
||||
#: print.go:43
|
||||
msgid "Replaces"
|
||||
msgstr "Nahrazuje"
|
||||
|
||||
#: pkg/dep/dep_graph.go:730
|
||||
#: pkg/dep/depPool.go:503 pkg/dep/dep_graph.go:631
|
||||
msgid "Repository AUR"
|
||||
msgstr "Repozitář AUR"
|
||||
|
||||
#: print.go:30 pkg/db/ialpm/alpm.go:191
|
||||
#: pkg/db/ialpm/alpm.go:191 print.go:25
|
||||
msgid "Repository"
|
||||
msgstr "Repozitář"
|
||||
|
||||
#: pkg/dep/dep_graph.go:78
|
||||
#: pkg/dep/dep_graph.go:77
|
||||
msgid "SRCINFO"
|
||||
msgstr "SRCINFO"
|
||||
|
||||
#: pkg/upgrade/service.go:72
|
||||
#: pkg/upgrade/service.go:63 upgrade.go:73
|
||||
msgid "Searching AUR for updates..."
|
||||
msgstr "Prohledávání AUR pro aktualizace..."
|
||||
|
||||
#: pkg/upgrade/service.go:160
|
||||
#: pkg/upgrade/service.go:142 upgrade.go:62
|
||||
msgid "Searching databases for updates..."
|
||||
msgstr "Prohledávání databází k aktualizaci..."
|
||||
|
||||
#: pkg/query/query_builder.go:214
|
||||
#: pkg/query/query_builder.go:191
|
||||
msgid "Showing repo packages only"
|
||||
msgstr "Zobrazování pouze balíčků repozitáře"
|
||||
|
||||
#: print.go:95
|
||||
#: print.go:88
|
||||
msgid "Size of pacman cache %s: %s"
|
||||
msgstr "Velikost mezipaměti pacman %s: %s"
|
||||
|
||||
#: print.go:98
|
||||
#: print.go:91
|
||||
msgid "Size of yay cache %s: %s"
|
||||
msgstr "Velikost mezipaměti yay %s: %s"
|
||||
|
||||
#: print.go:62
|
||||
#: print.go:56
|
||||
msgid "Snapshot URL"
|
||||
msgstr "URL snapshotu"
|
||||
|
||||
#: pkg/dep/dep_graph.go:76
|
||||
#: pkg/dep/dep_graph.go:75
|
||||
msgid "Sync"
|
||||
msgstr "Synchronizace"
|
||||
|
||||
#: print.go:100
|
||||
#: print.go:93
|
||||
msgid "Ten biggest packages:"
|
||||
msgstr "Deset největších balíčků"
|
||||
|
||||
#: pkg/sync/sync.go:124
|
||||
#: install.go:495 sync.go:183
|
||||
msgid "The following packages are not compatible with your architecture:"
|
||||
msgstr "Následující balíčky nejsou kompatibilní s vaší architekturou:"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:179 pkg/dep/dep_graph.go:726
|
||||
msgid "There are %[1]d providers available for %[2]s:"
|
||||
msgstr "Pro %[2]s je dostupných %[1]d poskytovatelů:"
|
||||
#: pkg/db/ialpm/alpm.go:179 pkg/dep/depPool.go:499 pkg/dep/dep_graph.go:627
|
||||
msgid "There are %d providers available for %s:"
|
||||
msgstr "Pro %s je dostupných %d poskytovatelů:"
|
||||
|
||||
#: pkg/settings/exe/cmd_builder.go:258
|
||||
#: pkg/settings/exe/cmd_builder.go:239
|
||||
msgid "There may be another Pacman instance running. Waiting..."
|
||||
msgstr "Možná běží další instance Pacman. Čekání..."
|
||||
|
||||
#: print.go:92
|
||||
#: print.go:85
|
||||
msgid "Total Size occupied by packages: %s"
|
||||
msgstr "Celková velikost zabraná balíčky: %s"
|
||||
|
||||
#: print.go:89
|
||||
#: print.go:82
|
||||
msgid "Total installed packages: %s"
|
||||
msgstr "Celkem nainstalovaných balíčků: %s"
|
||||
|
||||
#: pkg/sync/sync.go:132
|
||||
#: install.go:503 sync.go:191
|
||||
msgid "Try to build them anyway?"
|
||||
msgstr "Pokusit se je přesto sestavit?"
|
||||
|
||||
#: print.go:34
|
||||
#: print.go:30
|
||||
msgid "URL"
|
||||
msgstr "URL"
|
||||
|
||||
#: clean.go:194 pkg/menus/clean_menu.go:65 pkg/menus/clean_menu.go:71
|
||||
#: clean.go:192 pkg/menus/clean_menu.go:64 pkg/menus/clean_menu.go:70
|
||||
msgid "Unable to clean:"
|
||||
msgstr "Nepodařilo se vyčistit:"
|
||||
|
||||
#: get.go:42 get.go:74
|
||||
#: get.go:44 get.go:76
|
||||
msgid "Unable to find the following packages:"
|
||||
msgstr "Nepodařilo se nalézt následující balíčky:"
|
||||
|
||||
#: vote.go:20
|
||||
#: vote.go:21
|
||||
msgid "Unable to handle package vote for: %s. err: %s"
|
||||
msgstr "Nelze hlasovat pro balíček: %s. chyba: %s"
|
||||
|
||||
#: clean.go:170
|
||||
#: clean.go:169
|
||||
msgid "Unable to remove %s: %s"
|
||||
msgstr "Nelze odebrat %s:%s"
|
||||
|
||||
#: print.go:32
|
||||
#: print.go:28
|
||||
msgid "Version"
|
||||
msgstr "Verze"
|
||||
|
||||
#: print.go:50
|
||||
#: print.go:41
|
||||
msgid "Votes"
|
||||
msgstr "Hlasy"
|
||||
|
||||
#: print.go:87
|
||||
#: print.go:80
|
||||
msgid "Yay version v%s"
|
||||
msgstr "Verze yay v%s"
|
||||
|
||||
#: pkg/menus/menu.go:49
|
||||
#: pkg/menus/menu.go:48
|
||||
msgid "[N]one"
|
||||
msgstr "[N]Žádné"
|
||||
|
||||
#: clean.go:83
|
||||
#: clean.go:84
|
||||
msgid ""
|
||||
"\n"
|
||||
"Build directory:"
|
||||
@ -499,7 +532,7 @@ msgstr ""
|
||||
"\n"
|
||||
"Adresář sestavení:"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:201 pkg/dep/dep_graph.go:740
|
||||
#: pkg/db/ialpm/alpm.go:201 pkg/dep/depPool.go:513 pkg/dep/dep_graph.go:641
|
||||
msgid ""
|
||||
"\n"
|
||||
"Enter a number (default=1): "
|
||||
@ -511,19 +544,19 @@ msgstr ""
|
||||
msgid "aborting due to user"
|
||||
msgstr "rušení kvůli uživateli"
|
||||
|
||||
#: pkg/settings/parser/parser.go:608
|
||||
#: pkg/settings/parser/parser.go:620
|
||||
msgid "argument '-' specified without input on stdin"
|
||||
msgstr "argument '-' použit bez vstupu na stdin"
|
||||
|
||||
#: local_install.go:26
|
||||
#: local_install.go:27
|
||||
msgid "cannot find PKGBUILD and .SRCINFO in directory"
|
||||
msgstr "PKGBUILD a .SRCINFO nebyly nalezeny ve složce"
|
||||
|
||||
#: pkg/sync/build/pkg_archive.go:148
|
||||
#: install.go:532
|
||||
msgid "cannot find package name: %v"
|
||||
msgstr "nepodařilo se nalézt název balíčku: %v"
|
||||
|
||||
#: pkg/sync/build/errors.go:30
|
||||
#: errors.go:47
|
||||
msgid "could not find PKGDEST for: %s"
|
||||
msgstr "nepodařilo se nalézt PKGDEST pro: %s"
|
||||
|
||||
@ -531,23 +564,31 @@ msgstr "nepodařilo se nalézt PKGDEST pro: %s"
|
||||
msgid "could not find all required packages"
|
||||
msgstr "Nepodařilo se nalézt všechny požadované balíčky"
|
||||
|
||||
#: pkg/sync/build/errors.go:61
|
||||
#: pkg/dep/depCheck.go:303
|
||||
msgid "could not find all required packages:"
|
||||
msgstr "Nepodařilo se nalézt všechny požadované balíčky:"
|
||||
|
||||
#: errors.go:16
|
||||
msgid "could not find any package archives listed in %s"
|
||||
msgstr "nenalezeny žádné archivy balíčků v %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:50 pkg/upgrade/service.go:287
|
||||
#: install.go:788
|
||||
msgid "could not find srcinfo for: %s"
|
||||
msgstr "nepodařilo se nalézt srcinfo pro: %s"
|
||||
|
||||
#: errors.go:26
|
||||
msgid "dependency"
|
||||
msgstr "závislost"
|
||||
|
||||
#: pkg/vcs/vcs.go:96 pkg/vcs/vcs.go:100
|
||||
#: pkg/vcs/vcs.go:94 pkg/vcs/vcs.go:98
|
||||
msgid "devel check for package failed: '%s' encountered an error"
|
||||
msgstr "kontrola devel balíčku selhala: '%s' narazil na chybu"
|
||||
|
||||
#: pkg/menus/edit_menu.go:110
|
||||
#: pkg/menus/edit_menu.go:111
|
||||
msgid "editor did not exit successfully, aborting: %s"
|
||||
msgstr "editor nebyl úspěšně ukončen, rušení: %s"
|
||||
|
||||
#: pkg/sync/workdir/aur_source.go:24
|
||||
#: aur_source.go:24
|
||||
msgid "error downloading sources: %s"
|
||||
msgstr "chyba při stahování zdrojů: %s"
|
||||
|
||||
@ -555,19 +596,20 @@ msgstr "chyba při stahování zdrojů: %s"
|
||||
msgid "error fetching %s: %s"
|
||||
msgstr "chyba při načítání %s: %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:9
|
||||
#: install.go:321 install.go:455 local_install.go:26
|
||||
msgid "error installing repo packages"
|
||||
msgstr "chyba při instalaci balíčků repozitáře"
|
||||
|
||||
#: pkg/sync/build/installer.go:266 pkg/sync/build/installer.go:270
|
||||
#: aur_install.go:236 aur_install.go:240
|
||||
msgid "error installing:"
|
||||
msgstr "chyba při instalaci:"
|
||||
|
||||
#: pkg/sync/build/installer.go:233 pkg/sync/build/installer.go:237
|
||||
#: aur_install.go:204 aur_install.go:208 install.go:683 install.go:724
|
||||
#: install.go:738 install.go:752
|
||||
msgid "error making: %s"
|
||||
msgstr "chyba při vytváření: %s"
|
||||
|
||||
#: pkg/sync/workdir/merge.go:24
|
||||
#: install.go:588
|
||||
msgid "error merging %s: %s"
|
||||
msgstr "chyba při slučování %s: %s"
|
||||
|
||||
@ -575,19 +617,19 @@ msgstr "chyba při slučování %s: %s"
|
||||
msgid "error reading %s"
|
||||
msgstr "chyba při čtení %s"
|
||||
|
||||
#: sync.go:36
|
||||
#: install.go:110 sync.go:37
|
||||
msgid "error refreshing databases"
|
||||
msgstr "chyba při obnovování databází"
|
||||
|
||||
#: pkg/sync/workdir/clean.go:51 pkg/sync/workdir/merge.go:17
|
||||
#: clean.go:220 install.go:581
|
||||
msgid "error resetting %s: %s"
|
||||
msgstr "chyba při resetování %s: %s"
|
||||
|
||||
#: pkg/sync/build/errors.go:53
|
||||
#: errors.go:29
|
||||
msgid "error updating package install reason to %s"
|
||||
msgstr "chyba při aktualizaci důvodu instalace balíčku na"
|
||||
|
||||
#: pkg/sync/build/errors.go:48
|
||||
#: errors.go:24
|
||||
msgid "explicit"
|
||||
msgstr "explicitní"
|
||||
|
||||
@ -595,31 +637,31 @@ msgstr "explicitní"
|
||||
msgid "failed to create directory '%s': %s"
|
||||
msgstr "nepodařilo se vytvořit adresář '%s': %s"
|
||||
|
||||
#: pkg/settings/config.go:281
|
||||
#: pkg/settings/config.go:286
|
||||
msgid "failed to open config file '%s': %s"
|
||||
msgstr "nepodařilo se otevřít konfigurační soubor '%s': %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:114
|
||||
#: pkg/srcinfo/service.go:113
|
||||
msgid "failed to parse %s -- skipping: %s"
|
||||
msgstr "nepodařilo se parsovat %s -- přeskakuji: %s"
|
||||
|
||||
#: pkg/sync/srcinfo/service.go:118
|
||||
#: pkg/srcinfo/service.go:117
|
||||
msgid "failed to parse %s: %s"
|
||||
msgstr "nepodařilo se parsovat %s: %s"
|
||||
|
||||
#: local_install.go:77
|
||||
#: local_install.go:82
|
||||
msgid "failed to parse .SRCINFO"
|
||||
msgstr "nepodařilo se parsovat .SRCINFO"
|
||||
|
||||
#: pkg/settings/config.go:291
|
||||
#: pkg/settings/config.go:296
|
||||
msgid "failed to read config file '%s': %s"
|
||||
msgstr "nepodařilo se přečíst konfigurační soubor '%s': %s"
|
||||
|
||||
#: pkg/cmd/graph/main.go:46 pkg/runtime/runtime.go:73
|
||||
#: pkg/settings/runtime.go:74
|
||||
msgid "failed to retrieve aur Cache"
|
||||
msgstr "nepodařilo se získat aur Cache"
|
||||
|
||||
#: pkg/upgrade/sources.go:27
|
||||
#: pkg/upgrade/sources.go:30
|
||||
msgid "ignoring package devel upgrade (no AUR info found):"
|
||||
msgstr "ignoruji vývojovou aktualizaci balíčku (AUR informace nenalezeny)"
|
||||
|
||||
@ -627,7 +669,7 @@ msgstr "ignoruji vývojovou aktualizaci balíčku (AUR informace nenalezeny)"
|
||||
msgid "input too long"
|
||||
msgstr "vstup příliš dlouhý"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:222 pkg/dep/dep_graph.go:761
|
||||
#: pkg/db/ialpm/alpm.go:222 pkg/dep/depPool.go:533 pkg/dep/dep_graph.go:662
|
||||
msgid "invalid number: %s"
|
||||
msgstr "neplatné číslo: %s"
|
||||
|
||||
@ -635,20 +677,20 @@ msgstr "neplatné číslo: %s"
|
||||
msgid "invalid option '%s'"
|
||||
msgstr "neplatná možnost '%s'"
|
||||
|
||||
#: cmd.go:197
|
||||
#: cmd.go:208
|
||||
msgid "invalid option: '--deps' and '--explicit' may not be used together"
|
||||
msgstr ""
|
||||
"neplatná možnost: '--deps' a '--explicit' nemohou být použity současně"
|
||||
|
||||
#: pkg/download/abs.go:22
|
||||
#: pkg/download/abs.go:21
|
||||
msgid "invalid repository"
|
||||
msgstr "neplatný repozitář"
|
||||
|
||||
#: pkg/db/ialpm/alpm.go:227 pkg/dep/dep_graph.go:767
|
||||
#: pkg/db/ialpm/alpm.go:227 pkg/dep/depPool.go:538 pkg/dep/dep_graph.go:668
|
||||
msgid "invalid value: %d is not between %d and %d"
|
||||
msgstr "neplatná hodnota: %d není mezi %d a %d"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:110
|
||||
#: pkg/pgp/keys.go:113
|
||||
msgid "no keys to import"
|
||||
msgstr "žádné klíče k importování"
|
||||
|
||||
@ -656,15 +698,15 @@ msgstr "žádné klíče k importování"
|
||||
msgid "no query was executed"
|
||||
msgstr "nebyl vykonán žádný dotaz"
|
||||
|
||||
#: local_install.go:66
|
||||
#: local_install.go:68
|
||||
msgid "no target directories specified"
|
||||
msgstr "nebyly specifikovány cílové adresáře"
|
||||
|
||||
#: pkg/text/input.go:48
|
||||
#: pkg/text/text.go:69
|
||||
msgid "no"
|
||||
msgstr "ne"
|
||||
|
||||
#: pkg/sync/build/installer.go:242
|
||||
#: aur_install.go:213
|
||||
msgid "nothing to install for %s"
|
||||
msgstr "nic k nainstalování pro %s"
|
||||
|
||||
@ -672,47 +714,39 @@ msgstr "nic k nainstalování pro %s"
|
||||
msgid "only one operation may be used at a time"
|
||||
msgstr "naráz může být použita pouze jedna operace"
|
||||
|
||||
#: pkg/cmd/graph/main.go:70
|
||||
msgid "only one target is allowed"
|
||||
msgstr "je dovolený pouze jeden cíl"
|
||||
|
||||
#: print.go:187
|
||||
#: print.go:158
|
||||
msgid "package '%s' was not found"
|
||||
msgstr "balíček '%s' nebyl nalezen"
|
||||
|
||||
#: pkg/dep/depCheck.go:197
|
||||
msgid "package conflicts can not be resolved with noconfirm, aborting"
|
||||
msgstr "konflikty balíčků nelze vyřešit pomocí noconfirm, ruším"
|
||||
|
||||
#: pkg/download/errors.go:15
|
||||
msgid "package not found in AUR"
|
||||
msgstr "balíček nenalezen v AUR"
|
||||
|
||||
#: pkg/download/abs.go:23
|
||||
#: pkg/download/abs.go:22
|
||||
msgid "package not found in repos"
|
||||
msgstr "balíček nenalezen v repozitářích"
|
||||
|
||||
#: pkg/upgrade/service.go:292
|
||||
msgid "package"
|
||||
msgid_plural "packages"
|
||||
msgstr[0] "balíček"
|
||||
msgstr[1] "balíčky"
|
||||
msgstr[2] "balíčky"
|
||||
msgstr[3] "balíčky"
|
||||
|
||||
#: pkg/sync/srcinfo/pgp/keys.go:100
|
||||
#: pkg/pgp/keys.go:103
|
||||
msgid "problem importing keys"
|
||||
msgstr "problém při importování klíčů"
|
||||
|
||||
#: clean.go:105
|
||||
#: clean.go:106
|
||||
msgid "removing AUR packages from cache..."
|
||||
msgstr "odstraňování balíčků AUR z mezipaměti..."
|
||||
|
||||
#: clean.go:178 pkg/sync/workdir/clean.go:41
|
||||
#: clean.go:177 clean.go:210
|
||||
msgid "removing untracked AUR files from cache..."
|
||||
msgstr "odstraňování nesledovaných souborů AUR z mezipaměti..."
|
||||
|
||||
#: pkg/sync/build/errors.go:38
|
||||
#: errors.go:37
|
||||
msgid "the PKGDEST for %s is listed by makepkg but does not exist: %s"
|
||||
msgstr "PKGDEST pro %s je v seznamu makepkg ale neexistuje: %s"
|
||||
|
||||
#: pkg/sync/sync.go:45
|
||||
#: sync.go:110
|
||||
msgid "there is nothing to do"
|
||||
msgstr "není co dělat"
|
||||
|
||||
@ -720,14 +754,14 @@ msgstr "není co dělat"
|
||||
msgid "unable to CreateHandle: %s"
|
||||
msgstr "nepodařilo se CreateHandle: %s"
|
||||
|
||||
#: cmd.go:186
|
||||
#: cmd.go:197
|
||||
msgid "unhandled operation"
|
||||
msgstr "neznámá operace"
|
||||
|
||||
#: cmd.go:450
|
||||
#: cmd.go:469
|
||||
msgid "unknown-version"
|
||||
msgstr "neznámá-verze"
|
||||
|
||||
#: pkg/text/input.go:47
|
||||
#: pkg/text/text.go:68
|
||||
msgid "yes"
|
||||
msgstr "ano"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user