Showing preview only (1,800K chars total). Download the full file or copy to clipboard to get everything.
Repository: Jguer/yay
Branch: next
Commit: 90ae08862a52
Files: 214
Total size: 1.7 MB
Directory structure:
gitextract_b9cisaon/
├── .dockerignore
├── .github/
│ ├── CODEOWNERS
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── builder-image.yml
│ ├── multiarch-build.yml
│ ├── testing-git.yml
│ └── testing.yml
├── .gitignore
├── .golangci.yml
├── .pre-commit-config.yaml
├── CONTRIBUTING.md
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── SECURITY.md
├── ci.Dockerfile
├── clean.go
├── clean_test.go
├── cmd.go
├── cmd_test.go
├── completions/
│ ├── bash
│ ├── fish
│ └── zsh
├── doc/
│ └── yay.8
├── errors.go
├── get.go
├── go.mod
├── go.sum
├── local_install.go
├── local_install_test.go
├── main.go
├── pkg/
│ ├── cmd/
│ │ └── graph/
│ │ └── main.go
│ ├── completion/
│ │ ├── completion.go
│ │ └── completion_test.go
│ ├── db/
│ │ ├── executor.go
│ │ ├── ialpm/
│ │ │ ├── alpm.go
│ │ │ ├── alpm_test.go
│ │ │ └── high_level.go
│ │ ├── mock/
│ │ │ ├── executor.go
│ │ │ └── repo.go
│ │ └── types.go
│ ├── dep/
│ │ ├── dep.go
│ │ ├── dep_graph.go
│ │ ├── dep_graph_bench_test.go
│ │ ├── dep_graph_rpc_test.go
│ │ ├── dep_graph_test.go
│ │ ├── mock/
│ │ │ └── aur.go
│ │ ├── target_handler.go
│ │ ├── testdata/
│ │ │ ├── android-sdk.json
│ │ │ ├── aws-cli-git.json
│ │ │ ├── clion.json
│ │ │ ├── gstreamer-git.json
│ │ │ ├── jellyfin-server.json
│ │ │ ├── jellyfin-web.json
│ │ │ ├── jellyfin.json
│ │ │ ├── liri-desktop-git.json
│ │ │ ├── mesa-git.json
│ │ │ ├── nx.json
│ │ │ ├── python-pydantic.json
│ │ │ └── samsung-unified-driver.json
│ │ └── topo/
│ │ ├── dep.go
│ │ ├── dep_test.go
│ │ └── errors.go
│ ├── download/
│ │ ├── abs.go
│ │ ├── abs_test.go
│ │ ├── aur.go
│ │ ├── aur_test.go
│ │ ├── errors.go
│ │ ├── unified.go
│ │ ├── unified_integration_test.go
│ │ ├── unified_test.go
│ │ └── utils_test.go
│ ├── intrange/
│ │ ├── intrange.go
│ │ └── intrange_test.go
│ ├── menus/
│ │ ├── clean_menu.go
│ │ ├── diff_menu.go
│ │ ├── edit_menu.go
│ │ └── menu.go
│ ├── multierror/
│ │ └── multierror.go
│ ├── news/
│ │ ├── .snapshots/
│ │ │ ├── TestPrintNewsFeed-all-quiet
│ │ │ ├── TestPrintNewsFeed-all-verbose
│ │ │ ├── TestPrintNewsFeed-latest-quiet
│ │ │ ├── TestPrintNewsFeed-latest-quiet-topdown
│ │ │ └── TestPrintNewsFeedSameDay
│ │ ├── news.go
│ │ └── news_test.go
│ ├── query/
│ │ ├── aur_warnings.go
│ │ ├── errors.go
│ │ ├── filter.go
│ │ ├── metric.go
│ │ ├── metric_test.go
│ │ ├── query_builder.go
│ │ ├── query_builder_test.go
│ │ ├── source.go
│ │ ├── types.go
│ │ ├── version_diff.go
│ │ └── version_diff_test.go
│ ├── runtime/
│ │ ├── pacman.go
│ │ ├── pacman_test.go
│ │ ├── runtime.go
│ │ └── runtime_test.go
│ ├── settings/
│ │ ├── args.go
│ │ ├── config.go
│ │ ├── config_test.go
│ │ ├── dirs.go
│ │ ├── dirs_test.go
│ │ ├── errors.go
│ │ ├── exe/
│ │ │ ├── cmd_builder.go
│ │ │ ├── exec.go
│ │ │ └── mock.go
│ │ ├── ini.go
│ │ ├── ini_test.go
│ │ ├── parser/
│ │ │ ├── parser.go
│ │ │ ├── parser_test.go
│ │ │ ├── rebuild_mode.go
│ │ │ └── target_mode.go
│ │ └── yay.conf
│ ├── sync/
│ │ ├── build/
│ │ │ ├── errors.go
│ │ │ ├── installer.go
│ │ │ ├── installer_test.go
│ │ │ ├── pkg_archive.go
│ │ │ └── pkg_archive_test.go
│ │ ├── srcinfo/
│ │ │ ├── pgp/
│ │ │ │ ├── keys.go
│ │ │ │ ├── keys_test.go
│ │ │ │ └── testdata/
│ │ │ │ ├── 11E521D646982372EB577A1F8F0871F202119294
│ │ │ │ ├── 487EACC08557AD082088DABA1EB2638FF56C0C53
│ │ │ │ ├── 647F28654894E3BD457199BE38DBBDC86092693E
│ │ │ │ ├── A314827C4E4250A204CE6E13284FC34C8E4B1A25
│ │ │ │ ├── ABAF11C65A2970B130ABE3C479BE3E4300411886
│ │ │ │ ├── B6C8F98282B944E3B0D5C2530FC3042E345AD05D
│ │ │ │ └── C52048C0C0748FEE227D47A2702353E0F7E48EDB
│ │ │ ├── service.go
│ │ │ └── service_test.go
│ │ ├── sync.go
│ │ └── workdir/
│ │ ├── aur_source.go
│ │ ├── aur_source_test.go
│ │ ├── clean.go
│ │ ├── merge.go
│ │ ├── preparer.go
│ │ └── preparer_test.go
│ ├── text/
│ │ ├── color.go
│ │ ├── convert.go
│ │ ├── errors.go
│ │ ├── input.go
│ │ ├── service.go
│ │ ├── text.go
│ │ ├── text_test.go
│ │ └── time.go
│ ├── upgrade/
│ │ ├── .snapshots/
│ │ │ ├── Test_upAUR-No_Updates
│ │ │ ├── Test_upAUR-Simple_Update
│ │ │ └── Test_upAUR-Time_Update
│ │ ├── service.go
│ │ ├── service_test.go
│ │ ├── sources.go
│ │ ├── sources_test.go
│ │ ├── upgrade.go
│ │ └── upgrade_test.go
│ └── vcs/
│ ├── .snapshots/
│ │ └── TestInfoStore_Update-simple
│ ├── mock.go
│ ├── vcs.go
│ └── vcs_test.go
├── po/
│ ├── ca.po
│ ├── ca_ES.po
│ ├── cs.po
│ ├── de.po
│ ├── en.po
│ ├── es.po
│ ├── eu.po
│ ├── fi.po
│ ├── fr.po
│ ├── fr_FR.po
│ ├── he.po
│ ├── he_IL.po
│ ├── hu.po
│ ├── id.po
│ ├── it_IT.po
│ ├── ja.po
│ ├── ko.po
│ ├── nl.po
│ ├── pl.po
│ ├── pl_PL.po
│ ├── pt.po
│ ├── pt_BR.po
│ ├── ru.po
│ ├── ru_RU.po
│ ├── sk.po
│ ├── sv.po
│ ├── tr.po
│ ├── uk.po
│ ├── vi.po
│ ├── vi_VN.po
│ ├── zh_CN.po
│ └── zh_TW.po
├── print.go
├── print_test.go
├── query.go
├── query_test.go
├── sync.go
├── sync_test.go
├── testdata/
│ ├── cephbin/
│ │ ├── .SRCINFO
│ │ └── PKGBUILD
│ ├── gourou/
│ │ ├── .SRCINFO
│ │ └── PKGBUILD
│ ├── jfin/
│ │ ├── .SRCINFO
│ │ └── PKGBUILD
│ ├── libzip-git/
│ │ ├── .SRCINFO
│ │ └── PKGBUILD
│ └── pacman.conf
├── vcs.go
└── vote.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
*
!*.go
!pkg
!go.mod
!go.sum
!Makefile
!po
!doc
!completions
================================================
FILE: .github/CODEOWNERS
================================================
* @Jguer
================================================
FILE: .github/FUNDING.yml
================================================
github: [Jguer]
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Report a malfunction to help us improve
title: ""
labels: "Status: Triage, Type: Bug"
assignees: ""
---
### Affected Version
<!-- Please ensure you are using the latest yay-git package
Use `yay -V` to get installed version
Example: `yay v8.1139.r0.g9ac4ab6 - libalpm v11.0.1` -->
### Describe the bug
<!-- A clear and concise description of the bug. -->
### Reproduction Steps
1.
2.
3.
### Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
### Output
<!--
Include the FULL output of any relevant commands/configs
The current yay config can be printed with `yay -Pg`
Paste services are only needed for excessive output (>500 lines)
Use --debug to add pacman and yay debug logs
or add the following key to your ~/.config/yay/config.json to only get yay debug logs
{
"debug": true
}
-->
```sh
```
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: "Type: Feature Request, Status: Discussion Open"
assignees: ""
---
### Is your feature request related to a problem? Please describe.
<!-- A clear and concise description of the problem, e.g. I'm always frustrated when ... -->
### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->
### Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
### Additional context
<!-- Add any other context or screenshots about the feature request here. -->
================================================
FILE: .github/dependabot.yml
================================================
# 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:
- '*'
================================================
FILE: .github/workflows/builder-image.yml
================================================
name: Builder Image
on:
schedule:
- cron: "0 3 * * 1" # Every Monday at 3 AM
push:
paths:
- "ci.Dockerfile"
- ".github/workflows/builder-image.yml"
env:
REGISTRY_IMAGE: jguer/yay-builder
jobs:
build:
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: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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: |
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=ghcr.io/${{ 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 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: |
ghcr.io/${{ env.REGISTRY_IMAGE }}
tags: |
type=raw,value=latest
type=sha,format=short
- name: Create and push manifest list
env:
DOCKER_CLI_EXPERIMENTAL: enabled
run: |
# Extract GitHub Container Registry tags
GHCR_TAGS=$(echo '${{ steps.meta.outputs.tags }}' | xargs -I {} echo "-t {}")
# Create a manifest list using the image digests from /tmp/digests/*
DIGESTS=$(for file in /tmp/digests/*; do
echo -n "ghcr.io/${{ env.REGISTRY_IMAGE }}@$(cat $file) "
done)
# Create the manifest list for GitHub Container Registry
docker buildx imagetools create $GHCR_TAGS $DIGESTS
- name: Inspect image
run: |
docker buildx imagetools inspect ghcr.io/${{ env.REGISTRY_IMAGE }}:latest
================================================
FILE: .github/workflows/multiarch-build.yml
================================================
name: Build Release
on:
push:
tags:
- v*
jobs:
build-releases:
strategy:
matrix:
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
- 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
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Read info
id: tags
run: |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
arch="${{ matrix.arch }}"
echo "PLATFORM=${arch%% *}" >> $GITHUB_OUTPUT
echo "ARCH=${arch##* }" >> $GITHUB_OUTPUT
- name: Build ${{ matrix.arch }} release
run: |
mkdir artifacts
docker buildx build --platform ${{ steps.tags.outputs.platform }} \
--build-arg VERSION=${{ steps.tags.outputs.version }} \
--build-arg ARCH=${{ steps.tags.outputs.arch }} \
--build-arg PREFIX="/usr" \
-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
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
with:
fetch-depth: 0
- name: Read info
id: tags
run: |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
pattern: yay_*
merge-multiple: true
- name: Create Release
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
- name: Release Notary Action
uses: docker://aevea/release-notary:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/testing-git.yml
================================================
name: Test against pacman-git
on:
pull_request:
paths-ignore:
- "doc/**"
- "**/*.po"
- "README.md"
- ".gitignore"
jobs:
build:
name: Lint and test yay (-git)
runs-on: ubuntu-latest
container:
image: ghcr.io/jguer/yay-builder:latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/cache@v3
with:
path: /home/runner/work/yay/yay/pacman-git
key: ${{ runner.os }}-pacman-${{ hashFiles('/home/runner/work/yay/yay/pacman-git/PKGBUILD') }}
restore-keys: |
${{ runner.os }}-pacman-
- name: checkout pacman-git
run: |
git -C ./pacman-git pull || git clone https://aur.archlinux.org/pacman-git
useradd github
echo 'github ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
chmod -R 777 pacman-git
su github -c 'cd pacman-git; yes | makepkg -si --nocheck'
- name: Run Build and Tests with pacman-git
run: |
make test
================================================
FILE: .github/workflows/testing.yml
================================================
name: Test against pacman
on:
pull_request:
jobs:
build:
name: Lint and test yay
runs-on: ubuntu-latest
container:
image: ghcr.io/jguer/yay-builder:latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Lint
env:
GOFLAGS: -buildvcs=false -tags=next
run: /app/bin/golangci-lint run -v ./...
- name: Run Build and Tests
run: make test
- name: Run Integration Tests
continue-on-error: true
run: |
useradd -m yay &&
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
================================================
FILE: .gitignore
================================================
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
.vscode
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
*.exe
*.test
*.prof
yay
yay_*/
*.tar.gz
qemu-*
.go
# Locale
*.mo
*.pot
*.po~
*.pprof
node_modules/
xgotext
.devcontainer/
================================================
FILE: .golangci.yml
================================================
version: "2"
run:
go: "1.26"
linters:
default: none
enable:
- bodyclose
- dogsled
- dupl
- errcheck
- errorlint
- gochecknoinits
- gocritic
- goprintffuncname
- gosec
- govet
- ineffassign
- lll
- misspell
- nakedret
- noctx
- nolintlint
- staticcheck
- 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
- gosec
- govet
- lll
- revive
- staticcheck
- wsl
path: (.+)_test.go
- path: (.+)\.go$
text: G204
- path: (.+)\.go$
text: G115
- path: (.+)\.go$
text: G703
- path: (.+)\.go$
text: G705
- path: (.+)\.go$
text: QF1012
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$
================================================
FILE: .pre-commit-config.yaml
================================================
default_stages: [commit]
repos:
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.5.1
hooks:
- id: go-fmt
- 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
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
- id: check-json
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.15.0
hooks:
- id: commitizen
stages: [commit-msg]
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to yay
## Translation
[Transifex](https://www.transifex.com/yay-1/yay/)
## Quality Assurance
```sh
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay-git.git
cd yay-git
makepkg -si
```
Installing `yay-git` and using issues to help determine what's broken is already
a very big help.
## Development
Contributors are always welcome!
If you plan to make any large changes or changes that may not be 100% agreed
on, we suggest opening an issue detailing your ideas first.
Otherwise send us a pull request and we will be happy to review it.
### Vision
Yay is based on the design of [yaourt](https://github.com/archlinuxfr/yaourt), [apacman](https://github.com/oshazard/apacman) and [pacaur](https://github.com/rmarquis/pacaur). It is developed with these objectives in mind:
- Provide an interface for pacman
- Yaourt-style interactive search/install
- Minimal dependencies
- Minimize user input
### Dependencies
Yay depends on:
- go (make only)
- git
- base-devel
- pacman
Note: Yay also depends on a few other projects, these are pulled as go modules.
### Building
Run `make` to build Yay. This command will generate a binary called `yay` in
the same directory as the Makefile.
#### Docker Release
`make docker-release` will build the release packages for `aarch64` and for `x86_64`.
For `aarch64` to run on a `x86_64` platform `qemu-user-static(-bin)` must be
installed.
```
docker run --rm --privileged multiarch/qemu-user-static:register --reset
```
will register QEMU in the build agent. ARM builds tend to crash sometimes but
repeated runs tend to succeed.
### Code Style
All code should be formatted through `go fmt`. This tool will automatically
format code for you. We recommend, however, that you write code in the proper
style and use `go fmt` only to catch mistakes.
Use [pre-commit](https://pre-commit.com/) to validate your commits against the various
linters configured for this repository.
### Testing
Run `make test` to test Yay. This command will verify that the code is
formatted correctly, run the code through `go vet`, and run unit tests.
================================================
FILE: Dockerfile
================================================
FROM ghcr.io/jguer/yay-builder:latest
LABEL maintainer="Jguer,docker@jguer.space"
ARG VERSION
ARG PREFIX
ARG ARCH
WORKDIR /app
COPY . .
RUN pacman -Syu --overwrite=* --noconfirm
RUN make release VERSION=${VERSION} PREFIX=${PREFIX} ARCH=${ARCH}
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: Makefile
================================================
export GO111MODULE=on
GOPROXY ?= https://proxy.golang.org,direct
export GOPROXY
BUILD_TAG = devel
ARCH ?= $(shell uname -m)
BIN := yay
DESTDIR :=
GO ?= go
PKGNAME := yay
PREFIX := /usr/local
MAJORVERSION := 13
MINORVERSION := 0
PATCHVERSION := 0
VERSION ?= ${MAJORVERSION}.${MINORVERSION}.${PATCHVERSION}
LOCALEDIR := po
SYSTEMLOCALEPATH := $(PREFIX)/share/locale/
# ls -1 po | sed -e 's/\.po$//' | paste -sd " "
LANGS := ca cs de en es eu fr_FR he hu id it_IT ja ko nl pl_PL pt_BR pt ru_RU ru sk sv tr uk vi vi_VN zh_CN zh_TW
POTFILE := default.pot
POFILES := $(addprefix $(LOCALEDIR)/,$(addsuffix .po,$(LANGS)))
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
RELEASE_DIR := ${PKGNAME}_${VERSION}_${ARCH}
PACKAGE := $(RELEASE_DIR).tar.gz
SOURCES ?= $(shell find . -name "*.go" -type f)
.PRECIOUS: ${LOCALEDIR}/%.po
.PHONY: default
default: build
.PHONY: all
all: | clean release
.PHONY: clean
clean:
$(GO) clean $(FLAGS) -i ./...
rm -rf $(BIN) $(PKGNAME)_*
.PHONY: test_lint
test_lint: test lint
.PHONY: test
test:
$(GO) test -race -covermode=atomic $(FLAGS) ./...
.PHONY: test-integration
test-integration:
$(GO) test -tags=integration $(FLAGS) ./...
.PHONY: build
build: $(BIN)
.PHONY: release
release: $(PACKAGE)
.PHONY: docker-release-all
docker-release-all:
make docker-release-armv7h ARCH=armv7h
make docker-release-x86_64 ARCH=x86_64
make docker-release-aarch64 ARCH=aarch64
docker-release:
docker create --name yay-$(ARCH) yay:${ARCH} /bin/sh
docker cp yay-$(ARCH):/app/${PACKAGE} $(PACKAGE)
docker container rm yay-$(ARCH)
.PHONY: docker-build
docker-build:
docker build -t yay-$(ARCH):${VERSION} .
docker run -e="ARCH=$(ARCH)" --name yay-$(ARCH) yay-$(ARCH):${VERSION} make build VERSION=${VERSION} PREFIX=${PREFIX}
docker cp yay-$(ARCH):/app/${BIN} $(BIN)
docker container rm yay-$(ARCH)
.PHONY: lint
lint:
GOFLAGS="$(FLAGS)" golangci-lint run ./...
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: install
install: build ${MOFILES}
install -Dm755 ${BIN} $(DESTDIR)$(PREFIX)/bin/${BIN}
install -Dm644 doc/${PKGNAME}.8 $(DESTDIR)$(PREFIX)/share/man/man8/${PKGNAME}.8
install -Dm644 completions/bash $(DESTDIR)$(PREFIX)/share/bash-completion/completions/${PKGNAME}
install -Dm644 completions/zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_${PKGNAME}
install -Dm644 completions/fish $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/${PKGNAME}.fish
for lang in ${LANGS}; do \
install -Dm644 ${LOCALEDIR}/$${lang}.mo $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/${PKGNAME}.mo; \
done
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/${BIN}
rm -f $(DESTDIR)$(PREFIX)/share/man/man8/${PKGNAME}.8
rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/${PKGNAME}
rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_${PKGNAME}
rm -f $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/${PKGNAME}.fish
for lang in ${LANGS}; do \
rm -f $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/${PKGNAME}.mo; \
done
$(BIN): $(SOURCES)
$(GO) build $(FLAGS) -ldflags '$(LDFLAGS)' $(EXTRA_FLAGS) -o $@
$(RELEASE_DIR):
mkdir $(RELEASE_DIR)
$(PACKAGE): $(BIN) $(RELEASE_DIR) ${MOFILES}
strip ${BIN}
cp -t $(RELEASE_DIR) ${BIN} doc/${PKGNAME}.8 completions/* ${MOFILES}
tar -czvf $(PACKAGE) $(RELEASE_DIR)
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; \
msgmerge -U po/$$lang.po po/${POTFILE}; \
touch po/$$lang.po; \
done
${LOCALEDIR}/%.mo: ${LOCALEDIR}/%.po
msgfmt -o $@ $<
================================================
FILE: README.md
================================================
[](https://aur.archlinux.org/packages/yay/)
[](https://aur.archlinux.org/packages/yay-bin/)
[](https://aur.archlinux.org/packages/yay-git/)

[](https://github.com/Jguer/yay/blob/master/LICENSE)
# yay
Yet Another Yogurt - An AUR Helper Written in Go
### Help translate yay: [Transifex](https://app.transifex.com/yay-1/yay/)
## Features
- Advanced dependency solving
- PKGBUILD downloading from ABS or AUR
- Completions for AUR packages
- Query user up-front for all input (prior to starting builds)
- Narrow search (`yay linux header` will first search `linux` and then narrow on `header`)
- Find matching package providers during search and allow selection
- Remove make dependencies at the end of the build process
- Build local PKGBUILDs with AUR dependencies
- Un/Vote for packages
[](https://asciinema.org/a/399431)
[](https://asciinema.org/a/399433)
## Installation
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.
```sh
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
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
```
### Binary
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
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)
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.
## First Use
#### Development packages upgrade
- Use `yay -Y --gendb` to generate a development package database for `*-git`
packages that were installed without yay.
This command should only be run once.
- `yay -Syu --devel` will then check for development package updates
- Use `yay -Y --devel --save` to make development package updates permanently
enabled (`yay` and `yay -Syu` will then always check dev packages)
## Examples of Custom Operations
| Command | Description |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `yay` | Alias to `yay -Syu`. |
| `yay <Search Term>` | Present package-installation selection menu. |
| `yay -Bi <dir>` | Install dependencies and build a local PKGBUILD. |
| `yay -G <AUR Package>` | Download PKGBUILD from ABS or AUR. (yay v12.0+) |
| `yay -Gp <AUR Package>` | Print to stdout PKGBUILD from ABS or AUR. |
| `yay -Ps` | Print system statistics. |
| `yay -Syu --devel` | Perform system upgrade, but also check for development package updates. |
| `yay -Wu <AUR Package>` | Unvote for package (Requires setting `AUR_USERNAME` and `AUR_PASSWORD` environment variables) (yay v11.3+) |
| `yay -Wv <AUR Package>` | Vote for package (Requires setting `AUR_USERNAME` and `AUR_PASSWORD` environment variables). (yay v11.3+) |
| `yay -Y --combinedupgrade --save` | Make combined upgrade the default mode. |
| `yay -Y --gendb` | Generate development package database used for devel update. |
| `yay -Yc` | Clean unneeded dependencies. |
## Frequently Asked Questions
- **yay does not display colored output. How do I fix it?**
Make sure you have the `Color` option in your `/etc/pacman.conf`
(see issue [#123](https://github.com/Jguer/yay/issues/123)).
- **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
page if the output can fit into one terminal length. This behavior can be
overridden by exporting your own flags (`export LESS=SRX`).
- **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`
- **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?**
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
their maintainers have not yet updated the `PKGBUILD`s
(see [outdated AUR packages](https://wiki.archlinux.org/index.php/Arch_User_Repository#Foo_in_the_AUR_is_outdated.3B_what_should_I_do.3F)).
- **yay doesn't install dependencies added to a PKGBUILD during installation.**
yay resolves all dependencies ahead of time. You are free to edit the
PKGBUILD in any way, but any problems you cause are your own and should not be
reported unless they can be reproduced with the original PKGBUILD.
- **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`.
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.
## Support
All support related to yay should be requested via GitHub issues. Since yay is not
officially supported by Arch Linux, support should not be sought out on the
forums, AUR comments or other official channels.
A broken AUR package should be reported as a comment on the package's AUR page.
A package may only be considered broken if it fails to build with makepkg.
Reports should be made using makepkg and include the full output as well as any
other relevant information. Never make reports using yay or any other external
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>
<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>
### Other AUR helpers/tools
- [paru](https://github.com/morganamilo/paru)
- [aurutils](https://github.com/AladW/aurutils)
- [pikaur](https://github.com/actionless/pikaur)
================================================
FILE: SECURITY.md
================================================
# 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.
================================================
FILE: ci.Dockerfile
================================================
FROM quay.io/gmanka/archlinuxarm:base-devel
LABEL maintainer="Jguer,docker@jguer.space"
ENV GO111MODULE=on
WORKDIR /app
COPY go.mod .
# asciidoc, doxygen, meson needed for pacman-git
RUN set -eux; \
pacman-key --init; \
sed -i 's/^#DisableSandboxFilesystem/DisableSandboxFilesystem/' /etc/pacman.conf; \
sed -i 's/^#DisableSandboxSyscalls/DisableSandboxSyscalls/' /etc/pacman.conf; \
pacman -Syu --noconfirm --needed archlinux-keyring pacman go git gcc make base-devel sudo asciidoc doxygen meson; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v2.10.1; \
go mod download; \
rm -rf /var/lib/pacman/sync/* /var/cache/pacman/* /tmp/* /var/tmp/*; \
rm -rf /usr/share/man/* /usr/share/doc/* || true; \
yes | pacman -Scc >/dev/null 2>&1 || true
================================================
FILE: clean.go
================================================
package main
import (
"context"
"os"
"path/filepath"
"github.com/Jguer/aur"
mapset "github.com/deckarep/golang-set/v2"
"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"
)
// CleanDependencies removes all dangling dependencies in system.
func cleanDependencies(ctx context.Context, cfg *settings.Configuration,
cmdBuilder exe.ICmdBuilder, cmdArgs *parser.Arguments, dbExecutor db.Executor,
removeOptional bool,
) error {
hanging := hangingPackages(removeOptional, dbExecutor)
if len(hanging) != 0 {
return cleanRemove(ctx, cfg, cmdBuilder, cmdArgs, hanging)
}
return nil
}
// CleanRemove sends a full removal command to pacman with the pkgName slice.
func cleanRemove(ctx context.Context, cfg *settings.Configuration,
cmdBuilder exe.ICmdBuilder, cmdArgs *parser.Arguments, pkgNames []string,
) error {
if len(pkgNames) == 0 {
return nil
}
arguments := cmdArgs.CopyGlobal()
if err := arguments.AddArg("R", "s", "u"); err != nil {
return err
}
arguments.AddTarget(pkgNames...)
return cmdBuilder.Show(
cmdBuilder.BuildPacmanCmd(ctx,
arguments, cfg.Mode, settings.NoConfirm))
}
func syncClean(ctx context.Context, run *runtime.Runtime, 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":
keepInstalled = true
case "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 {
return err
}
}
if !run.Cfg.Mode.AtLeastAUR() {
return nil
}
var question string
if removeAll {
question = gotext.Get("Do you want to remove ALL AUR packages from cache?")
} else {
question = gotext.Get("Do you want to remove all other AUR packages from cache?")
}
run.Logger.Println(gotext.Get("\nBuild directory:"), run.Cfg.BuildDir)
if run.Logger.ContinueTask(question, true, settings.NoConfirm) {
if err := cleanAUR(ctx, run, keepInstalled, keepCurrent, removeAll, dbExecutor); err != nil {
return err
}
}
if removeAll {
return nil
}
if run.Logger.ContinueTask(gotext.Get("Do you want to remove ALL untracked AUR files?"), true, settings.NoConfirm) {
return cleanUntracked(ctx, run)
}
return nil
}
func cleanAUR(ctx context.Context, run *runtime.Runtime,
keepInstalled, keepCurrent, removeAll bool, dbExecutor db.Executor,
) error {
run.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)
if err != nil {
return err
}
cachedPackages := make([]string, 0, len(files))
for _, file := range files {
if !file.IsDir() {
continue
}
cachedPackages = append(cachedPackages, file.Name())
}
// Most people probably don't use keep current and that is the only
// case where this is needed.
// 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{
Needles: cachedPackages,
})
if errInfo != nil {
return errInfo
}
for i := range info {
inAURBases.Add(info[i].PackageBase)
}
}
for _, pkg := range remotePackages {
if pkg.Base() != "" {
installedBases.Add(pkg.Base())
} else {
installedBases.Add(pkg.Name())
}
}
for _, file := range files {
if !file.IsDir() {
continue
}
if !removeAll {
if keepInstalled && installedBases.Contains(file.Name()) {
continue
}
if keepCurrent && inAURBases.Contains(file.Name()) {
continue
}
}
dir := filepath.Join(run.Cfg.BuildDir, file.Name())
run.Logger.Debugln("removing", dir)
if err = os.RemoveAll(dir); err != nil {
run.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..."))
files, err := os.ReadDir(run.Cfg.BuildDir)
if err != nil {
return err
}
for _, file := range files {
if !file.IsDir() {
continue
}
dir := filepath.Join(run.Cfg.BuildDir, file.Name())
run.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)
return err
}
}
}
return nil
}
func isGitRepository(dir string) bool {
_, err := os.Stat(filepath.Join(dir, ".git"))
return !os.IsNotExist(err)
}
================================================
FILE: clean_test.go
================================================
//go:build !integration
// +build !integration
package main
import (
"context"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
alpm "github.com/Jguer/dyalpm"
pacmanconf "github.com/Morganamilo/go-pacmanconf"
"github.com/stretchr/testify/assert"
"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"
)
func TestCleanHanging(t *testing.T) {
pacmanBin := t.TempDir() + "/pacman"
t.Parallel()
testCases := []struct {
name string
args []string
wantShow []string
}{
{
name: "clean",
args: []string{"Y", "c"},
wantShow: []string{"pacman", "-R", "-s", "-u", "--config", "/etc/pacman.conf", "--", "lsp-plugins"},
},
{
name: "clean double",
args: []string{"Y", "c", "c"},
wantShow: []string{"pacman", "-R", "-s", "-u", "--config", "/etc/pacman.conf", "--", "lsp-plugins", "linux-headers"},
},
}
dbExc := &mock.DBExecutor{
PackageOptionalDependsFn: func(i alpm.Package) []alpm.Depend {
if i.Name() == "linux" {
return []alpm.Depend{
{
Name: "linux-headers",
},
}
}
return []alpm.Depend{}
},
PackageProvidesFn: func(p alpm.Package) []alpm.Depend { return []alpm.Depend{} },
PackageDependsFn: func(p alpm.Package) []alpm.Depend { return []alpm.Depend{} },
LocalPackagesFn: func() []mock.IPackage {
return []mock.IPackage{
&mock.Package{
PReason: alpm.PkgReasonExplicit,
PName: "linux",
},
&mock.Package{
PReason: alpm.PkgReasonDepend,
PName: "lsp-plugins",
},
&mock.Package{
PReason: alpm.PkgReasonDepend,
PName: "linux-headers",
},
}
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
mockRunner := &exe.MockRunner{
CaptureFn: func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
return "", "", nil
},
ShowFn: func(cmd *exec.Cmd) error { return nil },
}
cmdBuilder := &exe.CmdBuilder{
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
run := &runtime.Runtime{CmdBuilder: cmdBuilder, Cfg: &settings.Configuration{}}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg(tc.args...)
err := handleCmd(context.Background(),
run, cmdArgs, dbExc,
)
require.NoError(t, err)
for i, call := range mockRunner.ShowCalls {
show := call.Args[0].(*exec.Cmd).String()
show = strings.ReplaceAll(show, pacmanBin, "pacman")
// options are in a different order on different systems and on CI root user is used
assert.Subset(t, strings.Split(show, " "),
strings.Split(tc.wantShow[i], " "),
fmt.Sprintf("%d - %s", i, show))
}
})
}
}
func TestIntegrationCleanAUR(t *testing.T) {
buildDir := filepath.Join(t.TempDir(), "build")
yayGitDir := filepath.Join(buildDir, "yay-git")
zoomDir := filepath.Join(buildDir, "zoom")
t.Parallel()
testCases := []struct {
name string
args []string
wantDirs []string
}{
{
name: "Sync clean AUR",
args: []string{"S", "c", "a"},
wantDirs: []string{"zoom"},
},
{
name: "Sync clean double AUR",
args: []string{"S", "c", "c", "a"},
wantDirs: []string{},
},
}
dbExc := &mock.DBExecutor{
PackageOptionalDependsFn: func(i alpm.Package) []alpm.Depend {
if i.Name() == "linux" {
return []alpm.Depend{
{
Name: "linux-headers",
},
}
}
return []alpm.Depend{}
},
PackageProvidesFn: func(p alpm.Package) []alpm.Depend { return []alpm.Depend{} },
PackageDependsFn: func(p alpm.Package) []alpm.Depend { return []alpm.Depend{} },
InstalledRemotePackagesFn: func() map[string]alpm.Package {
return map[string]alpm.Package{
"zoom": &mock.Package{
PName: "zoom",
PVersion: "6.5.8-1",
PBase: "zoom",
PReason: alpm.PkgReasonExplicit,
},
}
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
mockRunner := &exe.MockRunner{}
cfg := &settings.Configuration{
BuildDir: buildDir,
Mode: parser.ModeAUR,
}
pacmanConf := &pacmanconf.Config{
// Only testing the keep installed clean method right now
CleanMethod: []string{"KeepInstalled"},
}
run := &runtime.Runtime{
Cfg: cfg,
PacmanConf: pacmanConf,
Logger: newTestLogger(),
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg(tc.args...)
// Create the package directories to be cleaned
err := os.MkdirAll(yayGitDir, 0o755)
require.NoError(t, err)
err = os.MkdirAll(zoomDir, 0o755)
require.NoError(t, err)
err = handleCmd(context.Background(),
run, cmdArgs, dbExc,
)
require.NoError(t, err)
// This should only test AUR cleaning, so no calls to an external command should be made
assert.Len(t, mockRunner.ShowCalls, 0)
// Make sure the directories left after cleaning are the only ones we expect
packageDirs, err := os.ReadDir(buildDir)
require.NoError(t, err)
var packageDirNames []string
for _, dir := range packageDirs {
packageDirNames = append(packageDirNames, dir.Name())
}
assert.ElementsMatch(t, tc.wantDirs, packageDirNames)
})
}
}
================================================
FILE: cmd.go
================================================
package main
import (
"context"
"errors"
"fmt"
"net/http"
"strings"
alpm "github.com/Jguer/dyalpm"
"github.com/leonelquinteros/gotext"
"github.com/Jguer/yay/v12/pkg/completion"
"github.com/Jguer/yay/v12/pkg/db"
"github.com/Jguer/yay/v12/pkg/download"
"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"
"github.com/Jguer/yay/v12/pkg/text"
"github.com/Jguer/yay/v12/pkg/upgrade"
"github.com/Jguer/yay/v12/pkg/vcs"
)
func usage(logger *text.Logger) {
logger.Println(`Usage:
yay
yay <operation> [...]
yay <package(s)>
operations:
yay {-h --help}
yay {-V --version}
yay {-D --database} <options> <package(s)>
yay {-F --files} [options] [package(s)]
yay {-Q --query} [options] [package(s)]
yay {-R --remove} [options] <package(s)>
yay {-S --sync} [options] [package(s)]
yay {-T --deptest} [options] [package(s)]
yay {-U --upgrade} [options] <file(s)>
New operations:
yay {-B --build} [options] [dir]
yay {-G --getpkgbuild} [options] [package(s)]
yay {-P --show} [options]
yay {-W --web} [options] [package(s)]
yay {-Y --yay} [options] [package(s)]
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
-a --aur Assume targets are from the AUR
Permanent configuration options:
--save Causes the following options to be saved back to the
config file when used
--aururl <url> Set an alternative AUR URL
--aurrpcurl <url> Set an alternative URL for the AUR /rpc endpoint
--builddir <dir> Directory used to download and run PKGBUILDS
--editor <file> Editor to use when editing PKGBUILDs
--editorflags <flags> Pass arguments to editor
--makepkg <file> makepkg command to use
--mflags <flags> Pass arguments to makepkg
--pacman <file> pacman command to use
--git <file> git command to use
--gitflags <flags> Pass arguments to git
--gpg <file> gpg command to use
--gpgflags <flags> Pass arguments to gpg
--config <file> pacman.conf file to use
--makepkgconf <file> makepkg.conf file to use
--nomakepkgconf Use the default makepkg.conf
--requestsplitn <n> Max amount of packages to query per AUR request
--completioninterval <n> Time in days to refresh completion cache
--sortby <field> Sort AUR results by a specific field during search
--searchby <field> Search for packages using a specified field
--answerclean <a> Set a predetermined answer for the clean build menu
--answerdiff <a> Set a predetermined answer for the diff menu
--answeredit <a> Set a predetermined answer for the edit pkgbuild menu
--answerupgrade <a> Set a predetermined answer for the upgrade menu
--noanswerclean Unset the answer for the clean build menu
--noanswerdiff Unset the answer for the edit diff menu
--noansweredit Unset the answer for the edit pkgbuild menu
--noanswerupgrade Unset the answer for the upgrade menu
--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
--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
--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
--rebuild Always build target packages
--rebuildall Always build all AUR packages
--norebuild Skip package build if in cache and up to date
--rebuildtree Always build all AUR packages even if installed
--redownload Always download pkgbuilds of targets
--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
--pgpfetch Prompt to import PGP keys from PKGBUILDs
--useask Automatically resolve conflicts using pacman's ask flag
--sudo <file> sudo command to use
--sudoflags <flags> Pass arguments to sudo
--sudoloop Loop sudo calls in the background to avoid timeout
show specific options (used with -P):
-c --complete Used for completions
-d --defaultconfig Print default yay configuration
-g --currentconfig Print current yay configuration
-s --stats Display system package statistics
-w --news Print arch news
yay specific options (used with -Y):
-c --clean Remove unneeded dependencies (-cc to ignore optdepends)
--gendb Generates development package DB used for updating
getpkgbuild specific options (used with -G):
-f --force Force download for existing ABS packages
-p --print Print pkgbuild of packages`)
}
func handleCmd(ctx context.Context, run *runtime.Runtime,
cmdArgs *parser.Arguments, dbExecutor db.Executor,
) error {
if cmdArgs.ExistsArg("h", "help") {
return handleHelp(ctx, run, cmdArgs)
}
if run.Cfg.SudoLoop && cmdArgs.NeedRoot(run.Cfg.Mode) {
run.CmdBuilder.SudoLoop()
}
switch cmdArgs.Op {
case "V", "version":
handleVersion(run.Logger)
return nil
case "D", "database":
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
case "F", "files":
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
case "Q", "query":
return handleQuery(ctx, run, cmdArgs, dbExecutor)
case "R", "remove":
return handleRemove(ctx, run, cmdArgs, run.VCSStore)
case "S", "sync":
return handleSync(ctx, run, cmdArgs, dbExecutor)
case "T", "deptest":
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
case "U", "upgrade":
return handleUpgrade(ctx, run, cmdArgs)
case "B", "build":
return handleBuild(ctx, run, dbExecutor, cmdArgs)
case "G", "getpkgbuild":
return handleGetpkgbuild(ctx, run, cmdArgs, dbExecutor)
case "P", "show":
return handlePrint(ctx, run, cmdArgs, dbExecutor)
case "Y", "yay":
return handleYay(ctx, run, cmdArgs, run.CmdBuilder,
dbExecutor, run.QueryBuilder)
case "W", "web":
return handleWeb(ctx, run, cmdArgs)
}
return errors.New(gotext.Get("unhandled operation"))
}
// getFilter returns filter function which can keep packages which were only
// explicitly installed or ones installed as dependencies for showing available
// updates or their count.
func getFilter(cmdArgs *parser.Arguments) (upgrade.Filter, error) {
deps, explicit := cmdArgs.ExistsArg("d", "deps"), cmdArgs.ExistsArg("e", "explicit")
switch {
case deps && explicit:
return nil, errors.New(gotext.Get("invalid option: '--deps' and '--explicit' may not be used together"))
case deps:
return func(pkg *upgrade.Upgrade) bool {
return pkg.Reason == alpm.PkgReasonDepend
}, nil
case explicit:
return func(pkg *upgrade.Upgrade) bool {
return pkg.Reason == alpm.PkgReasonExplicit
}, nil
}
return func(pkg *upgrade.Upgrade) bool {
return true
}, nil
}
func handleQuery(ctx context.Context, run *runtime.Runtime, 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,
cmdArgs.ExistsDouble("u", "sysupgrade"), filter)
}
if err := run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.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("")
}
return err
}
return nil
}
func handleHelp(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments) error {
usage(run.Logger)
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))
}
func handleVersion(logger *text.Logger) {
logger.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 {
switch {
case cmdArgs.ExistsArg("d", "defaultconfig"):
tmpConfig := settings.DefaultConfig(yayVersion)
run.Logger.Printf("%v", tmpConfig)
return nil
case cmdArgs.ExistsArg("g", "currentconfig"):
run.Logger.Printf("%v", run.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)
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"), run.Logger)
case cmdArgs.ExistsArg("s", "stats"):
return localStatistics(ctx, run, dbExecutor)
}
return nil
}
func handleYay(ctx context.Context, run *runtime.Runtime,
cmdArgs *parser.Arguments, cmdBuilder exe.ICmdBuilder,
dbExecutor db.Executor, queryBuilder query.Builder,
) error {
switch {
case cmdArgs.ExistsArg("gendb"):
return createDevelDB(ctx, run, dbExecutor)
case cmdArgs.ExistsDouble("c"):
return cleanDependencies(ctx, run.Cfg, cmdBuilder, cmdArgs, dbExecutor, true)
case cmdArgs.ExistsArg("c", "clean"):
return cleanDependencies(ctx, run.Cfg, cmdBuilder, cmdArgs, dbExecutor, false)
case len(cmdArgs.Targets) > 0:
return displayNumberMenu(ctx, run, cmdArgs.Targets, dbExecutor, queryBuilder, cmdArgs)
}
return nil
}
func handleWeb(ctx context.Context, run *runtime.Runtime, cmdArgs *parser.Arguments) error {
switch {
case cmdArgs.ExistsArg("v", "vote"):
return handlePackageVote(ctx, cmdArgs.Targets, run.AURClient, run.Logger,
run.VoteClient, true)
case cmdArgs.ExistsArg("u", "unvote"):
return handlePackageVote(ctx, cmdArgs.Targets, run.AURClient, run.Logger,
run.VoteClient, false)
}
return nil
}
func handleGetpkgbuild(ctx context.Context, run *runtime.Runtime, 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 getPkgbuilds(ctx, dbExecutor, run.AURClient, run,
cmdArgs.Targets, cmdArgs.ExistsArg("f", "force"))
}
func handleUpgrade(ctx context.Context,
run *runtime.Runtime, cmdArgs *parser.Arguments,
) error {
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
}
// -B* options
func handleBuild(ctx context.Context,
run *runtime.Runtime, dbExecutor db.Executor, cmdArgs *parser.Arguments,
) error {
return installLocalPKGBUILD(ctx, run, cmdArgs, dbExecutor)
}
func handleSync(ctx context.Context, run *runtime.Runtime, 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"))
case cmdArgs.ExistsArg("p", "print", "print-format"):
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
case cmdArgs.ExistsArg("c", "clean"):
return syncClean(ctx, run, cmdArgs, dbExecutor)
case cmdArgs.ExistsArg("l", "list"):
return syncList(ctx, run, run.HTTPClient, cmdArgs, dbExecutor)
case cmdArgs.ExistsArg("g", "groups"):
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.Cfg.Mode, settings.NoConfirm))
case cmdArgs.ExistsArg("i", "info"):
return syncInfo(ctx, run, cmdArgs, targets, dbExecutor)
case cmdArgs.ExistsArg("u", "sysupgrade") || len(cmdArgs.Targets) > 0:
return syncInstall(ctx, run, cmdArgs, dbExecutor)
case cmdArgs.ExistsArg("y", "refresh"):
return run.CmdBuilder.Show(run.CmdBuilder.BuildPacmanCmd(ctx,
cmdArgs, run.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))
if err == nil {
localCache.RemovePackages(cmdArgs.Targets)
}
return err
}
// NumberMenu presents a CLI for selecting packages to install.
func displayNumberMenu(ctx context.Context, run *runtime.Runtime, pkgS []string, dbExecutor db.Executor,
queryBuilder query.Builder, cmdArgs *parser.Arguments,
) error {
queryBuilder.Execute(ctx, dbExecutor, pkgS)
if err := queryBuilder.Results(dbExecutor, query.NumberMenu); err != nil {
return err
}
if queryBuilder.Len() == 0 {
// no results were found
return nil
}
run.Logger.Infoln(gotext.Get("Packages to install (eg: 1 2 3, 1-3 or ^4)"))
numberBuf, err := run.Logger.GetInput("", false)
if err != nil {
return err
}
include, exclude, _, otherExclude := intrange.ParseNumberMenu(numberBuf)
targets, err := queryBuilder.GetTargets(include, exclude, otherExclude)
if err != nil {
return err
}
// modify the arguments to pass for the install
cmdArgs.Targets = targets
if len(cmdArgs.Targets) == 0 {
run.Logger.Println(gotext.Get(" there is nothing to do"))
return nil
}
return syncInstall(ctx, run, cmdArgs, dbExecutor)
}
func syncList(ctx context.Context, run *runtime.Runtime,
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() {
cmdArgs.Targets = append(cmdArgs.Targets[:i], cmdArgs.Targets[i+1:]...)
aur = true
}
}
if run.Cfg.Mode.AtLeastAUR() && (len(cmdArgs.Targets) == 0 || aur) {
scanner, err := download.GetPackageScanner(ctx, httpClient, run.Cfg.AURURL, run.Logger)
if err != nil {
return err
}
defer scanner.Close()
for scanner.Scan() {
name := scanner.Text()
if cmdArgs.ExistsArg("q", "quiet") {
run.Logger.Println(name)
} else {
run.Logger.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]"))))
}
run.Logger.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))
}
return nil
}
================================================
FILE: cmd_test.go
================================================
//go:build !integration
// +build !integration
package main
import (
"context"
"fmt"
"io"
"os"
"os/exec"
"strings"
"testing"
"github.com/Jguer/aur"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"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"
"github.com/Jguer/yay/v12/pkg/text"
"github.com/Jguer/yay/v12/pkg/vcs"
)
func TestYogurtMenuAURDB(t *testing.T) {
t.Skip("skip until Operation service is an interface")
t.Parallel()
makepkgBin := t.TempDir() + "/makepkg"
pacmanBin := t.TempDir() + "/pacman"
gitBin := t.TempDir() + "/git"
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
return "", "", nil
}
showOverride := func(cmd *exec.Cmd) error {
return nil
}
mockRunner := &exe.MockRunner{CaptureFn: captureOverride, ShowFn: showOverride}
cmdBuilder := &exe.CmdBuilder{
MakepkgBin: makepkgBin,
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg("Y")
cmdArgs.AddTarget("yay")
db := &mock.DBExecutor{
AlpmArchitecturesFn: func() ([]string, error) {
return []string{"x86_64"}, nil
},
RefreshHandleFn: func() error {
return nil
},
ReposFn: func() []string {
return []string{"aur"}
},
SyncPackagesFn: func(s ...string) []mock.IPackage {
return []mock.IPackage{
&mock.Package{
PName: "yay",
PBase: "yay",
PVersion: "10.0.0",
PDB: mock.NewDB("aur"),
},
}
},
LocalPackageFn: func(s string) mock.IPackage {
return nil
},
}
aurCache := &mockaur.MockAUR{
GetFn: func(ctx context.Context, query *aur.Query) ([]aur.Pkg, error) {
return []aur.Pkg{
{
Name: "yay",
PackageBase: "yay",
Version: "10.0.0",
},
}, nil
},
}
logger := text.NewLogger(io.Discard, os.Stderr, strings.NewReader("1\n"), true, "test")
run := &runtime.Runtime{
Cfg: &settings.Configuration{
RemoveMake: "no",
},
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)
require.NoError(t, err)
wantCapture := []string{}
wantShow := []string{
"pacman -S -y --config /etc/pacman.conf --",
"pacman -S -y -u --config /etc/pacman.conf --",
}
require.Len(t, mockRunner.ShowCalls, len(wantShow))
require.Len(t, mockRunner.CaptureCalls, len(wantCapture))
for i, call := range mockRunner.ShowCalls {
show := call.Args[0].(*exec.Cmd).String()
show = strings.ReplaceAll(show, makepkgBin, "makepkg")
show = strings.ReplaceAll(show, pacmanBin, "pacman")
show = strings.ReplaceAll(show, gitBin, "git")
// options are in a different order on different systems and on CI root user is used
assert.Subset(t, strings.Split(show, " "), strings.Split(wantShow[i], " "), fmt.Sprintf("%d - %s", i, show))
}
}
================================================
FILE: completions/bash
================================================
# This file is in the public domain.
_arch_compgen() {
local i r
COMPREPLY=($(compgen -W '$*' -- "$cur"))
for ((i = 1; i < ${#COMP_WORDS[@]} - 1; i++)); do
for r in ${!COMPREPLY[@]}; do
if [[ ${COMP_WORDS[i]} == ${COMPREPLY[r]} ]]; then
unset 'COMPREPLY[r]'
break
fi
done
done
}
_arch_ptr2comp() {
local list= x y
for x; do
for y in '0 --' '1 -'; do
eval 'set -- ${'$x'[${y% *}]}'
list+=\ ${@/#/${y#* }}
done
done
_arch_compgen $list
}
_arch_incomp() {
local r="[[:space:]]-(-${1#* }[[:space:]]|[[:alnum:]_]*${1% *})"
[[ $COMP_LINE =~ $r ]]
}
_pacman_pkg() {
_arch_compgen "$(
if [[ $2 ]]; then
\pacman -$1 2>/dev/null | \cut -d' ' -f1 | \sort -u
else
\pacman -$1 2>/dev/null
fi
)"
}
_yay_pkg() {
[ -z "$cur" ] && _pacman_pkg Slq && return
_arch_compgen "$(yay -Pc)"
}
_pacman_repo_list() {
_arch_compgen "$(pacman-conf --repo-list)"
}
_yay() {
compopt -o default
local common core cur database files prev query remove sync upgrade o
local yays show getpkgbuild web
local cur prev words cword
_init_completion || return
database=('asdeps asexplicit')
files=('list machinereadable refresh regex' 'l x y')
query=('changelog check deps explicit file foreign groups info list native owns
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')
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
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
nomakepkgconf askremovemake askyesremovemake removemake noremovemake completioninterval aururl aurrpcurl
searchby batchinstall'
'b d h q r v')
yays=('clean gendb' 'c')
show=('complete defaultconfig currentconfig stats news' 'c d g s w')
getpkgbuild=('force print' 'f p')
web=('vote unvote' 'v u')
for o in 'D database' 'F files' 'Q query' 'R remove' 'S sync' 'U upgrade' 'Y yays' 'P show' 'G getpkgbuild' 'W web'; do
_arch_incomp "$o" && break
done
if [[ $? != 0 ]]; then
_arch_ptr2comp core
elif [[ ! $prev =~ ^-[[:alnum:]_]*[Vbhr] && ! $prev == --@(cachedir|color|config|dbpath|help|hookdir|gpgdir|logfile|root|version) ]]; then
[[ $cur == -* ]] && _arch_ptr2comp ${o#* } common ||
case ${o% *} in
D | R)
_pacman_pkg Qq
;;
F)
{ _arch_incomp 'l list' && _pacman_pkg Slq; } ||
_arch_incomp 'o owns' ||
compopt +o default
;;
Q)
{ _arch_incomp 'g groups' && _pacman_pkg Qg sort; } ||
{ _arch_incomp 'p file' && _pacman_file; } ||
{ _arch_incomp 's search' && compopt +o default; } ||
{ _arch_incomp 'u upgrades' && compopt +o default; } ||
_arch_incomp 'o owns' ||
_pacman_pkg Qq
;;
S)
{ _arch_incomp 'g groups' && _pacman_pkg Sg; } ||
{ _arch_incomp 'l list' && _pacman_repo_list; } ||
{ _arch_incomp 's search' && compopt +o default; } ||
_yay_pkg
;;
U)
_pacman_file
;;
G)
_yay_pkg
;;
W)
_yay_pkg
;;
esac
fi
true
}
_pacman_file() {
compopt -o filenames
_filedir 'pkg.*'
}
complete -F _yay yay
# ex:et ts=2 sw=2 ft=sh
================================================
FILE: completions/fish
================================================
# vim:fdm=marker foldlevel=0 tabstop=2 shiftwidth=2 filetype=fish
# Original Author for pacman: Giorgio Lando <patroclo7@gmail.com>
# Updated for yay by jguer
set -l progname yay
# Yay constants
set -l listall "(yay -Pc)"
set -l listpacman "(__fish_print_packages)"
set -l yayspecific '__fish_contains_opt -s Y yay'
set -l webspecific '__fish_contains_opt -s W web'
set -l show '__fish_contains_opt -s P show'
set -l getpkgbuild '__fish_contains_opt -s G getpkgbuild'
# Pacman constants
set -l listinstalled "(pacman -Q | string replace ' ' \t)"
set -l listrepos "(__fish_print_pacman_repos)"
set -l listgroups "(pacman -Sg)\t'Package Group'"
set -l noopt 'not __fish_contains_opt -s S -s D -s Q -s R -s U -s T -s F -s Y -s W -s P -s G database query sync remove upgrade deptest files show getpkgbuild web yay'
set -l database '__fish_contains_opt -s D database'
set -l query '__fish_contains_opt -s Q query'
set -l remove '__fish_contains_opt -s R remove'
set -l sync '__fish_contains_opt -s S sync'
set -l upgrade '__fish_contains_opt -s U upgrade'
set -l files '__fish_contains_opt -s F files'
complete -c $progname -e
complete -c $progname -f
# HACK: We only need these two to coerce fish to stop file completion and complete options
complete -c $progname -n "$noopt" -a "-D" -d "Modify the package database"
complete -c $progname -n "$noopt" -a "-Q" -d "Query the package database"
# Primary operations
complete -c $progname -s D -f -l database -n "$noopt" -d 'Modify the package database'
complete -c $progname -s Q -f -l query -n "$noopt" -d 'Query the package database'
complete -c $progname -s R -f -l remove -n "$noopt" -d 'Remove packages from the system'
complete -c $progname -s S -f -l sync -n "$noopt" -d 'Synchronize packages'
complete -c $progname -s T -f -l deptest -n "$noopt" -d 'Check dependencies'
complete -c $progname -s U -l upgrade -n "$noopt" -d 'Upgrade or add a local package'
complete -c $progname -s F -f -l files -n "$noopt" -d 'Query the files database'
complete -c $progname -s V -f -l version -d 'Display version and exit'
complete -c $progname -s h -f -l help -d 'Display help'
# General options
# Only offer these once a command has been given so they get prominent display
complete -c $progname -n "not $noopt" -s b -l dbpath -d 'Alternate database location' -xa "(__fish_complete_directories)"
complete -c $progname -n "not $noopt" -s r -l root -d 'Alternate installation root' -xa "(__fish_complete_directories)"
complete -c $progname -n "not $noopt" -s v -l verbose -d 'Output more status messages' -f
complete -c $progname -n "not $noopt" -l arch -d 'Alternate architecture' -f
complete -c $progname -n "not $noopt" -l cachedir -d 'Alternate package cache location' -xa "(__fish_complete_directories)"
complete -c $progname -n "not $noopt" -l color -d 'Colorize the output' -fa '{auto,always,never}'
complete -c $progname -n "not $noopt" -l config -d 'Alternate config file' -rF
complete -c $progname -n "not $noopt" -l confirm -d 'Always ask for confirmation' -f
complete -c $progname -n "not $noopt" -l debug -d 'Display debug messages' -f
complete -c $progname -n "not $noopt" -l disable-download-timeout -d 'Use relaxed timeouts for download' -f
complete -c $progname -n "not $noopt" -l gpgdir -d 'Alternate home directory for GnuPG' -xa "(__fish_complete_directories)"
complete -c $progname -n "not $noopt" -l hookdir -d 'Alternate hook location' -xa "(__fish_complete_directories)"
complete -c $progname -n "not $noopt" -l logfile -d 'Alternate log file'
complete -c $progname -n "not $noopt" -l noconfirm -d 'Bypass any confirmation' -f
complete -c $progname -n "not $noopt" -l sysroot -d 'Operate on a mounted guest system (root-only)' -xa "(__fish_complete_directories)"
# File, query, sync options (files, query, sync)
for condition in files query sync
complete -c $progname -n "$$condition" -s q -l quiet -d 'Show less information' -f
end
# Transaction options (sync, remove, upgrade)
for condition in sync remove upgrade
complete -c $progname -n "$$condition" -s d -l nodeps -d 'Skip [all] dependency checks' -f
complete -c $progname -n "$$condition" -s p -l print -d 'Dry run, only print targets' -f
complete -c $progname -n "$$condition" -l assume-installed -d 'Add a virtual package to satisfy dependencies' -f
complete -c $progname -n "$$condition" -l dbonly -d 'Modify database entry only' -f
complete -c $progname -n "$$condition" -l noprogressbar -d 'Do not display progress bar' -f
complete -c $progname -n "$$condition" -l noscriptlet -d 'Do not execute install script' -f
complete -c $progname -n "$$condition" -l print-format -d 'Specify printf-like format' -x
end
# File and query options (files, query)
for condition in files query
complete -c $progname -n "$$condition" -s l -l list -d 'List the files owned by PACKAGE' -f
end
# File and sync options (files, sync)
for condition in files sync
complete -c $progname -n "$$condition" -s y -l refresh -d 'Download fresh package databases [force]' -f
end
# Query and sync options (query, sync)
for condition in query sync
complete -c $progname -n "$$condition" -s g -l groups -d 'Display members of [all] package GROUP' -xa "$listgroups"
end
# Sync and upgrade options (sync, upgrade)
for condition in sync upgrade
complete -c $progname -n "$$condition" -l asdeps -d 'Install packages as non-explicitly installed' -f
complete -c $progname -n "$$condition" -l asexplicit -d 'Install packages as explicitly installed' -f
complete -c $progname -n "$$condition" -l ignore -d 'Ignore a package upgrade (can be used more than once)' -xa "$listall"
complete -c $progname -n "$$condition" -l ignoregroup -d 'Ignore a group upgrade (can be used more than once)' -xa "$listgroups"
complete -c $progname -n "$$condition" -l needed -d 'Do not reinstall up to date packages' -f
complete -c $progname -n "$$condition" -l overwrite -d 'Overwrite conflicting files (can be used more than once)' -rF
end
# Database options
set -l has_db_opt '__fish_contains_opt asdeps asexplicit check -s k'
complete -c $progname -n "$database; and not $has_db_opt" -s k -l check -d 'Check database validity'
complete -c $progname -n "$database" -s q -l quite -d 'Suppress output of success messages' -f
complete -c $progname -n "$database; and not $has_db_opt" -l asdeps -d 'Mark PACKAGE as dependency' -x
complete -c $progname -n "$database; and not $has_db_opt" -l asexplicit -d 'Mark PACKAGE as explicitly installed' -x
complete -c $progname -n "$has_db_opt; and $database" -xa "$listinstalled"
# File options - since pacman 5
complete -c $progname -n "$files" -s x -l regex -d 'Interpret each query as a regular expression' -f
complete -c $progname -n "$files" -l machinereadable -d 'Print each match in a machine readable output format' -f
complete -c $progname -n "$files" -d Package -xa "$listpacman"
# Query options
complete -c $progname -n "$query" -s c -l changelog -d 'View the change log of PACKAGE' -f
complete -c $progname -n "$query" -s d -l deps -d 'List only non-explicit packages (dependencies)' -f
complete -c $progname -n "$query" -s e -l explicit -d 'List only explicitly installed packages' -f
complete -c $progname -n "$query" -s i -l info -d 'View PACKAGE [backup files] information' -f
complete -c $progname -n "$query" -s k -l check -d 'Check that PACKAGE files exist' -f
complete -c $progname -n "$query" -s m -l foreign -d 'List installed packages not found in sync database' -f
complete -c $progname -n "$query" -s n -l native -d 'list installed packages only found in sync database' -f
complete -c $progname -n "$query" -s o -l owns -d 'Query the package that owns FILE' -rF
complete -c $progname -n "$query" -s p -l file -d 'Query a package file instead of the database' -rF
complete -c $progname -n "$query" -s s -l search -d 'Search locally-installed packages for regexp' -f
complete -c $progname -n "$query" -s t -l unrequired -d 'List only unrequired packages [and optdepends]' -f
complete -c $progname -n "$query" -s u -l upgrades -d 'List only out-of-date packages' -f
complete -c $progname -n "$query" -d 'Installed package' -xa "$listinstalled"
# Remove options
complete -c $progname -n "$remove" -s c -l cascade -d 'Also remove packages depending on PACKAGE' -f
complete -c $progname -n "$remove" -s n -l nosave -d 'Ignore file backup designations' -f
complete -c $progname -n "$remove" -s s -l recursive -d 'Also remove dependencies of PACKAGE' -f
complete -c $progname -n "$remove" -s u -l unneeded -d 'Only remove targets not required by PACKAGE' -f
complete -c $progname -n "$remove" -d 'Installed package' -xa "$listinstalled"
# Sync options
complete -c $progname -n "$sync" -s c -l clean -d 'Remove [all] packages from cache' -f
complete -c $progname -n "$sync" -s i -l info -d 'View PACKAGE [extended] information' -f
complete -c $progname -n "$sync" -s l -l list -d 'List all packages in REPOSITORY' -xa "$listrepos"
complete -c $progname -n "$sync" -s s -l search -d 'Search remote repositories for regexp' -f
complete -c $progname -n "$sync" -s u -l sysupgrade -d 'Upgrade all packages that are out of date'
complete -c $progname -n "$sync" -s w -l downloadonly -d 'Only download the target packages'
complete -c $progname -n "$sync" -xa "$listall $listgroups"
# Upgrade options
# Theoretically, pacman reads packages in all formats that libarchive supports
# In practice, it's going to be tar.xz, tar.gz, tar.zst, or just pkg.tar (uncompressed pkg)
complete -c $progname -n "$upgrade" -xa '(__fish_complete_suffix pkg.tar.zst; __fish_complete_suffix pkg.tar.xz; __fish_complete_suffix pkg.tar.gz; __fish_complete_suffix pkg.tar;)' -d 'Package file'
# Yay operations
complete -c $progname -s Y -f -l yay -n "$noopt" -d 'Yay specific operations'
complete -c $progname -s P -f -l show -n "$noopt" -d 'Print information'
complete -c $progname -s G -f -l getpkgbuild -n "$noopt" -d 'Get PKGBUILD from ABS or AUR'
complete -c $progname -s W -f -l web -n "$noopt" -d 'Web operations'
# Web options
complete -c $progname -n "$webspecific" -s v -l vote -d 'Vote for AUR packages' -f
complete -c $progname -n "$webspecific" -s u -l unvote -d 'Unvote for AUR packages' -f
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
# Yay options
complete -c $progname -n "$yayspecific" -s c -l clean -d 'Remove unneeded dependencies' -f
complete -c $progname -n "$yayspecific" -l gendb -d 'Generate development package DB' -f
# Show options
complete -c $progname -n "$show" -s c -l complete -d 'Print a list of all AUR and repo packages' -f
#complete -c $progname -n "$show" -s f -l fish -d 'During complete adjust the output for the fish shell' -f
complete -c $progname -n "$show" -s d -l defaultconfig -d 'Print default yay configuration' -f
complete -c $progname -n "$show" -s g -l currentconfig -d 'Print current yay configuration' -f
complete -c $progname -n "$show" -s s -l stats -d 'Display system package statistics' -f
complete -c $progname -n "$show" -s w -l news -d 'Print arch news' -f
complete -c $progname -n "$show" -s q -l quiet -d 'Do not print news description' -f
# Getpkgbuild options
complete -c $progname -n "$getpkgbuild" -s f -l force -d 'Force download for existing ABS packages' -f
complete -c $progname -n "$getpkgbuild" -xa "$listall"
complete -c $progname -n "$getpkgbuild" -s p -l print -d 'Print pkgbuild of packages' -f
# Permanent configuration settings
complete -c $progname -n "not $noopt" -l save -d 'Save current arguments to yay permanent configuration' -f
complete -c $progname -n "not $noopt" -l aururl -d 'Set an alternative AUR URL' -f
complete -c $progname -n "not $noopt" -l aurrpcurl -d 'Set an alternative URL for the AUR /rpc endpoint' -f
complete -c $progname -n "not $noopt" -l builddir -d 'Directory to use for Building AUR Packages' -r
complete -c $progname -n "not $noopt" -l editor -d 'Editor to use' -f
complete -c $progname -n "not $noopt" -l editorflags -d 'Editor flags to use' -f
complete -c $progname -n "not $noopt" -l makepkg -d 'Makepkg command to use' -f
complete -c $progname -n "not $noopt" -l pacman -d 'Pacman command to use' -f
complete -c $progname -n "not $noopt" -l tar -d 'Tar command to use' -f
complete -c $progname -n "not $noopt" -l git -d 'Git command to use' -f
complete -c $progname -n "not $noopt" -l gpg -d 'Gpg command to use' -f
complete -c $progname -n "not $noopt" -l config -d 'The pacman config file to use' -r
complete -c $progname -n "not $noopt" -l makepkgconf -d 'Use custom makepkg.conf location' -r
complete -c $progname -n "not $noopt" -l nomakepkgconf -d 'Use default makepkg.conf' -f
complete -c $progname -n "not $noopt" -l requestsplitn -d 'Max amount of packages to query per AUR request' -f
complete -c $progname -n "not $noopt" -l completioninterval -d 'Refresh interval for completion cache' -f
complete -c $progname -n "not $noopt" -l sortby -d 'Sort AUR results by a specific field during search' -xa "{votes,popularity,name,base,submitted,modified}"
complete -c $progname -n "not $noopt" -l searchby -d 'Search for AUR packages by querying the specified field' -xa "{name,name-desc,maintainer,depends,checkdepends,makedepends,optdepends}"
complete -c $progname -n "not $noopt" -l answerclean -d 'Set a predetermined answer for the clean build menu' -xa "{All,None,Installed,NotInstalled}"
complete -c $progname -n "not $noopt" -l answerdiff -d 'Set a predetermined answer for the edit diff menu' -xa "{All,None,Installed,NotInstalled}"
complete -c $progname -n "not $noopt" -l answeredit -d 'Set a predetermined answer for the edit pkgbuild menu' -xa "{All,None,Installed,NotInstalled}"
complete -c $progname -n "not $noopt" -l answerupgrade -d 'Set a predetermined answer for the upgrade menu' -f
complete -c $progname -n "not $noopt" -l noanswerclean -d 'Unset the answer for the clean build menu' -f
complete -c $progname -n "not $noopt" -l noanswerdiff -d 'Unset the answer for the diff menu' -f
complete -c $progname -n "not $noopt" -l noansweredit -d 'Unset the answer for the edit pkgbuild menu' -f
complete -c $progname -n "not $noopt" -l noanswerupgrade -d 'Unset the answer for the upgrade menu' -f
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 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
complete -c $progname -n "not $noopt" -l noremovemake -d 'Do not remove make deps after install' -f
complete -c $progname -n "not $noopt" -l topdown -d 'Shows repository packages first and then aur' -f
complete -c $progname -n "not $noopt" -l bottomup -d 'Shows aur packages first and then repository' -f
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 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 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 pgpfetch -d 'Prompt to import PGP keys from PKGBUILDs' -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 combinedupgrade -d 'Refresh then perform the repo and AUR upgrade together' -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 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
complete -c $progname -n "not $noopt" -l norebuild -d 'Skip package build if in cache and up to date' -f
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
================================================
FILE: completions/zsh
================================================
#compdef yay
# vim:noexpandtab tabstop=2 shiftwidth=2 filetype=zsh
typeset -A opt_args
setopt extendedglob
# options for passing to _arguments: main pacman commands
_pacman_opts_commands=(
{-D,--database}'[Modify database]'
{-F,--files}'[Query the files database]'
{-G,--getpkgbuild}'[Get PKGBUILD from ABS or AUR]'
{-Q,--query}'[Query the package database]'
{-R,--remove}'[Remove a package from the system]'
{-P,--show}'[Print yay information]'
{-S,--sync}'[Synchronize packages]'
{-T,--deptest}'[Check if dependencies are installed]'
{-U,--upgrade}'[Upgrade a package]'
{-Y,--yay}'[Yay specific options]'
{-W,--web}'[web options]'
{-V,--version}'[Display version and exit]'
'(-h --help)'{-h,--help}'[Display usage]'
)
# options for passing to _arguments: options common to all commands
_pacman_opts_common=(
'(-N --repo)'{-N,--repo}'[Assume targets are from the repositories]'
'(-a --aur)'{-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'
'--arch[Set an alternate architecture]'
'(-b --dbpath)'{-b,--dbpath}'[Alternate database location]:database_location:_files -/'
'--color[colorize the output]:color options:(always never auto)'
'(- *)'{-h,--help}'[Display syntax for the given operation]'
'(-r --root)'{-r,--root}'[Set alternate installation root]:installation root:_files -/'
'(-v --verbose)'{-v,--verbose}'[Be more verbose]'
'--cachedir[Alternate package cache location]:cache_location:_files -/'
'--config[An alternate configuration file]:config file:_files'
'(--nomakepkgconf)--makepkgconf[makepkg.conf file to use]:config file:_files'
'(--makepkgconf)--nomakepkgconf[Use the default makepkg.conf]'
'--requestsplitn[Max amount of packages to query per AUR request]:number'
'--completioninterval[Time in days to refresh completion cache]:number'
'--confirm[Always ask for confirmation]'
'--debug[Display debug messages]'
'--gpgdir[Set an alternate directory for GnuPG (instead of /etc/pacman.d/gnupg)]: :_files -/'
'--hookdir[Set an alternate hook location]: :_files -/'
'--logfile[An alternate log file]:config file:_files'
'--noconfirm[Do not ask for confirmation]'
'--noprogressbar[Do not show a progress bar when downloading files]'
'--noscriptlet[Do not execute the install scriptlet if one exists]'
'--save[Causes config options to be saved back to the config file]'
'--builddir[Directory to use for building AUR Packages]:build dir:_files -/'
'--editor[Editor to use when editing PKGBUILDs]:editor:_files'
'--editorflags[Flags to pass to editor]'
'--makepkg[makepkg command to use]:makepkg:_files'
'--pacman[pacman command to use]:pacman:_files'
'--git[git command to use]:git:_files'
'--gpg[gpg command to use]:gpg:_files'
'--sortby[Sort AUR results by a specific field during search]:sortby options:(votes popularity name base submitted modified)'
'--searchby[Search for packages using a specified field]:query'
'(--noanswerclean)--answerclean[Set a predetermined answer for the clean build menu]:answer'
'(--noanswerdiff)--answerdiff[Set a predetermined answer for the diff menu]:answer'
'(--noansweredit)--answeredit[Set a predetermined answer for the edit pkgbuild menu]:answer'
'(--noanswerupgrade)--answerupgrade[Set a predetermined answer for the upgrade menu]:answer'
'(--answerclean)--noanswerclean[Unset the answer for the clean build menu]'
'(--answerdiff)--noanswerdiff[Unset the answer for the diff menu]'
'(--answeredit)--noansweredit[Unset the answer for the edit pkgbuild menu]'
'(--answerupgrade)--noanswerupgrade[Unset the answer for the upgrade menu]'
'--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]'
'(--askyesremovemake --removemake --noremovemake)--askremovemake[Ask to remove makedepends after install]'
'(--askremovemake --removemake --noremovemake)--askyesremovemake[Ask to remove makedepends after install(with "Y" as default)]'
'(--askremovemake --askyesremovemake --noremovemake)--removemake[Remove makedepends after install]'
"(--askremovemake --askyesremovemake --removemake)--noremovemake[Don't remove makedepends after install]"
'(--bottomup)--topdown[Show repository packages first]'
'(--topdown)--bottomup[Show AUR packages first]'
'(--doublelineresults)--singlelineresults[List each search result on its own line]'
'(--singlelineresults)--doublelineresults[List each search result on two lines, like pacman]'
'--devel[Check -git/-svn/-hg development version]'
'--cleanafter[Clean package sources after successful build]'
'--keepsrc[Keep pkg/ and src/ after building packages]'
'--separatesources[Separate query results by source, AUR and sync]'
'(--redownloadall --noredownload)--redownload[Always download pkgbuilds of targets]'
'(--redownload --noredownload)--redownloadall[Always download pkgbuilds of all AUR packages]'
'(--redownload --redownloadall)--noredownload[Skip pkgbuild download if in cache and up to date]'
'--provides[Look for matching providers when searching for packages]'
'--pgpfetch[Prompt to import PGP keys from PKGBUILDs]'
"--useask[Automatically resolve conflicts using pacman's ask flag]"
'--combinedupgrade[Refresh then perform the repo and AUR upgrade together]'
'--batchinstall[Build multiple AUR packages then install them together]'
'(--rebuildall --rebuildtree --norebuild)--rebuild[Always build target packages]'
'(--rebuild --rebuildtree --norebuild)--rebuildall[Always build all AUR packages]'
'(--rebuild --rebuildall --norebuild)--rebuildtree[Always build all AUR packages even if installed]'
'(--rebuild --rebuildall --rebuildtree)--norebuild[Skip package build if in cache and up to date]'
'--mflags[Pass arguments to makepkg]:mflags'
'--gpgflags[Pass arguments to gpg]:gpgflags'
'--sudo[The command to use for sudo calls]:command'
'--sudoflags[Passes arguments to sudo]:flag'
'--sudoloop[Loop sudo calls in the background to avoid timeout]'
)
# options for passing to _arguments: options for --upgrade commands
_pacman_opts_pkgfile=(
'*-d[Skip dependency checks]'
'*--nodeps[Skip dependency checks]'
'*--assume-installed[Add virtual package to satisfy dependencies]'
'--dbonly[Only remove database entry, do not remove files]'
'--overwrite[Overwrite conflicting files]:file:_files -g "*"'
'--needed[Do not reinstall up to date packages]'
'(--asexplicit)--asdeps[mark packages as non-explicitly installed]'
'(--asdeps)--asexplicit[mark packages as explicitly installed]'
'(-p --print)'{-p,--print}'[Only print the targets instead of performing the operation]'
'*--ignore[Ignore a package upgrade]:package: _pacman_completions_all_packages'
'*--ignoregroup[Ignore a group upgrade]:package group:_pacman_completions_all_groups'
'--print-format[Specify how the targets should be printed]'
'*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"'
)
# options for passing to _arguments: subactions for --query command
_pacman_opts_query_actions=(
'(-Q --query)'{-Q,--query}
{-g,--groups}'[View all members of a package group]:*:package groups:->query_group'
{-o,--owns}'[Query the package that owns a file]:file:_files'
{-p,--file}'[Package file to query]:*:package file:->query_file'
{-s,--search}'[Search package names and descriptions]:*:search text:->query_search'
)
# options for passing to _arguments: options for --query and subcommands
_pacman_opts_query_modifiers=(
'(-c --changelog)'{-c,--changelog}'[List package changelog]'
'(-d --deps)'{-d,--deps}'[List packages installed as dependencies]'
'(-e --explicit)'{-e,--explicit}'[List packages explicitly installed]'
{\*-i,\*--info}'[View package information]'
{\*-k,\*--check}'[Check package files]'
'(-l --list)'{-l,--list}'[List package contents]'
'(-m --foreign)'{-m,--foreign}'[List installed packages not found in sync db(s)]'
'(-n --native)'{-n,--native}'[List installed packages found in sync db(s)]'
'(-q --quiet)'{-q,--quiet}'[Show less information for query and search]'
'(-t --unrequired)'{-t,--unrequired}'[List packages not required by any package]'
'(-u --upgrades)'{-u,--upgrades}'[List packages that can be upgraded]'
)
# -Y
_pacman_opts_yay_modifiers=(
'(-c --clean)'{-c,--clean}'[Remove unneeded dependencies]'
'--gendb[Generates development package DB used for updating]'
)
# -G
_pacman_opts_getpkgbuild_modifiers=(
'(-f --force)'{-f,--force}'[Force download for existing ABS packages]'
'(-p --print)'{-p,--print}'[Print PKGBUILDs]:package:_pacman_completions_all_packages'
)
# -W
_pacman_opts_web_modifiers=(
'(-u --unvote)'{-u,--unvote}'[Unvote AUR package]:package:_pacman_completions_all_packages'
'(-v --vote)'{-v,--vote}'[Vote AUR package]:package:_pacman_completions_all_packages'
)
# -P
_pacman_opts_print_modifiers=(
'(-c --complete)'{-c,--complete}'[Used for completions]'
'(-d --defaultconfig)'{-d,--defaultconfig}'[Print default yay configuration]'
'(-g --config)'{-g,--config}'[Print current yay configuration]'
'(-n --numberupgrades)'{-n,--numberupgrades}'[Print number of updates]'
'(-s --stats)'{-s,--stats}'[Display system package statistics]'
'(-u --upgrades)'{-u,--upgrades}'[Print update list]'
'(-w --news)'{-w,--news}'[Print arch news]'
)
# options for passing to _arguments: options for --remove command
_pacman_opts_remove=(
'(-c --cascade)'{-c,--cascade}'[Remove all dependent packages]'
'(-d --nodeps)'{-d,--nodeps}'[Skip dependency checks]'
'*--assume-installed[Add virtual package to satisfy dependencies]'
'(-n --nosave)'{-n,--nosave}'[Remove protected configuration files]'
'(-p --print)'{-p,--print}'[Only print the targets instead of performing the operation]'
{\*-s,\*--recursive}'[Remove dependencies not required by other packages]'
'(-u --unneeded)'{-u,--unneeded}'[Remove unneeded packages]'
'--dbonly[Only remove database entry, do not remove files]'
'--print-format[Specify how the targets should be printed]'
'*:installed package:_pacman_completions_installed_packages'
)
_pacman_opts_database=(
'(--asexplicit)--asdeps[mark packages as non-explicitly installed]'
'(--asdeps)--asexplicit[mark packages as explicitly installed]'
'*:installed package:_pacman_completions_installed_packages'
)
_pacman_opts_files=(
'(-l --list)'{-l,--list}'[List the files owned by the queried package]:package:_pacman_completions_all_packages'
'(-x --regex)'{-x,--regex}'[Enable searching using regular expressions]:regex:'
'(-y --refresh)'{-y,--refresh}'[Download fresh files databases from the server]'
'--machinereadable[Produce machine-readable output]'
'(-q --quiet)'{-q,--quiet}'[Show less information for query and search]'
)
# options for passing to _arguments: options for --sync command
_pacman_opts_sync_actions=(
'(-S --sync)'{-S,--sync}
{\*-c,\*--clean}'[Remove old packages from cache]:\*:clean:->sync_clean'
{-g,--groups}'[View all members of a package group]:*:package groups:->sync_group'
{-s,--search}'[Search package names and descriptions]:*:search text:->sync_search'
'--dbonly[Only remove database entry, do not remove files]'
'--needed[Do not reinstall up to date packages]'
'--recursive[Reinstall all dependencies of target packages]'
)
# options for passing to _arguments: options for --sync command
_pacman_opts_sync_modifiers=(
{\*-d,\*--nodeps}'[Skip dependency checks]'
'*--assume-installed[Add virtual package to satisfy dependencies]'
{\*-i,\*--info}'[View package information]'
'(-l --list)'{-l,--list}'[List all packages in a repository]'
'(-p --print)'{-p,--print}'[Print download URIs for each package to be installed]'
'(-q --quiet)'{-q,--quiet}'[Show less information for query and search]'
{\*-u,\*--sysupgrade}'[Upgrade all out-of-date packages]'
'(-w --downloadonly)'{-w,--downloadonly}'[Download packages only]'
{\*-y,\*--refresh}'[Download fresh package databases]'
'*--ignore[Ignore a package upgrade]:package: _pacman_completions_all_packages'
'*--ignoregroup[Ignore a group upgrade]:package group:_pacman_completions_all_groups'
'(--asexplicit)--asdeps[Install packages as non-explicitly installed]'
'(--asdeps)--asexplicit[Install packages as explicitly installed]'
'--overwrite[Overwrite conflicting files]:files:_files'
'--print-format[Specify how the targets should be printed]'
)
# handles --help subcommand
_pacman_action_help() {
_arguments -s : \
"$_pacman_opts_commands[@]"
}
# handles cases where no subcommand has yet been given
_pacman_action_none() {
_arguments -s : \
"$_pacman_opts_commands[@]"
}
# handles --query subcommand
_pacman_action_query() {
local context state line
typeset -A opt_args
case $state in
query_file)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"'
;;
query_group)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:groups:_pacman_completions_installed_groups'
;;
query_owner)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:file:_files'
;;
query_search)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:search text: '
;;
*)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_actions[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:package:_pacman_completions_installed_packages'
;;
esac
}
# handles --remove subcommand
_pacman_action_remove() {
_arguments -s : \
'(--remove -R)'{-R,--remove} \
"$_pacman_opts_common[@]" \
"$_pacman_opts_remove[@]"
}
# handles --database subcommand
_pacman_action_database() {
_arguments -s : \
'(--database -D)'{-D,--database} \
"$_pacman_opts_common[@]" \
"$_pacman_opts_database[@]"
}
# handles --files subcommand
_pacman_action_files() {
_arguments -s : \
'(--files -F)'{-F,--files} \
"$_pacman_opts_common[@]" \
"$_pacman_opts_files[@]"
}
_pacman_action_deptest () {
_arguments -s : \
'(--deptest)-T' \
"$_pacman_opts_common[@]" \
":packages:_pacman_all_packages"
}
# handles --sync subcommand
_pacman_action_sync() {
local context state line
typeset -A opt_args
if (( $+words[(r)--clean] )); then
state=sync_clean
elif (( $+words[(r)--groups] )); then
state=sync_group
elif (( $+words[(r)--search] )); then
state=sync_search
fi
case $state in
sync_clean)
_arguments -s : \
{\*-c,\*--clean}'[Remove old packages from cache]' \
"$_pacman_opts_common[@]" \
"$_pacman_opts_sync_modifiers[@]"
;;
sync_group)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_sync_modifiers[@]" \
'(-g --group)'{-g,--groups} \
'*:package group:_pacman_completions_all_groups'
;;
sync_search)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_sync_modifiers[@]" \
'*:search text: '
;;
*)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_sync_actions[@]" \
"$_pacman_opts_sync_modifiers[@]" \
'*:package:_pacman_completions_all_packages'
;;
esac
}
# handles --upgrade subcommand
_pacman_action_upgrade() {
_arguments -s : \
'(-U --upgrade)'{-U,--upgrade} \
"$_pacman_opts_common[@]" \
"$_pacman_opts_pkgfile[@]"
}
# handles --version subcommand
_pacman_action_version() {
# no further arguments
return 0
}
# provides completions for package groups
_pacman_completions_all_groups() {
local -a cmd groups
_pacman_get_command
groups=( $(_call_program groups $cmd[@] -Sg) )
typeset -U groups
if [[ ${words[CURRENT-1]} == '--ignoregroup' ]]; then
_sequence compadd -S ',' "$@" -a groups
else
compadd "$@" -a groups
fi
}
# provides completions for packages available from repositories
# these can be specified as either 'package' or 'repository/package'
_pacman_completions_all_packages() {
local -a seq sep cmd packages repositories packages_long
if [[ ${words[CURRENT-1]} == '--ignore' ]]; then
seq='_sequence'
sep=(-S ',')
else
seq=
sep=()
fi
if compset -P1 '*/*'; then
packages=( $(_call_program packages yay -Pc ${words[CURRENT]%/*}) )
typeset -U packages
${seq} _wanted repo_packages expl "repository/package" compadd ${sep[@]} ${(@)packages}
else
packages=( $(_call_program packages yay -Pc ) )
typeset -U packages
${seq} _wanted packages expl "packages" compadd ${sep[@]} - "${(@)packages}"
repositories=($(pacman-conf --repo-list))
typeset -U repositories
_wanted repo_packages expl "repository/package" compadd -S "/" $repositories
fi
}
# provides completions for package groups
_pacman_completions_installed_groups() {
local -a cmd groups
_pacman_get_command
groups=(${(o)${(f)"$(_call_program groups $cmd[@] -Qg)"}% *})
typeset -U groups
compadd "$@" -a groups
}
# provides completions for installed packages
_pacman_completions_installed_packages() {
local -a cmd packages packages_long
packages_long=(/var/lib/pacman/local/*(/))
packages=( ${${packages_long#/var/lib/pacman/local/}%-*-*} )
compadd "$@" -a packages
}
_pacman_all_packages() {
_alternative : \
'localpkgs:local packages:_pacman_completions_installed_packages' \
'repopkgs:repository packages:_pacman_completions_all_packages'
}
# provides completions for repository names
_pacman_completions_repositories() {
local -a cmd repositories
repositories=($(pacman-conf --repo-list))
# Uniq the array
typeset -U repositories
compadd "$@" -a repositories
}
# builds command for invoking pacman in a _call_program command - extracts
# relevant options already specified (config file, etc)
# $cmd must be declared by calling function
_pacman_get_command() {
# this is mostly nicked from _perforce
cmd=( "pacman" "2>/dev/null")
integer i
for (( i = 2; i < CURRENT - 1; i++ )); do
if [[ ${words[i]} = "--config" || ${words[i]} = "--root" ]]; then
cmd+=( ${words[i,i+1]} )
fi
done
}
# main dispatcher
_pacman_zsh_comp() {
local -a args cmds;
local tmp
args=( ${${${(M)words:#-*}#-}:#-*} )
for tmp in $words; do
cmds+=("${${_pacman_opts_commands[(r)*$tmp\[*]%%\[*}#*\)}")
done
case $args in #$words[2] in
h*)
if (( ${(c)#args} <= 1 && ${(w)#cmds} <= 1 )); then
_pacman_action_help
else
_message "no more arguments"
fi
;;
*h*)
_message "no more arguments"
;;
D*)
_pacman_action_database
;;
F*)
_pacman_action_files
;;
Q*g*) # ipkg groups
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:groups:_pacman_completions_installed_groups'
;;
Q*o*) # file
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:package file:_files'
;;
Q*p*) # file *.pkg.tar*
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_query_modifiers[@]" \
'*:package file:_files -g "*.pkg.tar*~*.sig(.,@)"'
;;
Q*)
_pacman_action_query
;;
P*)
_arguments -s : \
'-P' \
"$_pacman_opts_print_modifiers[@]"
;;
W*)
_arguments -s : \
'-W' \
"$_pacman_opts_web_modifiers[@]"
;;
R*)
_pacman_action_remove
;;
S*c*) # no completion
_arguments -s : \
'(-c --clean)'{\*-c,\*--clean}'[Remove all files from the cache]' \
"$_pacman_opts_common[@]"
;;
S*l*) # repos
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_sync_modifiers[@]" \
'*:package repo:_pacman_completions_repositories' \
;;
S*g*) # pkg groups
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_sync_modifiers[@]" \
'*:package group:_pacman_completions_all_groups'
;;
S*s*)
_arguments -s : \
"$_pacman_opts_common[@]" \
"$_pacman_opts_sync_modifiers[@]" \
'*:search text: '
;;
S*)
_pacman_action_sync
;;
T*)
_pacman_action_deptest
;;
U*)
_pacman_action_upgrade
;;
V*)
_pacman_action_version
;;
Y*)
_arguments -s : \
'-Y' \
"$_pacman_opts_yay_modifiers[@]"
;;
G*)
_arguments -s : \
'-G' \
"$_pacman_opts_getpkgbuild_modifiers[@]"
;;
*)
case ${(M)words:#--*} in
*--help*)
if (( ${(w)#cmds} == 1 )); then
_pacman_action_help
else
return 0;
fi
;;
*--sync*)
_pacman_action_sync
;;
*--query*)
_pacman_action_query
;;
*--remove*)
_pacman_action_remove
;;
*--deptest*)
_pacman_action_deptest
;;
*--database*)
_pacman_action_database
;;
*--files*)
_pacman_action_files
;;
*--version*)
_pacman_action_version
;;
*--upgrade*)
_pacman_action_upgrade
;;
*)
_pacman_action_none
;;
esac
;;
esac
}
_pacman_comp() {
case "$service" in
yay)
_pacman_zsh_comp "$@"
;;
*)
_message "Error"
;;
esac
}
_pacman_comp "$@"
================================================
FILE: doc/yay.8
================================================
.TH "YAY" "8" "2019\-10\-21" "Yay v12.0+" "Yay Manual"
.nh
.ad l
.SH NAME
yay \- AUR Helper written in go
.SH SYNOPSIS
\fIyay\fR <operation> [options] [targets]
.sp
\fIyay\fR <search terms>
.sp
\fIyay\fR
.SH DESCRIPTION
Yay is a Pacman wrapper with AUR support. It passes options to Makepkg and
Pacman after resolving packages to install/upgrade.
This manpage only covers options unique to Yay. For other options see
\fBpacman(8)\fR.
.SH YAY OPERATIONS
.TP
.B \-Y, \-\-yay
Perform yay specific operations. This is the default if no other operation is
selected and targets are defined.
.TP
.B \-B, \-\-build
Build a PKGBUILD in a given directory.
.TP
.B \-P, \-\-show
Perform yay specific print operations.
.TP
.B \-G, \-\-getpkgbuild
Downloads PKGBUILD from ABS or AUR. The ABS can only be used for Arch Linux repositories.
.TP
.B \-W, \-\-web
Web related operations such as voting for AUR packages.
.RE
If no operation is specified 'yay \-Syu' will be performed
If no operation is specified and targets are provided \-Y will be assumed
.SH EXTENDED PACMAN OPERATIONS
.TP
.B \-S, \-Si, \-Sl, \-Ss, \-Su, \-Sc, \-Qu
These operations are extended to support both AUR and repo packages.
.TP
.B \-Sc
Yay will also clean cached AUR package and any untracked Files in the
cache. Cleaning untracked files will wipe any downloaded sources or
built packages but will keep already downloaded vcs sources.
.TP
.B \-R
Yay will also remove cached data about devel packages.
.SH NEW OPTIONS
.TP
.B \-N, \-\-repo
Assume all targets are from the repositories. Additionally Actions such as
sysupgrade will only act on repository packages.
.TP
.B \-a, \-\-aur
Assume all targets are from the AUR. Additionally Actions such as
sysupgrade will only act on AUR packages.
Note that dependency resolving will still act normally and include repository
packages.
.SH YAY OPTIONS (APPLY TO \-Y AND \-\-YAY)
.TP
.B <NO OPTION>
Displays a list of packages matching the search terms and prompts the user on
which packages to install (yogurt mode).
The first search term is used to query the different sources and
the following search terms are used to narrow the search results
through exact matching.
.TP
.B \-\-gendb
Generate development package database. Tracks the latest commit for each
development package, when there is a new commit Yay will know to update. This
is done per package whenever a package is synced. This option should only be
used when migrating to Yay from another AUR helper.
.TP
.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
Print a list of all AUR and repo packages. This allows shell completion
and is not intended to be used directly by the user.
.TP
.B \-d, \-\-defaultconfig
Print default yay configuration.
.TP
.B \-g, \-\-currentconfig
Print current yay configuration.
.TP
.B \-s, \-\-stats
Displays information about installed packages and system health. If there are
orphaned, or out\-of\-date packages, or packages that no longer exist on the
AUR; warnings will be displayed.
.TP
.B \-w, \-\-news
Print new news from the Archlinux homepage. News is considered new if it is
newer than the build date of all native packages. Pass this twice to show all
available news.
.TP
.B \-q, \-\-quiet
Only show titles when printing news.
.SH BUILD OPTIONS (APPLY TO \-B AND \-\-build)
.TP
.B \-i, \-\-install
Build and install a PKGBUILD in a given directory
.SH GETPKGBUILD OPTIONS (APPLY TO \-G AND \-\-getpkgbuild)
.TP
.B \-f, \-\-force
Force download for ABS packages that already exist in the current directory. This
ensures directories are not accidentally overwritten.
.TP
.B \-p, \-\-print
Prints the PKGBUILD of the given packages to stdout.
.SH WEB OPTIONS (APPLY TO \-W AND \-\-web)
.TP
Web related operations such as voting for AUR packages.
Requires setting AUR_USERNAME and AUR_PASSWORD environment variables.
.TP
.B \-u, \-\-unvote
Remove vote from AUR package(s)
.TP
.B \-v, \-\-vote
Vote for AUR package(s)
.SH PERMANENT CONFIGURATION SETTINGS
.TP
.B \-\-save
Causes the following options to be saved back to the config file. This
provides an easy way to change config options without directly editing the
file.
.TP
.B \-\-aururl
Set an alternative AUR URL.
.TP
.B \-\-aurrpcurl
Set an alternative URL for the AUR /rpc endpoint.
.TP
.B \-\-builddir <dir>
Directory to use for Building AUR Packages. This directory is also used as
the AUR cache when deciding if Yay should skip builds.
.TP
.B \-\-editor <command>
Editor to use when editing PKGBUILDs. If this is not set the \fBVISUAL\fR
environment variable will be checked, followed by \fBEDITOR\fR. If none of
these are set Yay will prompt the user for an editor.
.TP
.B \-\-editorflags <flags>
Passes arguments to the editor. These flags get passed to every instance where
the editor is called by Yay. Arguments are split on whitespace before being
passed to the editor. Multiple arguments may be passed by supplying a space
separated list that is quoted by the shell.
.TP
.B \-\-makepkg <command>
The command to use for \fBmakepkg\fR calls. This can be a command in
\fBPATH\fR or an absolute path to the file.
.TP
.B \-\-pacman <command>
The command to use for \fBpacman\fR calls. This can be a command in
\fBPATH\fR or an absolute path to the file.
.TP
.B \-\-git <command>
The command to use for \fBgit\fR calls. This can be a command in
\fBPATH\fR or an absolute path to the file.
.TP
.B \-\-gitflags <flags>
Passes arguments to git. These flags get passed to every instance where
git is called by yay. Arguments are split on whitespace before being
passed to git. Multiple arguments may be passed by supplying a space
separated list that is quoted by the shell.
.TP
.B \-\-gpg <command>
The command to use for \fBgpg\fR calls. This can be a command in
\fBPATH\fR or an absolute path to the file.
.TP
.B \-\-config <file>
The pacman config file to use.
.TP
.B \-\-makepkgconf <file>
The config file for makepkg to use\%. If this is not set then the default
config file will be used.
.TP
.B \-\-nomakepkgconf
Reset the makepkg config file back to its default.
.TP
.B \-\-requestsplitn <number>
The maximum amount of packages to request per AUR query. The higher the
number the faster AUR requests will be. Requesting too many packages in one
AUR query will cause an error. This should only make a noticeable difference
with very large requests (>500) packages.
.TP
.B \-\-completioninterval <days>
Time in days to refresh the completion cache. Setting this to 0 will cause
the cache to be refreshed every time, while setting this to -1 will cause the
cache to never be refreshed.
.TP
.B \-\-sortby <votes|popularity|name|base|submitted|modified>
Sort AUR results by a specific field during search.
.TP
.B \-\-searchby <name|name-desc|maintainer|depends|checkdepends|makedepends|optdepends|provides|conflicts|replaces|groups|keywords|comaintainers>
Search for AUR packages by querying the specified field.
.TP
.B \-\-answerclean <All|None|Installed|NotInstalled|...>
Set a predetermined answer for the clean build menu question. This answer
will be used instead of reading from standard input but will be parsed exactly
the same.
.TP
.B \-\-answerdiff <All|None|Installed|NotInstalled|...>
Set a predetermined answer for the edit diff menu question. This answer
will be used instead of reading from standard input but will be parsed exactly
the same.
.TP
.B \-\-answeredit <All|None|Installed|NotInstalled|...>
Set a predetermined answer for the edit pkgbuild menu question. This answer
will be used instead of reading from standard input but will be parsed exactly
the same.
.TP
.B \-\-answerupgrade <Repo|^Repo|None|...>
Set a predetermined answer for the upgrade menu question. Selects which package
ranges or repos to omit for updates. This answer will be used instead of
reading from standard input but will be treated exactly the same.
.TP
.B \-\-noanswerclean
Unset the answer for the clean build menu.
.TP
.B \-\-noanswerdiff
Unset the answer for the diff menu.
.TP
.B \-\-noansweredit
Unset the answer for the edit pkgbuild menu.
.TP
.B \-\-noanswerupgrade
Unset the answer for the upgrade menu.
.TP
.B \-\-cleanmenu
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
build files before building.
Diffs are shown via \fBgit diff\fR which uses
less by default. This behaviour can be changed via git's config, the
\fB$GIT_PAGER\fR or \fB$PAGER\fR environment variables.
.TP
.B \-\-editmenu
Show the edit menu. This menu gives you the option to edit or view PKGBUILDs
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 \-\-askremovemake
Ask to remove makedepends after installing packages.
.TP
.B \-\-askyesremovemake
Ask to remove makedepends after installing packages(with "Y" as default).
.TP
.B \-\-removemake
Remove makedepends after installing packages.
.TP
.B \-\-noremovemake
Do not remove makedepends after installing packages.
.TP
.B \-\-topdown
Display repository packages first and then AUR packages.
.TP
.B \-\-bottomup
Show AUR packages first and then repository packages.
.TP
.B \-\-singlelineresults
Override pacman's usual double-line search result format and list each result
on its own line.
.TP
.B \-\-doublelineresults
Follow pacman's double-line search result format and list each result using
two lines.
.TP
.B \-\-devel
During sysupgrade also check AUR development packages for updates. Currently
only Git packages are supported.
Devel checking is done using \fBgit ls-remote\fR. The newest commit hash is
compared against the hash at install time. This allows devel updates to be
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 \-\-cleanafter
Remove untracked files after installation.
Untracked files are removed with the exception of directories.
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
.TP
.B \-\-separatesources
Separate query results by source, AUR and sync
.TP
.B \-\-redownload
Always download pkgbuilds of targets even when a copy is available in cache.
.TP
.B \-\-redownloadall
Always download pkgbuilds of all AUR packages even when a copy is available
in cache.
.TP
.B \-\-noredownload
When downloading pkgbuilds if the pkgbuild is found in cache and is equal or
newer than the AUR's version use that instead of downloading a new one.
.TP
.B \-\-provides
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 \-\-pgpfetch
Prompt to import unknown PGP keys from the \fBvalidpgpkeys\fR field of each
PKGBUILD.
.TP
.B \-\-useask
Use pacman's --ask flag to automatically confirm package conflicts. Yay lists
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 \-\-combinedupgrade
During sysupgrade, Yay will first perform a refresh, then show
its combined menu of repo and AUR packages that will be upgraded. Then after
reviewing the pkgbuilds, the repo and AUR upgrade will start with no need
for manual intervention.
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 \-\-batchinstall
When building and installing AUR packages instead of installing each package
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 \-\-rebuild
Always build target packages even when a copy is available in cache.
.TP
.B \-\-rebuildall
Always build all AUR packages even when a copy is available
in cache.
.TP
.B \-\-rebuildtree
When installing an AUR package rebuild and reinstall all of its AUR
dependencies recursively, even the ones already installed. This flag allows
you to easily rebuild packages against your current system's libraries if they
have become incompatible.
.TP
.B \-\-norebuild
When building packages if the package is found in cache and is an equal version
to the one wanted skip the package build and use the existing package.
.TP
.B \-\-mflags <flags>
Passes arguments to makepkg. These flags get passed to every instance where
makepkg is called by Yay. Arguments are split on whitespace before being
passed to makepkg. Multiple arguments may be passed by supplying a space
separated list that is quoted by the shell.
.TP
.B \-\-gpgflags <flags>
Passes arguments to gpg. These flags get passed to every instance where
gpg is called by Yay. Arguments are split on whitespace before being
passed to gpg. Multiple arguments may be passed by supplying a space
separated list that is quoted by the shell.
.TP
.B \-\-sudo <command>
The command to use for \fBsudo\fR calls. This can be a command in
\fBPATH\fR or an absolute path to the file.
The sudoloop is not guaranteed to work with a custom \fBsudo\fR command.
.TP
.B \-\-sudoflags <flags>
Passes arguments to sudo. These flags get passed to every instance where
sudo is called by Yay. Arguments are split on whitespace before being
passed to sudo. Multiple arguments may be passed by supplying a space
separated list that is quoted by the shell.
.TP
.B \-\-sudoloop
Loop sudo calls in the background to prevent sudo from timing out during long
builds.
.SH EXAMPLES
.TP
yay \fIfoo\fR
Search and install from the repos and the \fBAUR\fR\ using yogurt mode.
.TP
yay \-Syu
Update package list and upgrade all currently installed repo and \fBAUR\fR.
.TP
yay \-Sua
Update all currently installed \fBAUR\fR packages.
.TP
yay \-S \fIfoo\fR
Installs package \fIfoo\fR from the repos or the \fBAUR\fR.
.TP
yay \-Ss \fIfoo\fR
Searches for package \fIfoo\fR on the repos or the \fBAUR\fR.
.TP
yay \-Si \fIfoo\fR
Gets information about package \fIfoo\fR from the repos or the \fBAUR\fR.
.TP
yay \-S \fIfoo\fR \-\-mflags "\-\-skipchecksums \-\-skippgpcheck"
Installs \fIfoo\fR while skipping checksums and pgp checks.
.TP
yay \-\-devel \-\-save
Sets devel to true in the config.
.TP
yay \-P \-\-stats
Shows statistics for installed packages and system health.
.TP
pacman -Qmq | grep -Ee '-(cvs|svn|git|hg|bzr|darcs)$' | yay -S --needed -
pacaur-like devel check.
.SH ENVIRONMENT VARIABLES
.TP
.B AURDEST
Can be set to configure the build directory.
Overridden by \-\-builddir.
.TP
.B VISUAL, EDITOR
When editor is not configured, use these variables to pick what editor
to use when editing PKGBUILDS.
.SH FILES
.TP
.B CONFIG DIRECTORY
The config directory is \fI$XDG_CONFIG_HOME/yay/\fR. If
\fB$XDG_CONFIG_HOME\fR is unset, the config directory will fall back to
\fI$HOME/.config/yay\fR.
\fIconfig.json\fR Is used to store all of Yay's config options. Editing
this file should be done through Yay, using the options
mentioned in \fBPERMANENT CONFIGURATION SETTINGS\fR.
.TP
.B CACHE DIRECTORY
The cache directory is \fI$XDG_CACHE_HOME/yay/\fR. If
\fB$XDG_CACHE_HOME\fR is unset, the cache directory will fall back to
\fI$HOME/.cache/yay\fR.
\fIcompletion.cache\fR holds a list of of all packages, including the AUR,
for shell completion. By default the completion files are refreshed every
7 days.
\fIvcs.json\fR tracks VCS packages and the latest commit of each source. If
any of these commits change the package will be upgraded during a devel update.
.TP
.B BUILD DIRECTORY
Unless otherwise set this should be the same as \fBCACHE DIRECTORY\fR. This
directory is used to store downloaded AUR Packages as well as any source files
and built packages from those packages.
.TP
.B PACMAN.CONF
Yay uses Pacman's config file to set certain pacman options either through
go\-alpm or Yay itself. Options inherited include most libalpm options and
pacman options.
Notably: \fBDatabases\fR, \fBColor\fR and \fB*Path/*Dir\fR options are used.
.SH SEE ALSO
.BR makepkg (8),
.BR makepkg.conf (5),
.BR PKGBUILD (5),
.BR pacman (8),
.BR pacman.conf (5)
See the arch wiki at https://wiki.archlinux.org/index.php/Arch_User_Repository for more info on the \fBAUR\fR.
.SH BUGS
Please report bugs to our GitHub page https://github.com/Jguer/yay
.SH AUTHORS
Jguer <joguer@proton.me>
.br
Morgan <morganamilo@archlinux.org>
================================================
FILE: errors.go
================================================
package main
import (
"errors"
"github.com/leonelquinteros/gotext"
)
var ErrPackagesNotFound = errors.New(gotext.Get("could not find all required packages"))
================================================
FILE: get.go
================================================
package main
import (
"context"
"fmt"
"net/http"
"os"
"strings"
"github.com/Jguer/aur"
"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/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,
mode parser.TargetMode, aurURL string,
) error {
pkgbuilds, err := download.PKGBUILDs(dbExecutor, aurClient, httpClient, logger, targets, aurURL, mode)
if err != nil {
logger.Errorln(err)
}
for target, pkgbuild := range pkgbuilds {
logger.Printf("\n\n# %s\n\n%s", target, string(pkgbuild))
}
if len(pkgbuilds) != len(targets) {
missing := []string{}
for _, target := range targets {
if _, ok := pkgbuilds[target]; !ok {
missing = append(missing, target)
}
}
logger.Warnln(gotext.Get("Unable to find the following packages:"), " ", strings.Join(missing, ", "))
return fmt.Errorf("")
}
return nil
}
// yay -G.
func getPkgbuilds(ctx context.Context, dbExecutor download.DBSearcher, aurClient aur.QueryClient,
run *runtime.Runtime, targets []string, force bool,
) error {
wd, err := os.Getwd()
if err != nil {
return err
}
cloned, errD := download.PKGBUILDRepos(ctx, dbExecutor, aurClient,
run.CmdBuilder, run.Logger, targets, run.Cfg.Mode, run.Cfg.AURURL, wd, force)
if errD != nil {
run.Logger.Errorln(errD)
}
if len(targets) != len(cloned) {
missing := []string{}
for _, target := range targets {
if _, ok := cloned[target]; !ok {
missing = append(missing, target)
}
}
run.Logger.Warnln(gotext.Get("Unable to find the following packages:"), " ", strings.Join(missing, ", "))
err = fmt.Errorf("")
}
return err
}
================================================
FILE: go.mod
================================================
module github.com/Jguer/yay/v12
require (
github.com/Jguer/aur v1.3.0
github.com/Jguer/dyalpm v0.1.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.11.1
golang.org/x/net v0.52.0
golang.org/x/sys v0.42.0
golang.org/x/term v0.41.0
gopkg.in/h2non/gock.v1 v1.1.2
gopkg.in/ini.v1 v1.67.1
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ebitengine/purego v0.9.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.18 // indirect
github.com/itchyny/timefmt-go v0.1.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/ohler55/ojg v1.28.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
go 1.26
================================================
FILE: go.sum
================================================
github.com/Jguer/aur v1.3.0 h1:skdjp/P9kB75TBaJmn9PKK/kCeA9QsgjdUrORZ3gldU=
github.com/Jguer/aur v1.3.0/go.mod h1:F8Awo+WKzTxlXtNOO4pDQjMkePLZ+oMSbu+1fKLTTLo=
github.com/Jguer/dyalpm v0.1.1 h1:38JkmJuHIGXVZedXIDGz/nhVcn8DtMk4zM+GRGipC7w=
github.com/Jguer/dyalpm v0.1.1/go.mod h1:eUPJQ/zSclJKTxOPihpspulI+S8WQNsxHJoIBiBgogw=
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/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=
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible/go.mod h1:Au1Xw1sgaJ5iSFktEhYsS0dbQiS1B0/XMXl+42y9Ilk=
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/ebitengine/purego v0.9.1 h1:a/k2f2HQU3Pi399RPW1MOaZyhKJL9w/xFpKAg4q1s0A=
github.com/ebitengine/purego v0.9.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
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=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
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.18 h1:gFGHyt/MLbG9n6dqnvlliiya2TaMMh6FFaR2b1H6Drc=
github.com/itchyny/gojq v0.12.18/go.mod h1:4hPoZ/3lN9fDL1D+aK7DY1f39XZpY9+1Xpjz8atrEkg=
github.com/itchyny/timefmt-go v0.1.7 h1:xyftit9Tbw+Dc/huSSPJaEmX1TVL8lw5vxjJLK4GMMA=
github.com/itchyny/timefmt-go v0.1.7/go.mod h1:5E46Q+zj7vbTgWY8o5YkMeYb4I6GeWLFnetPy5oBrAI=
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/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.28.0 h1:8xClBgMIRRJGDUC9xNe7NprP4kD2C3mQMeon3wY4KXA=
github.com/ohler55/ojg v1.28.0/go.mod h1:/Y5dGWkekv9ocnUixuETqiL58f+5pAsUfg5P8e7Pa2o=
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/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
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/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=
golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=
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=
gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
gopkg.in/ini.v1 v1.67.1 h1:tVBILHy0R6e4wkYOn3XmiITt/hEVH4TFMYvAX2Ytz6k=
gopkg.in/ini.v1 v1.67.1/go.mod h1:x/cyOwCgZqOkJoDIJ3c1KNHMo10+nLGAhh+kn3Zizss=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
================================================
FILE: local_install.go
================================================
// Experimental code for install local with dependency refactoring
// Not at feature parity with install.go
package main
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"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"
)
var ErrNoBuildFiles = errors.New(gotext.Get("cannot find PKGBUILD and .SRCINFO in directory"))
func srcinfoExists(ctx context.Context,
cmdBuilder exe.ICmdBuilder, targetDir string,
) error {
srcInfoDir := filepath.Join(targetDir, ".SRCINFO")
pkgbuildDir := filepath.Join(targetDir, "PKGBUILD")
if _, err := os.Stat(srcInfoDir); err == nil {
if _, err := os.Stat(pkgbuildDir); err == nil {
return nil
}
}
if _, err := os.Stat(pkgbuildDir); err == nil {
// run makepkg to generate .SRCINFO
srcinfo, stderr, err := cmdBuilder.Capture(cmdBuilder.BuildMakepkgCmd(ctx, targetDir, "--printsrcinfo"))
if err != nil {
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)
}
return nil
}
return fmt.Errorf("%w: %s", ErrNoBuildFiles, targetDir)
}
func installLocalPKGBUILD(
ctx context.Context,
run *runtime.Runtime,
cmdArgs *parser.Arguments,
dbExecutor db.Executor,
) error {
aurCache := run.AURClient
noCheck := strings.Contains(run.Cfg.MFlags, "--nocheck")
if len(cmdArgs.Targets) < 1 {
return errors.New(gotext.Get("no target directories specified"))
}
srcInfos := map[string]*gosrc.Srcinfo{}
for _, targetDir := range cmdArgs.Targets {
if err := srcinfoExists(ctx, run.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)
}
srcInfos[targetDir] = pkgbuild
}
grapher := dep.NewGrapher(dbExecutor, aurCache, false, settings.NoConfirm,
cmdArgs.ExistsDouble("d", "nodeps"), noCheck, cmdArgs.ExistsArg("needed"),
run.Logger.Child("grapher"))
graph, err := grapher.GraphFromSrcInfos(ctx, nil, srcInfos)
if err != nil {
return err
}
opService := sync.NewOperationService(ctx, dbExecutor, run)
multiErr := &multierror.MultiError{}
targets := graph.TopoSortedLayers(func(name string, ii *dep.InstallInfo) error {
if ii.Source == dep.Missing {
multiErr.Add(fmt.Errorf("%w: %s %s", ErrPackagesNotFound, name, ii.Version))
}
return nil
})
if err := multiErr.Return(); err != nil {
return err
}
return opService.Run(ctx, run, cmdArgs, targets, []string{})
}
================================================
FILE: local_install_test.go
================================================
//go:build !integration
// +build !integration
package main
import (
"context"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"slices"
"strings"
"sync"
"testing"
aur "github.com/Jguer/aur"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"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"
gitBin := t.TempDir() + "/git"
tmpDir := t.TempDir()
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
tars := []string{
tmpDir + "/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst",
}
wantShow := []string{
"makepkg --verifysource --skippgpcheck -f -Cc",
"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 -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 -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",
"git -C testdata/jfin git reset --hard HEAD",
"git -C testdata/jfin git merge --no-edit --ff",
"makepkg --packagelist",
}
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
return strings.Join(tars, "\n"), "", nil
}
once := sync.Once{}
showOverride := func(cmd *exec.Cmd) error {
once.Do(func() {
for _, tar := range tars {
f, err := os.OpenFile(tar, os.O_RDONLY|os.O_CREATE, 0o666)
require.NoError(t, err)
require.NoError(t, f.Close())
}
})
return nil
}
mockRunner := &exe.MockRunner{CaptureFn: captureOverride, ShowFn: showOverride}
cmdBuilder := &exe.CmdBuilder{
MakepkgBin: makepkgBin,
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg("B")
cmdArgs.AddArg("i")
cmdArgs.AddTarget("testdata/jfin")
settings.NoConfirm = true
defer func() { settings.NoConfirm = false }()
db := &mock.DBExecutor{
AlpmArchitecturesFn: func() ([]string, error) {
return []string{"x86_64"}, nil
},
LocalSatisfierExistsFn: func(s string) bool {
switch s {
case "dotnet-sdk>=6", "dotnet-sdk<7", "dotnet-runtime>=6", "dotnet-runtime<7", "jellyfin-server=10.8.4", "jellyfin-web=10.8.4":
return false
}
return true
},
SyncSatisfierFn: func(s string) mock.IPackage {
switch s {
case "dotnet-runtime>=6", "dotnet-runtime<7":
return &mock.Package{
PName: "dotnet-runtime-6.0",
PBase: "dotnet-runtime-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
case "dotnet-sdk>=6", "dotnet-sdk<7":
return &mock.Package{
PName: "dotnet-sdk-6.0",
PBase: "dotnet-sdk-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
}
return nil
},
LocalPackageFn: func(s string) mock.IPackage { return nil },
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
},
},
}
err = handleCmd(context.Background(), run, cmdArgs, db)
require.NoError(t, err)
require.Len(t, mockRunner.ShowCalls, len(wantShow))
require.Len(t, mockRunner.CaptureCalls, len(wantCapture))
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")
show = strings.ReplaceAll(show, gitBin, "git")
// options are in a different order on different systems and on CI root user is used
assert.Subset(t, strings.Split(show, " "), strings.Split(wantShow[i], " "), fmt.Sprintf("%d - %s", i, show))
}
}
func TestIntegrationLocalBuildOnly(t *testing.T) {
makepkgBin := t.TempDir() + "/makepkg"
pacmanBin := t.TempDir() + "/pacman"
gitBin := t.TempDir() + "/git"
tmpDir := t.TempDir()
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
tars := []string{
tmpDir + "/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst",
}
wantShow := []string{
"makepkg --verifysource --skippgpcheck -f -Cc",
"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 -c --nobuild --noextract --ignorearch",
"makepkg --nobuild -f -C --ignorearch",
"makepkg -c --nobuild --noextract --ignorearch",
}
wantCapture := []string{
"makepkg --packagelist",
"git -C testdata/jfin git reset --hard HEAD",
"git -C testdata/jfin git merge --no-edit --ff",
"makepkg --packagelist",
}
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
return strings.Join(tars, "\n"), "", nil
}
once := sync.Once{}
showOverride := func(cmd *exec.Cmd) error {
once.Do(func() {
for _, tar := range tars {
f, err := os.OpenFile(tar, os.O_RDONLY|os.O_CREATE, 0o666)
require.NoError(t, err)
require.NoError(t, f.Close())
}
})
return nil
}
mockRunner := &exe.MockRunner{CaptureFn: captureOverride, ShowFn: showOverride}
cmdBuilder := &exe.CmdBuilder{
MakepkgBin: makepkgBin,
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg("B")
cmdArgs.AddTarget("testdata/jfin")
settings.NoConfirm = true
defer func() { settings.NoConfirm = false }()
db := &mock.DBExecutor{
AlpmArchitecturesFn: func() ([]string, error) {
return []string{"x86_64"}, nil
},
LocalSatisfierExistsFn: func(s string) bool {
switch s {
case "dotnet-sdk>=6", "dotnet-sdk<7", "dotnet-runtime>=6", "dotnet-runtime<7", "jellyfin-server=10.8.4", "jellyfin-web=10.8.4":
return false
}
return true
},
SyncSatisfierFn: func(s string) mock.IPackage {
switch s {
case "dotnet-runtime>=6", "dotnet-runtime<7":
return &mock.Package{
PName: "dotnet-runtime-6.0",
PBase: "dotnet-runtime-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
case "dotnet-sdk>=6", "dotnet-sdk<7":
return &mock.Package{
PName: "dotnet-sdk-6.0",
PBase: "dotnet-sdk-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
}
return nil
},
LocalPackageFn: func(s string) mock.IPackage { return nil },
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
},
},
}
err = handleCmd(context.Background(), run, cmdArgs, db)
require.NoError(t, err)
require.Len(t, mockRunner.ShowCalls, len(wantShow))
require.Len(t, mockRunner.CaptureCalls, len(wantCapture))
for i, call := range mockRunner.ShowCalls {
show := call.Args[0].(*exec.Cmd).String()
show = strings.ReplaceAll(show, tmpDir, "/testdir")
show = strings.ReplaceAll(show, makepkgBin, "makepkg")
show = strings.ReplaceAll(show, pacmanBin, "pacman")
show = strings.ReplaceAll(show, gitBin, "git")
assert.Subset(t, strings.Split(show, " "), strings.Split(wantShow[i], " "), fmt.Sprintf("%d - %s", i, show))
}
}
func TestIntegrationLocalInstallMissingDep(t *testing.T) {
wantErr := ErrPackagesNotFound
makepkgBin := t.TempDir() + "/makepkg"
pacmanBin := t.TempDir() + "/pacman"
gitBin := t.TempDir() + "/git"
tmpDir := t.TempDir()
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
tars := []string{
tmpDir + "/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst",
}
wantShow := []string{}
wantCapture := []string{}
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
return strings.Join(tars, "\n"), "", nil
}
once := sync.Once{}
showOverride := func(cmd *exec.Cmd) error {
once.Do(func() {
for _, tar := range tars {
f, err := os.OpenFile(tar, os.O_RDONLY|os.O_CREATE, 0o666)
require.NoError(t, err)
require.NoError(t, f.Close())
}
})
return nil
}
mockRunner := &exe.MockRunner{CaptureFn: captureOverride, ShowFn: showOverride}
cmdBuilder := &exe.CmdBuilder{
MakepkgBin: makepkgBin,
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg("B")
cmdArgs.AddArg("i")
cmdArgs.AddTarget("testdata/jfin")
settings.NoConfirm = true
defer func() { settings.NoConfirm = false }()
db := &mock.DBExecutor{
AlpmArchitecturesFn: func() ([]string, error) {
return []string{"x86_64"}, nil
},
LocalSatisfierExistsFn: func(s string) bool {
switch s {
case "dotnet-sdk>=6", "dotnet-sdk<7", "dotnet-runtime>=6", "dotnet-runtime<7", "jellyfin-server=10.8.4", "jellyfin-web=10.8.4":
return false
}
return true
},
SyncSatisfierFn: func(s string) mock.IPackage {
switch s {
case "dotnet-runtime>=6", "dotnet-runtime<7":
return &mock.Package{
PName: "dotnet-runtime-6.0",
PBase: "dotnet-runtime-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
}
return nil
},
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
},
},
}
err = handleCmd(context.Background(), run, cmdArgs, db)
require.ErrorContains(t, err, wantErr.Error())
require.Len(t, mockRunner.ShowCalls, len(wantShow))
require.Len(t, mockRunner.CaptureCalls, len(wantCapture))
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")
show = strings.ReplaceAll(show, gitBin, "git")
// options are in a different order on different systems and on CI root user is used
assert.Subset(t, strings.Split(show, " "), strings.Split(wantShow[i], " "), fmt.Sprintf("%d - %s", i, show))
}
}
func TestIntegrationLocalInstallNeeded(t *testing.T) {
makepkgBin := t.TempDir() + "/makepkg"
pacmanBin := t.TempDir() + "/pacman"
gitBin := t.TempDir() + "/git"
tmpDir := t.TempDir()
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
tars := []string{
tmpDir + "/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst",
}
wantShow := []string{
"makepkg --verifysource --skippgpcheck -f -Cc",
"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 -c --nobuild --noextract --ignorearch",
"makepkg --nobuild -f -C --ignorearch",
"makepkg -c --nobuild --noextract --ignorearch",
}
wantCapture := []string{
"makepkg --packagelist",
"git -C testdata/jfin git reset --hard HEAD",
"git -C testdata/jfin git merge --no-edit --ff",
"makepkg --packagelist",
}
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
return strings.Join(tars, "\n"), "", nil
}
once := sync.Once{}
showOverride := func(cmd *exec.Cmd) error {
once.Do(func() {
for _, tar := range tars {
f, err := os.OpenFile(tar, os.O_RDONLY|os.O_CREATE, 0o666)
require.NoError(t, err)
require.NoError(t, f.Close())
}
})
return nil
}
mockRunner := &exe.MockRunner{CaptureFn: captureOverride, ShowFn: showOverride}
cmdBuilder := &exe.CmdBuilder{
MakepkgBin: makepkgBin,
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg("B")
cmdArgs.AddArg("i")
cmdArgs.AddArg("needed")
cmdArgs.AddTarget("testdata/jfin")
settings.NoConfirm = true
defer func() { settings.NoConfirm = false }()
db := &mock.DBExecutor{
AlpmArchitecturesFn: func() ([]string, error) {
return []string{"x86_64"}, nil
},
IsCorrectVersionInstalledFn: func(s1, s2 string) bool {
return true
},
LocalPackageFn: func(s string) mock.IPackage {
if s == "jellyfin-server" {
return &mock.Package{
PName: "jellyfin-server",
PBase: "jellyfin-server",
PVersion: "10.8.4-1",
PDB: mock.NewDB("community"),
}
}
return nil
},
LocalSatisfierExistsFn: func(s string) bool {
switch s {
case "dotnet-sdk>=6", "dotnet-sdk<7", "dotnet-runtime>=6", "dotnet-runtime<7", "jellyfin-server=10.8.4", "jellyfin-web=10.8.4":
return false
}
return true
},
SyncSatisfierFn: func(s string) mock.IPackage {
switch s {
case "dotnet-runtime>=6", "dotnet-runtime<7":
return &mock.Package{
PName: "dotnet-runtime-6.0",
PBase: "dotnet-runtime-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
case "dotnet-sdk>=6", "dotnet-sdk<7":
return &mock.Package{
PName: "dotnet-sdk-6.0",
PBase: "dotnet-sdk-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
}
return nil
},
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
},
},
}
err = handleCmd(context.Background(), run, cmdArgs, db)
require.NoError(t, err)
require.Len(t, mockRunner.ShowCalls, len(wantShow), "show calls: %v", mockRunner.ShowCalls)
require.Len(t, mockRunner.CaptureCalls, len(wantCapture))
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")
show = strings.ReplaceAll(show, gitBin, "git")
// options are in a different order on different systems and on CI root user is used
assert.Subset(t, strings.Split(show, " "), strings.Split(wantShow[i], " "), fmt.Sprintf("%d - %s", i, show))
}
}
func TestIntegrationLocalInstallGenerateSRCINFO(t *testing.T) {
makepkgBin := t.TempDir() + "/makepkg"
pacmanBin := t.TempDir() + "/pacman"
gitBin := t.TempDir() + "/git"
tmpDir := t.TempDir()
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
srcinfo, err := os.ReadFile("testdata/jfin/.SRCINFO")
require.NoError(t, err)
assert.True(t, strings.HasPrefix(string(srcinfo), "pkgbase = jellyfin"), string(srcinfo))
targetDir := t.TempDir()
f, err = os.OpenFile(filepath.Join(targetDir, "PKGBUILD"), os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
tars := []string{
tmpDir + "/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst",
}
wantShow := []string{
"makepkg --verifysource --skippgpcheck -f -Cc",
"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 -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 -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 --printsrcinfo",
"makepkg --packagelist",
"git -C testdata/jfin git reset --hard HEAD",
"git -C testdata/jfin git merge --no-edit --ff",
"makepkg --packagelist",
}
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
if slices.Contains(cmd.Args, "--printsrcinfo") {
return string(srcinfo), "", nil
}
return strings.Join(tars, "\n"), "", nil
}
once := sync.Once{}
showOverride := func(cmd *exec.Cmd) error {
once.Do(func() {
for _, tar := range tars {
f, err := os.OpenFile(tar, os.O_RDONLY|os.O_CREATE, 0o666)
require.NoError(t, err)
require.NoError(t, f.Close())
}
})
return nil
}
mockRunner := &exe.MockRunner{CaptureFn: captureOverride, ShowFn: showOverride}
cmdBuilder := &exe.CmdBuilder{
MakepkgBin: makepkgBin,
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg("B")
cmdArgs.AddArg("i")
cmdArgs.AddTarget(targetDir)
settings.NoConfirm = true
defer func() { settings.NoConfirm = false }()
db := &mock.DBExecutor{
AlpmArchitecturesFn: func() ([]string, error) {
return []string{"x86_64"}, nil
},
LocalSatisfierExistsFn: func(s string) bool {
switch s {
case "dotnet-sdk>=6", "dotnet-sdk<7", "dotnet-runtime>=6", "dotnet-runtime<7", "jellyfin-server=10.8.4", "jellyfin-web=10.8.4":
return false
}
return true
},
LocalPackageFn: func(string) mock.IPackage { return nil },
SyncSatisfierFn: func(s string) mock.IPackage {
switch s {
case "dotnet-runtime>=6", "dotnet-runtime<7":
return &mock.Package{
PName: "dotnet-runtime-6.0",
PBase: "dotnet-runtime-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
case "dotnet-sdk>=6", "dotnet-sdk<7":
return &mock.Package{
PName: "dotnet-sdk-6.0",
PBase: "dotnet-sdk-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
}
return nil
},
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
},
},
}
err = handleCmd(context.Background(), run, cmdArgs, db)
require.NoError(t, err)
require.Len(t, mockRunner.ShowCalls, len(wantShow))
require.Len(t, mockRunner.CaptureCalls, len(wantCapture))
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")
show = strings.ReplaceAll(show, gitBin, "git")
// options are in a different order on different systems and on CI root user is used
assert.Subset(t, strings.Split(show, " "), strings.Split(wantShow[i], " "), fmt.Sprintf("%d - %s", i, show))
}
}
func TestIntegrationLocalInstallMissingFiles(t *testing.T) {
makepkgBin := t.TempDir() + "/makepkg"
pacmanBin := t.TempDir() + "/pacman"
gitBin := t.TempDir() + "/git"
tmpDir := t.TempDir()
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoError(t, f.Close())
srcinfo, err := os.ReadFile("testdata/jfin/.SRCINFO")
require.NoError(t, err)
targetDir := t.TempDir()
tars := []string{
tmpDir + "/jellyfin-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-web-10.8.4-1-x86_64.pkg.tar.zst",
tmpDir + "/jellyfin-server-10.8.4-1-x86_64.pkg.tar.zst",
}
wantShow := []string{}
wantCapture := []string{}
captureOverride := func(cmd *exec.Cmd) (stdout string, stderr string, err error) {
if cmd.Args[1] == "--printsrcinfo" {
return string(srcinfo), "", nil
}
return strings.Join(tars, "\n"), "", nil
}
once := sync.Once{}
showOverride := func(cmd *exec.Cmd) error {
once.Do(func() {
for _, tar := range tars {
f, err := os.OpenFile(tar, os.O_RDONLY|os.O_CREATE, 0o666)
require.NoError(t, err)
require.NoError(t, f.Close())
}
})
return nil
}
mockRunner := &exe.MockRunner{CaptureFn: captureOverride, ShowFn: showOverride}
cmdBuilder := &exe.CmdBuilder{
MakepkgBin: makepkgBin,
SudoBin: "su",
PacmanBin: pacmanBin,
PacmanConfigPath: "/etc/pacman.conf",
GitBin: "git",
Runner: mockRunner,
SudoLoopEnabled: false,
}
cmdArgs := parser.MakeArguments()
cmdArgs.AddArg("B")
cmdArgs.AddArg("i")
cmdArgs.AddTarget(targetDir)
settings.NoConfirm = true
defer func() { settings.NoConfirm = false }()
db := &mock.DBExecutor{
AlpmArchitecturesFn: func() ([]string, error) {
return []string{"x86_64"}, nil
},
LocalSatisfierExistsFn: func(s string) bool {
switch s {
case "dotnet-sdk>=6", "dotnet-sdk<7", "dotnet-runtime>=6", "dotnet-runtime<7", "jellyfin-server=10.8.4", "jellyfin-web=10.8.4":
return false
}
return true
},
SyncSatisfierFn: func(s string) mock.IPackage {
switch s {
case "dotnet-runtime>=6", "dotnet-runtime<7":
return &mock.Package{
PName: "dotnet-runtime-6.0",
PBase: "dotnet-runtime-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
case "dotnet-sdk>=6", "dotnet-sdk<7":
return &mock.Package{
PName: "dotnet-sdk-6.0",
PBase: "dotnet-sdk-6.0",
PVersion: "6.0.100-1",
PDB: mock.NewDB("community"),
}
}
return nil
},
}
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
},
},
}
err = handleCmd(context.Background(), config, cmdArgs, db)
require.ErrorIs(t, err, ErrNoBuildFiles)
require.Len(t, mockRunner.ShowCalls, len(wantShow))
require.Len(t, mockRunner.CaptureCalls, len(wantCapture))
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")
show = strings.ReplaceAll(show, gitBin, "git")
// options are in a different order on different systems and on CI root user is used
assert.Subset(t, strings.Split(show, " "), strings.Split(wantShow[i], " "), fmt.Sprintf("%d - %s", i, show))
}
}
func TestIntegrationLocalInstallWithDepsProvides(t *testing.T) {
makepkgBin := t.TempDir() + "/makepkg"
pacmanBin := t.TempDir() + "/pacman"
gitBin := t.TempDir() + "/git"
tmpDir := t.TempDir()
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())
f, err = os.OpenFile(gitBin, os.O_RDONLY|os.O_CREATE, 0o755)
require.NoError(t, err)
require.NoErro
gitextract_b9cisaon/ ├── .dockerignore ├── .github/ │ ├── CODEOWNERS │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── dependabot.yml │ └── workflows/ │ ├── builder-image.yml │ ├── multiarch-build.yml │ ├── testing-git.yml │ └── testing.yml ├── .gitignore ├── .golangci.yml ├── .pre-commit-config.yaml ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── ci.Dockerfile ├── clean.go ├── clean_test.go ├── cmd.go ├── cmd_test.go ├── completions/ │ ├── bash │ ├── fish │ └── zsh ├── doc/ │ └── yay.8 ├── errors.go ├── get.go ├── go.mod ├── go.sum ├── local_install.go ├── local_install_test.go ├── main.go ├── pkg/ │ ├── cmd/ │ │ └── graph/ │ │ └── main.go │ ├── completion/ │ │ ├── completion.go │ │ └── completion_test.go │ ├── db/ │ │ ├── executor.go │ │ ├── ialpm/ │ │ │ ├── alpm.go │ │ │ ├── alpm_test.go │ │ │ └── high_level.go │ │ ├── mock/ │ │ │ ├── executor.go │ │ │ └── repo.go │ │ └── types.go │ ├── dep/ │ │ ├── dep.go │ │ ├── dep_graph.go │ │ ├── dep_graph_bench_test.go │ │ ├── dep_graph_rpc_test.go │ │ ├── dep_graph_test.go │ │ ├── mock/ │ │ │ └── aur.go │ │ ├── target_handler.go │ │ ├── testdata/ │ │ │ ├── android-sdk.json │ │ │ ├── aws-cli-git.json │ │ │ ├── clion.json │ │ │ ├── gstreamer-git.json │ │ │ ├── jellyfin-server.json │ │ │ ├── jellyfin-web.json │ │ │ ├── jellyfin.json │ │ │ ├── liri-desktop-git.json │ │ │ ├── mesa-git.json │ │ │ ├── nx.json │ │ │ ├── python-pydantic.json │ │ │ └── samsung-unified-driver.json │ │ └── topo/ │ │ ├── dep.go │ │ ├── dep_test.go │ │ └── errors.go │ ├── download/ │ │ ├── abs.go │ │ ├── abs_test.go │ │ ├── aur.go │ │ ├── aur_test.go │ │ ├── errors.go │ │ ├── unified.go │ │ ├── unified_integration_test.go │ │ ├── unified_test.go │ │ └── utils_test.go │ ├── intrange/ │ │ ├── intrange.go │ │ └── intrange_test.go │ ├── menus/ │ │ ├── clean_menu.go │ │ ├── diff_menu.go │ │ ├── edit_menu.go │ │ └── menu.go │ ├── multierror/ │ │ └── multierror.go │ ├── news/ │ │ ├── .snapshots/ │ │ │ ├── TestPrintNewsFeed-all-quiet │ │ │ ├── TestPrintNewsFeed-all-verbose │ │ │ ├── TestPrintNewsFeed-latest-quiet │ │ │ ├── TestPrintNewsFeed-latest-quiet-topdown │ │ │ └── TestPrintNewsFeedSameDay │ │ ├── news.go │ │ └── news_test.go │ ├── query/ │ │ ├── aur_warnings.go │ │ ├── errors.go │ │ ├── filter.go │ │ ├── metric.go │ │ ├── metric_test.go │ │ ├── query_builder.go │ │ ├── query_builder_test.go │ │ ├── source.go │ │ ├── types.go │ │ ├── version_diff.go │ │ └── version_diff_test.go │ ├── runtime/ │ │ ├── pacman.go │ │ ├── pacman_test.go │ │ ├── runtime.go │ │ └── runtime_test.go │ ├── settings/ │ │ ├── args.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── dirs.go │ │ ├── dirs_test.go │ │ ├── errors.go │ │ ├── exe/ │ │ │ ├── cmd_builder.go │ │ │ ├── exec.go │ │ │ └── mock.go │ │ ├── ini.go │ │ ├── ini_test.go │ │ ├── parser/ │ │ │ ├── parser.go │ │ │ ├── parser_test.go │ │ │ ├── rebuild_mode.go │ │ │ └── target_mode.go │ │ └── yay.conf │ ├── sync/ │ │ ├── build/ │ │ │ ├── errors.go │ │ │ ├── installer.go │ │ │ ├── installer_test.go │ │ │ ├── pkg_archive.go │ │ │ └── pkg_archive_test.go │ │ ├── srcinfo/ │ │ │ ├── pgp/ │ │ │ │ ├── keys.go │ │ │ │ ├── keys_test.go │ │ │ │ └── testdata/ │ │ │ │ ├── 11E521D646982372EB577A1F8F0871F202119294 │ │ │ │ ├── 487EACC08557AD082088DABA1EB2638FF56C0C53 │ │ │ │ ├── 647F28654894E3BD457199BE38DBBDC86092693E │ │ │ │ ├── A314827C4E4250A204CE6E13284FC34C8E4B1A25 │ │ │ │ ├── ABAF11C65A2970B130ABE3C479BE3E4300411886 │ │ │ │ ├── B6C8F98282B944E3B0D5C2530FC3042E345AD05D │ │ │ │ └── C52048C0C0748FEE227D47A2702353E0F7E48EDB │ │ │ ├── service.go │ │ │ └── service_test.go │ │ ├── sync.go │ │ └── workdir/ │ │ ├── aur_source.go │ │ ├── aur_source_test.go │ │ ├── clean.go │ │ ├── merge.go │ │ ├── preparer.go │ │ └── preparer_test.go │ ├── text/ │ │ ├── color.go │ │ ├── convert.go │ │ ├── errors.go │ │ ├── input.go │ │ ├── service.go │ │ ├── text.go │ │ ├── text_test.go │ │ └── time.go │ ├── upgrade/ │ │ ├── .snapshots/ │ │ │ ├── Test_upAUR-No_Updates │ │ │ ├── Test_upAUR-Simple_Update │ │ │ └── Test_upAUR-Time_Update │ │ ├── service.go │ │ ├── service_test.go │ │ ├── sources.go │ │ ├── sources_test.go │ │ ├── upgrade.go │ │ └── upgrade_test.go │ └── vcs/ │ ├── .snapshots/ │ │ └── TestInfoStore_Update-simple │ ├── mock.go │ ├── vcs.go │ └── vcs_test.go ├── po/ │ ├── ca.po │ ├── ca_ES.po │ ├── cs.po │ ├── de.po │ ├── en.po │ ├── es.po │ ├── eu.po │ ├── fi.po │ ├── fr.po │ ├── fr_FR.po │ ├── he.po │ ├── he_IL.po │ ├── hu.po │ ├── id.po │ ├── it_IT.po │ ├── ja.po │ ├── ko.po │ ├── nl.po │ ├── pl.po │ ├── pl_PL.po │ ├── pt.po │ ├── pt_BR.po │ ├── ru.po │ ├── ru_RU.po │ ├── sk.po │ ├── sv.po │ ├── tr.po │ ├── uk.po │ ├── vi.po │ ├── vi_VN.po │ ├── zh_CN.po │ └── zh_TW.po ├── print.go ├── print_test.go ├── query.go ├── query_test.go ├── sync.go ├── sync_test.go ├── testdata/ │ ├── cephbin/ │ │ ├── .SRCINFO │ │ └── PKGBUILD │ ├── gourou/ │ │ ├── .SRCINFO │ │ └── PKGBUILD │ ├── jfin/ │ │ ├── .SRCINFO │ │ └── PKGBUILD │ ├── libzip-git/ │ │ ├── .SRCINFO │ │ └── PKGBUILD │ └── pacman.conf ├── vcs.go └── vote.go
SYMBOL INDEX (890 symbols across 116 files)
FILE: clean.go
function cleanDependencies (line 20) | func cleanDependencies(ctx context.Context, cfg *settings.Configuration,
function cleanRemove (line 33) | func cleanRemove(ctx context.Context, cfg *settings.Configuration,
function syncClean (line 51) | func syncClean(ctx context.Context, run *runtime.Runtime, cmdArgs *parse...
function cleanAUR (line 103) | func cleanAUR(ctx context.Context, run *runtime.Runtime,
function cleanUntracked (line 178) | func cleanUntracked(ctx context.Context, run *runtime.Runtime) error {
function isGitRepository (line 204) | func isGitRepository(dir string) bool {
FILE: clean_test.go
function TestCleanHanging (line 27) | func TestCleanHanging(t *testing.T) {
function TestIntegrationCleanAUR (line 121) | func TestIntegrationCleanAUR(t *testing.T) {
FILE: cmd.go
function usage (line 28) | func usage(logger *text.Logger) {
function handleCmd (line 138) | func handleCmd(ctx context.Context, run *runtime.Runtime,
function getFilter (line 189) | func getFilter(cmdArgs *parser.Arguments) (upgrade.Filter, error) {
function handleQuery (line 210) | func handleQuery(ctx context.Context, run *runtime.Runtime, cmdArgs *par...
function handleHelp (line 234) | func handleHelp(ctx context.Context, run *runtime.Runtime, cmdArgs *pars...
function handleVersion (line 246) | func handleVersion(logger *text.Logger) {
function handlePrint (line 250) | func handlePrint(ctx context.Context, run *runtime.Runtime, cmdArgs *par...
function handleYay (line 277) | func handleYay(ctx context.Context, run *runtime.Runtime,
function handleWeb (line 295) | func handleWeb(ctx context.Context, run *runtime.Runtime, cmdArgs *parse...
function handleGetpkgbuild (line 308) | func handleGetpkgbuild(ctx context.Context, run *runtime.Runtime, cmdArg...
function handleUpgrade (line 318) | func handleUpgrade(ctx context.Context,
function handleBuild (line 326) | func handleBuild(ctx context.Context,
function handleSync (line 332) | func handleSync(ctx context.Context, run *runtime.Runtime, cmdArgs *pars...
function handleRemove (line 360) | func handleRemove(ctx context.Context, run *runtime.Runtime, cmdArgs *pa...
function displayNumberMenu (line 371) | func displayNumberMenu(ctx context.Context, run *runtime.Runtime, pkgS [...
function syncList (line 410) | func syncList(ctx context.Context, run *runtime.Runtime,
FILE: cmd_test.go
function TestYogurtMenuAURDB (line 30) | func TestYogurtMenuAURDB(t *testing.T) {
FILE: get.go
function printPkgbuilds (line 20) | func printPkgbuilds(dbExecutor download.DBSearcher, aurClient aur.QueryC...
function getPkgbuilds (line 51) | func getPkgbuilds(ctx context.Context, dbExecutor download.DBSearcher, a...
FILE: local_install.go
function srcinfoExists (line 28) | func srcinfoExists(ctx context.Context,
function installLocalPKGBUILD (line 60) | func installLocalPKGBUILD(
FILE: local_install_test.go
function newTestLogger (line 32) | func newTestLogger() *text.Logger {
function TestIntegrationLocalInstall (line 36) | func TestIntegrationLocalInstall(t *testing.T) {
function TestIntegrationLocalBuildOnly (line 182) | func TestIntegrationLocalBuildOnly(t *testing.T) {
function TestIntegrationLocalInstallMissingDep (line 322) | func TestIntegrationLocalInstallMissingDep(t *testing.T) {
function TestIntegrationLocalInstallNeeded (line 441) | func TestIntegrationLocalInstallNeeded(t *testing.T) {
function TestIntegrationLocalInstallGenerateSRCINFO (line 597) | func TestIntegrationLocalInstallGenerateSRCINFO(t *testing.T) {
function TestIntegrationLocalInstallMissingFiles (line 757) | func TestIntegrationLocalInstallMissingFiles(t *testing.T) {
function TestIntegrationLocalInstallWithDepsProvides (line 893) | func TestIntegrationLocalInstallWithDepsProvides(t *testing.T) {
function TestIntegrationLocalInstallTwoSrcInfosWithDeps (line 1019) | func TestIntegrationLocalInstallTwoSrcInfosWithDeps(t *testing.T) {
FILE: main.go
function initGotext (line 25) | func initGotext() {
function main (line 46) | func main() {
FILE: pkg/cmd/graph/main.go
function handleCmd (line 21) | func handleCmd(logger *text.Logger) error {
function main (line 56) | func main() {
function graphPackage (line 64) | func graphPackage(
FILE: pkg/completion/completion.go
function NeedsUpdate (line 18) | func NeedsUpdate(completionPath string, interval int, force bool) bool {
type PkgSynchronizer (line 40) | type PkgSynchronizer interface
function Show (line 45) | func Show(ctx context.Context, httpClient download.HTTPRequestDoer,
function UpdateCache (line 66) | func UpdateCache(ctx context.Context, httpClient download.HTTPRequestDoer,
function createAURList (line 88) | func createAURList(ctx context.Context, client download.HTTPRequestDoer,...
function createRepoList (line 112) | func createRepoList(dbExecutor PkgSynchronizer, out io.Writer) error {
FILE: pkg/completion/completion_test.go
constant samplePackageResp (line 25) | samplePackageResp = `
constant expectPackageCompletion (line 37) | expectPackageCompletion = `cytadela AUR
type mockDoer (line 47) | type mockDoer struct
method Get (line 55) | func (m *mockDoer) Get(url string) (*http.Response, error) {
function gzipString (line 63) | func gzipString(s string) []byte {
function Test_createAURList (line 71) | func Test_createAURList(t *testing.T) {
function Test_createAURListGzip (line 87) | func Test_createAURListGzip(t *testing.T) {
function Test_createAURListHTTPError (line 103) | func Test_createAURListHTTPError(t *testing.T) {
function Test_createAURListStatusError (line 118) | func Test_createAURListStatusError(t *testing.T) {
function TestNeedsUpdate (line 133) | func TestNeedsUpdate(t *testing.T) {
type mockPkgSynchronizer (line 244) | type mockPkgSynchronizer struct
method SyncPackages (line 248) | func (m *mockPkgSynchronizer) SyncPackages(...string) []db.IPackage {
function Test_createRepoList (line 252) | func Test_createRepoList(t *testing.T) {
type errorWriter (line 306) | type errorWriter struct
method Write (line 308) | func (e *errorWriter) Write(p []byte) (n int, err error) {
function Test_createRepoListWriteError (line 312) | func Test_createRepoListWriteError(t *testing.T) {
function TestUpdateCache (line 325) | func TestUpdateCache(t *testing.T) {
function TestShow (line 387) | func TestShow(t *testing.T) {
function TestShowFileOpenError (line 501) | func TestShowFileOpenError(t *testing.T) {
function TestUpdateCacheMkdirError (line 526) | func TestUpdateCacheMkdirError(t *testing.T) {
function Test_createAURListWriteError (line 551) | func Test_createAURListWriteError(t *testing.T) {
FILE: pkg/db/executor.go
function VerCmp (line 18) | func VerCmp(v1, v2 string) int {
type Upgrade (line 22) | type Upgrade struct
type SyncUpgrade (line 32) | type SyncUpgrade struct
type Executor (line 38) | type Executor interface
FILE: pkg/db/ialpm/alpm.go
type AlpmExecutor (line 19) | type AlpmExecutor struct
method logCallback (line 150) | func (ae *AlpmExecutor) logCallback() func(level alpm.LogLevel, str st...
method questionCallback (line 161) | func (ae *AlpmExecutor) questionCallback() func(question alpm.Question...
method RefreshHandle (line 242) | func (ae *AlpmExecutor) RefreshHandle() error {
method LocalSatisfierExists (line 275) | func (ae *AlpmExecutor) LocalSatisfierExists(pkgName string) bool {
method SyncSatisfierExists (line 283) | func (ae *AlpmExecutor) SyncSatisfierExists(pkgName string) bool {
method IsCorrectVersionInstalled (line 287) | func (ae *AlpmExecutor) IsCorrectVersionInstalled(pkgName, versionRequ...
method SyncSatisfier (line 296) | func (ae *AlpmExecutor) SyncSatisfier(pkgName string) alpm.Package {
method PackagesFromGroup (line 307) | func (ae *AlpmExecutor) PackagesFromGroup(groupName string) []alpm.Pac...
method PackagesFromGroupAndDB (line 315) | func (ae *AlpmExecutor) PackagesFromGroupAndDB(groupName, dbName strin...
method LocalPackages (line 323) | func (ae *AlpmExecutor) LocalPackages() []alpm.Package {
method SyncPackages (line 333) | func (ae *AlpmExecutor) SyncPackages(pkgNames ...string) []alpm.Package {
method LocalPackage (line 352) | func (ae *AlpmExecutor) LocalPackage(pkgName string) alpm.Package {
method syncDBs (line 361) | func (ae *AlpmExecutor) syncDBs() []alpm.Database {
method SyncPackage (line 369) | func (ae *AlpmExecutor) SyncPackage(pkgName string) alpm.Package {
method SyncPackageFromDB (line 379) | func (ae *AlpmExecutor) SyncPackageFromDB(pkgName, dbName string) alpm...
method SatisfierFromDB (line 388) | func (ae *AlpmExecutor) SatisfierFromDB(pkgName, dbName string) (alpm....
method PackageDepends (line 402) | func (ae *AlpmExecutor) PackageDepends(pkg alpm.Package) []alpm.Depend {
method PackageOptionalDepends (line 406) | func (ae *AlpmExecutor) PackageOptionalDepends(pkg alpm.Package) []alp...
method PackageProvides (line 410) | func (ae *AlpmExecutor) PackageProvides(pkg alpm.Package) []alpm.Depend {
method PackageGroups (line 414) | func (ae *AlpmExecutor) PackageGroups(pkg alpm.Package) []string {
method SyncUpgrades (line 420) | func (ae *AlpmExecutor) SyncUpgrades(enableDowngrade bool) (
method BiggestPackages (line 464) | func (ae *AlpmExecutor) BiggestPackages() []alpm.Package {
method LastBuildTime (line 468) | func (ae *AlpmExecutor) LastBuildTime() time.Time {
method Cleanup (line 484) | func (ae *AlpmExecutor) Cleanup() {
method Repos (line 492) | func (ae *AlpmExecutor) Repos() (repos []string) {
method AlpmArchitectures (line 504) | func (ae *AlpmExecutor) AlpmArchitectures() ([]string, error) {
function NewExecutor (line 32) | func NewExecutor(pacmanConf *pacmanconf.Config, logger *text.Logger) (*A...
function toUsage (line 63) | func toUsage(usages []string) alpm.Usage {
function configureAlpm (line 88) | func configureAlpm(pacmanConf *pacmanconf.Config, alpmHandle alpm.Handle...
function alpmSetArchitecture (line 500) | func alpmSetArchitecture(alpmHandle alpm.Handle, arch []string) error {
function alpmSetLogCallback (line 510) | func alpmSetLogCallback(alpmHandle alpm.Handle, cb func(alpm.LogLevel, s...
function alpmSetQuestionCallback (line 517) | func alpmSetQuestionCallback(alpmHandle alpm.Handle, cb func(alpm.Questi...
FILE: pkg/db/ialpm/alpm_test.go
function TestAlpmExecutor (line 18) | func TestAlpmExecutor(t *testing.T) {
function alpmTestGetArch (line 112) | func alpmTestGetArch(h alpm.Handle) ([]string, error) {
FILE: pkg/db/ialpm/high_level.go
method getPackageNamesBySource (line 10) | func (ae *AlpmExecutor) getPackageNamesBySource() {
method InstalledRemotePackages (line 28) | func (ae *AlpmExecutor) InstalledRemotePackages() map[string]alpm.Package {
method InstalledRemotePackageNames (line 36) | func (ae *AlpmExecutor) InstalledRemotePackageNames() []string {
method InstalledSyncPackageNames (line 44) | func (ae *AlpmExecutor) InstalledSyncPackageNames() []string {
method SetLogger (line 52) | func (ae *AlpmExecutor) SetLogger(logger *text.Logger) {
FILE: pkg/db/mock/executor.go
type DBExecutor (line 18) | type DBExecutor struct
method InstalledRemotePackageNames (line 42) | func (t *DBExecutor) InstalledRemotePackageNames() []string {
method InstalledRemotePackages (line 49) | func (t *DBExecutor) InstalledRemotePackages() map[string]IPackage {
method AlpmArchitectures (line 56) | func (t *DBExecutor) AlpmArchitectures() ([]string, error) {
method BiggestPackages (line 63) | func (t *DBExecutor) BiggestPackages() []IPackage {
method Cleanup (line 67) | func (t *DBExecutor) Cleanup() {
method IsCorrectVersionInstalled (line 71) | func (t *DBExecutor) IsCorrectVersionInstalled(s, s2 string) bool {
method LastBuildTime (line 78) | func (t *DBExecutor) LastBuildTime() time.Time {
method LocalPackage (line 82) | func (t *DBExecutor) LocalPackage(s string) IPackage {
method LocalPackages (line 90) | func (t *DBExecutor) LocalPackages() []IPackage {
method LocalSatisfierExists (line 98) | func (t *DBExecutor) LocalSatisfierExists(s string) bool {
method PackageConflicts (line 105) | func (t *DBExecutor) PackageConflicts(iPackage IPackage) []Depend {
method PackageDepends (line 109) | func (t *DBExecutor) PackageDepends(iPackage IPackage) []Depend {
method PackageGroups (line 117) | func (t *DBExecutor) PackageGroups(iPackage IPackage) []string {
method PackageOptionalDepends (line 121) | func (t *DBExecutor) PackageOptionalDepends(iPackage IPackage) []Depend {
method PackageProvides (line 129) | func (t *DBExecutor) PackageProvides(iPackage IPackage) []Depend {
method PackagesFromGroup (line 137) | func (t *DBExecutor) PackagesFromGroup(s string) []IPackage {
method PackagesFromGroupAndDB (line 145) | func (t *DBExecutor) PackagesFromGroupAndDB(s, s2 string) ([]IPackage,...
method RefreshHandle (line 152) | func (t *DBExecutor) RefreshHandle() error {
method SyncUpgrades (line 159) | func (t *DBExecutor) SyncUpgrades(b bool) (map[string]db.SyncUpgrade, ...
method Repos (line 166) | func (t *DBExecutor) Repos() []string {
method SatisfierFromDB (line 174) | func (t *DBExecutor) SatisfierFromDB(s, s2 string) (IPackage, error) {
method SyncPackage (line 181) | func (t *DBExecutor) SyncPackage(s string) IPackage {
method SyncPackages (line 188) | func (t *DBExecutor) SyncPackages(s ...string) []IPackage {
method SyncSatisfier (line 195) | func (t *DBExecutor) SyncSatisfier(s string) IPackage {
method SyncSatisfierExists (line 202) | func (t *DBExecutor) SyncSatisfierExists(s string) bool {
method SetLogger (line 209) | func (t *DBExecutor) SetLogger(logger *text.Logger) {
FILE: pkg/db/mock/repo.go
type DependList (line 11) | type DependList struct
type Package (line 15) | type Package struct
method Base (line 33) | func (p *Package) Base() string {
method BuildDate (line 37) | func (p *Package) BuildDate() time.Time {
method DB (line 41) | func (p *Package) DB() alpm.Database {
method Description (line 45) | func (p *Package) Description() string {
method ISize (line 49) | func (p *Package) ISize() int64 {
method Name (line 53) | func (p *Package) Name() string {
method ShouldIgnore (line 57) | func (p *Package) ShouldIgnore() bool {
method Size (line 61) | func (p *Package) Size() int64 {
method Version (line 65) | func (p *Package) Version() string {
method Reason (line 69) | func (p *Package) Reason() alpm.PkgReason {
method FileName (line 73) | func (p *Package) FileName() string {
method Base64Signature (line 77) | func (p *Package) Base64Signature() string {
method Validation (line 81) | func (p *Package) Validation() alpm.Validation {
method Architecture (line 86) | func (p *Package) Architecture() string {
method Backup (line 91) | func (p *Package) Backup() []alpm.Backup {
method Conflicts (line 96) | func (p *Package) Conflicts() []alpm.Depend {
method Depends (line 101) | func (p *Package) Depends() []alpm.Depend {
method OptionalDepends (line 106) | func (p *Package) OptionalDepends() []alpm.Depend {
method CheckDepends (line 111) | func (p *Package) CheckDepends() []alpm.Depend {
method MakeDepends (line 116) | func (p *Package) MakeDepends() []alpm.Depend {
method Files (line 121) | func (p *Package) Files() []alpm.File {
method ContainsFile (line 126) | func (p *Package) ContainsFile(path string) (alpm.File, error) {
method Groups (line 131) | func (p *Package) Groups() []string {
method InstallDate (line 136) | func (p *Package) InstallDate() time.Time {
method Licenses (line 141) | func (p *Package) Licenses() []string {
method SHA256Sum (line 146) | func (p *Package) SHA256Sum() string {
method Packager (line 151) | func (p *Package) Packager() string {
method Provides (line 156) | func (p *Package) Provides() []alpm.Depend {
method Origin (line 161) | func (p *Package) Origin() alpm.PkgFrom {
method Replaces (line 166) | func (p *Package) Replaces() []alpm.Depend {
method URL (line 171) | func (p *Package) URL() string {
method ComputeRequiredBy (line 176) | func (p *Package) ComputeRequiredBy() ([]string, error) {
method ComputeOptionalFor (line 182) | func (p *Package) ComputeOptionalFor() ([]string, error) {
method SyncNewVersion (line 188) | func (p *Package) SyncNewVersion(dbs []alpm.Database) alpm.Package {
method Type (line 192) | func (p *Package) Type() string {
method CheckMD5Sum (line 196) | func (p *Package) CheckMD5Sum() error {
method CheckPGPSignature (line 200) | func (p *Package) CheckPGPSignature() (alpm.SigList, error) {
method Contains (line 204) | func (p *Package) Contains(path string) bool {
method Free (line 208) | func (p *Package) Free() error {
method HasScriptlet (line 213) | func (p *Package) HasScriptlet() bool {
method DownloadSize (line 217) | func (p *Package) DownloadSize() int64 {
method NativeHandle (line 221) | func (p *Package) NativeHandle() alpm.Handle {
method Sig (line 225) | func (p *Package) Sig() string {
method PkgValidation (line 229) | func (p *Package) PkgValidation() alpm.PkgValidation {
method XData (line 233) | func (p *Package) XData() string {
method Changelog (line 237) | func (p *Package) Changelog() (io.ReadCloser, error) {
method SyncGetNewVersion (line 241) | func (p *Package) SyncGetNewVersion(dbsSync []alpm.Database) alpm.Pack...
type DB (line 245) | type DB struct
method Name (line 254) | func (d *DB) Name() string {
method Pkg (line 258) | func (d *DB) Pkg(name string) alpm.Package {
method PkgCache (line 262) | func (d *DB) PkgCache() alpm.PackageIterator {
method Search (line 266) | func (d *DB) Search(needles []string) alpm.PackageIterator {
method SetServers (line 270) | func (d *DB) SetServers(servers []string) error {
method SetUsage (line 274) | func (d *DB) SetUsage(usage int) error {
function NewDB (line 250) | func NewDB(name string) *DB {
FILE: pkg/db/types.go
function ArchIsSupported (line 5) | func ArchIsSupported(alpmArch []string, arch string) bool {
FILE: pkg/dep/dep.go
function splitDep (line 10) | func splitDep(dep string) (pkg, mod, ver string) {
function pkgSatisfies (line 32) | func pkgSatisfies(name, version, dep string) bool {
function provideSatisfies (line 42) | func provideSatisfies(provide, dep, pkgVersion string) bool {
function verSatisfies (line 58) | func verSatisfies(ver1, mod, ver2 string) bool {
function satisfiesAur (line 75) | func satisfiesAur(dep string, pkg *aur.Pkg) bool {
FILE: pkg/dep/dep_graph.go
type InstallInfo (line 22) | type InstallInfo struct
method String (line 36) | func (i *InstallInfo) String() string {
type Reason (line 41) | type Reason
method String (line 45) | func (r Reason) String() string {
type Source (line 42) | type Source
method String (line 49) | func (s Source) String() string {
constant Explicit (line 54) | Explicit Reason = iota
constant Dep (line 55) | Dep
constant MakeDep (line 56) | MakeDep
constant CheckDep (line 57) | CheckDep
constant AUR (line 68) | AUR Source = iota
constant Sync (line 69) | Sync
constant Local (line 70) | Local
constant SrcInfo (line 71) | SrcInfo
constant Missing (line 72) | Missing
type Grapher (line 97) | type Grapher struct
method GraphFromTargets (line 131) | func (g *Grapher) GraphFromTargets(ctx context.Context,
method pickSrcInfoPkgs (line 195) | func (g *Grapher) pickSrcInfoPkgs(pkgs []*aurc.Pkg) ([]*aurc.Pkg, erro...
method addAurPkgProvides (line 227) | func (g *Grapher) addAurPkgProvides(pkg *aurc.Pkg, graph *topo.Graph[s...
method GraphFromSrcInfos (line 239) | func (g *Grapher) GraphFromSrcInfos(ctx context.Context, graph *topo.G...
method AddDepsForPkgs (line 292) | func (g *Grapher) AddDepsForPkgs(ctx context.Context, pkgs []*aur.Pkg,...
method addDepNodes (line 298) | func (g *Grapher) addDepNodes(ctx context.Context, pkg *aur.Pkg, graph...
method GraphSyncPkg (line 312) | func (g *Grapher) GraphSyncPkg(ctx context.Context,
method GraphSyncGroup (line 355) | func (g *Grapher) GraphSyncGroup(ctx context.Context,
method GraphAURTarget (line 380) | func (g *Grapher) GraphAURTarget(ctx context.Context,
method GraphFromAUR (line 401) | func (g *Grapher) GraphFromAUR(ctx context.Context,
method findDepsFromAUR (line 485) | func (g *Grapher) findDepsFromAUR(ctx context.Context,
method ValidateAndSetNodeInfo (line 600) | func (g *Grapher) ValidateAndSetNodeInfo(graph *topo.Graph[string, *In...
method addNodes (line 616) | func (g *Grapher) addNodes(
method provideMenu (line 752) | func (g *Grapher) provideMenu(dep string, options []aur.Pkg) *aur.Pkg {
function NewGrapher (line 110) | func NewGrapher(dbExecutor db.Executor, aurCache aurc.QueryClient,
function NewGraph (line 127) | func NewGraph() *topo.Graph[string, *InstallInfo] {
function makeAURPKGFromSrcinfo (line 809) | func makeAURPKGFromSrcinfo(dbExecutor db.Executor, srcInfo *gosrc.Srcinf...
function archStringToString (line 859) | func archStringToString(alpmArches []string, archString []gosrc.ArchStri...
function aurDepModToAlpmDep (line 871) | func aurDepModToAlpmDep(mod string) alpm.DepMod {
FILE: pkg/dep/dep_graph_bench_test.go
type benchCase (line 23) | type benchCase struct
function newBenchMockDB (line 32) | func newBenchMockDB() *mock.DBExecutor {
function newBenchMockAUR (line 103) | func newBenchMockAUR(t testing.TB) *mockaur.MockAUR {
function newJellyfinMockDB (line 118) | func newJellyfinMockDB() *mock.DBExecutor {
function newJellyfinMockAUR (line 155) | func newJellyfinMockAUR(t testing.TB) *mockaur.MockAUR {
function newCephMockDB (line 173) | func newCephMockDB() *mock.DBExecutor {
function newCephMockAUR (line 198) | func newCephMockAUR() *mockaur.MockAUR {
function newAndroidSDKMockDB (line 246) | func newAndroidSDKMockDB() *mock.DBExecutor {
function newAndroidSDKMockAUR (line 285) | func newAndroidSDKMockAUR(t testing.TB) *mockaur.MockAUR {
function verifyLayers (line 295) | func verifyLayers(t testing.TB, expected, actual []map[string]*InstallIn...
function BenchmarkGraphFromTargets_GstreamerGit (line 320) | func BenchmarkGraphFromTargets_GstreamerGit(b *testing.B) {
function BenchmarkGraphFromTargets_Jellyfin (line 374) | func BenchmarkGraphFromTargets_Jellyfin(b *testing.B) {
function BenchmarkGraphFromTargets_CephProvides (line 428) | func BenchmarkGraphFromTargets_CephProvides(b *testing.B) {
function BenchmarkGraphFromTargets_AndroidSDK (line 479) | func BenchmarkGraphFromTargets_AndroidSDK(b *testing.B) {
function BenchmarkTopoSortedLayers (line 507) | func BenchmarkTopoSortedLayers(b *testing.B) {
function BenchmarkNewGraph (line 548) | func BenchmarkNewGraph(b *testing.B) {
function BenchmarkGraphDependOn (line 555) | func BenchmarkGraphDependOn(b *testing.B) {
FILE: pkg/dep/dep_graph_rpc_test.go
function TestGrapher_ReliableParser_AWSCliGit (line 31) | func TestGrapher_ReliableParser_AWSCliGit(t *testing.T) {
function TestGrapher_ReliableSolver_LiriDesktopGit (line 125) | func TestGrapher_ReliableSolver_LiriDesktopGit(t *testing.T) {
function TestGrapher_SplitPackages_Clion (line 227) | func TestGrapher_SplitPackages_Clion(t *testing.T) {
function TestGrapher_SplitPackages_SamsungUnifiedDriver (line 342) | func TestGrapher_SplitPackages_SamsungUnifiedDriver(t *testing.T) {
function TestGrapher_SplitPackages_NX (line 475) | func TestGrapher_SplitPackages_NX(t *testing.T) {
function TestGrapher_SplitPackages_ReversedOrder (line 639) | func TestGrapher_SplitPackages_ReversedOrder(t *testing.T) {
function TestGrapher_MultipleInstallInfo (line 698) | func TestGrapher_MultipleInstallInfo(t *testing.T) {
function TestGrapher_VersionedDependencies (line 757) | func TestGrapher_VersionedDependencies(t *testing.T) {
FILE: pkg/dep/dep_graph_test.go
function ptrString (line 28) | func ptrString(s string) *string {
function getFromFile (line 32) | func getFromFile(t testing.TB, filePath string) mockaur.GetFunc {
function TestGrapher_findDepsFromAUR_logsRequiredByForMissingDep (line 49) | func TestGrapher_findDepsFromAUR_logsRequiredByForMissingDep(t *testing....
function TestGrapher_GraphFromTargets_jellyfin (line 75) | func TestGrapher_GraphFromTargets_jellyfin(t *testing.T) {
function TestGrapher_GraphProvides_androidsdk (line 244) | func TestGrapher_GraphProvides_androidsdk(t *testing.T) {
function TestGrapher_GraphFromAUR_Deps_ceph_bin (line 358) | func TestGrapher_GraphFromAUR_Deps_ceph_bin(t *testing.T) {
function TestGrapher_GraphFromAUR_Deps_gourou (line 560) | func TestGrapher_GraphFromAUR_Deps_gourou(t *testing.T) {
function TestGrapher_GraphFromTargets_ReinstalledDeps (line 705) | func TestGrapher_GraphFromTargets_ReinstalledDeps(t *testing.T) {
function TestGrapher_GraphFromTargets_TargetNotFound (line 843) | func TestGrapher_GraphFromTargets_TargetNotFound(t *testing.T) {
function TestGrapher_GraphFromAUR_SplitPkgInternalDeps (line 911) | func TestGrapher_GraphFromAUR_SplitPkgInternalDeps(t *testing.T) {
function TestGrapher_GraphFromAUR_CheckDeps (line 1091) | func TestGrapher_GraphFromAUR_CheckDeps(t *testing.T) {
function TestGrapher_GraphFromAUR_VirtualProvides (line 1195) | func TestGrapher_GraphFromAUR_VirtualProvides(t *testing.T) {
FILE: pkg/dep/mock/aur.go
type GetFunc (line 9) | type GetFunc
type MockAUR (line 11) | type MockAUR struct
method Get (line 15) | func (m *MockAUR) Get(ctx context.Context, query *aur.Query) ([]aur.Pk...
FILE: pkg/dep/target_handler.go
type Target (line 5) | type Target struct
method DepString (line 24) | func (t Target) DepString() string {
method String (line 28) | func (t Target) String() string {
function ToTarget (line 12) | func ToTarget(pkg string) Target {
FILE: pkg/dep/topo/dep.go
type NodeSet (line 14) | type NodeSet
type ProvidesMap (line 18) | type ProvidesMap
type DepMap (line 23) | type DepMap
method Slice (line 27) | func (n NodeSet[T]) Slice() []T {
type NodeInfo (line 38) | type NodeInfo struct
type DependencyInfo (line 46) | type DependencyInfo struct
type CheckFn (line 52) | type CheckFn
type Graph (line 60) | type Graph struct
function New (line 76) | func New[T comparable, V any]() *Graph[T, V] {
method Len (line 87) | func (g *Graph[T, V]) Len() int {
method Exists (line 92) | func (g *Graph[T, V]) Exists(node T) bool {
method AddNode (line 99) | func (g *Graph[T, V]) AddNode(node T) {
method HasProvides (line 104) | func (g *Graph[T, V]) HasProvides(provides T) bool {
method GetProviderInfo (line 111) | func (g *Graph[T, V]) GetProviderInfo(provides T) *DependencyInfo[T] {
method AddProvides (line 119) | func (g *Graph[T, V]) AddProvides(provides T, depInfo *alpm.Depend, node...
method ForEach (line 130) | func (g *Graph[T, V]) ForEach(f CheckFn[T, V]) error {
method SetNodeInfo (line 145) | func (g *Graph[T, V]) SetNodeInfo(node T, nodeInfo *NodeInfo[V]) {
method GetNodeInfo (line 150) | func (g *Graph[T, V]) GetNodeInfo(node T) *NodeInfo[V] {
method DependOn (line 159) | func (g *Graph[T, V]) DependOn(child, parent T) error {
method String (line 182) | func (g *Graph[T, V]) String() string {
method DependsOn (line 214) | func (g *Graph[T, V]) DependsOn(child, parent T) bool {
method HasDependent (line 222) | func (g *Graph[T, V]) HasDependent(parent, dependent T) bool {
method leavesMap (line 230) | func (g *Graph[T, V]) leavesMap() map[T]V {
method TopoSortedLayers (line 258) | func (g *Graph[T, V]) TopoSortedLayers(checkFn CheckFn[T, V]) []map[T]V {
method remove (line 286) | func (dm DepMap[T]) remove(key, node T) bool {
method Prune (line 305) | func (g *Graph[T, V]) Prune(node T) []T {
method remove (line 332) | func (g *Graph[T, V]) remove(node T) {
method Dependencies (line 353) | func (g *Graph[T, V]) Dependencies(child T) NodeSet[T] {
method ImmediateDependencies (line 359) | func (g *Graph[T, V]) ImmediateDependencies(node T) NodeSet[T] {
method Dependents (line 365) | func (g *Graph[T, V]) Dependents(parent T) NodeSet[T] {
method ImmediateDependents (line 371) | func (g *Graph[T, V]) ImmediateDependents(node T) NodeSet[T] {
method clone (line 375) | func (g *Graph[T, V]) clone() *Graph[T, V] {
method buildTransitive (line 386) | func (g *Graph[T, V]) buildTransitive(root T, nextFn func(T) NodeSet[T])...
method copy (line 418) | func (s NodeSet[T]) copy() NodeSet[T] {
method copy (line 425) | func (dm DepMap[T]) copy() DepMap[T] {
method add (line 434) | func (dm DepMap[T]) add(key, node T) {
FILE: pkg/dep/topo/dep_test.go
function TestGraph_DependenciesAndDependents_Direct (line 9) | func TestGraph_DependenciesAndDependents_Direct(t *testing.T) {
function TestGraph_DependenciesAndDependents_Transitive (line 38) | func TestGraph_DependenciesAndDependents_Transitive(t *testing.T) {
function TestGraph_DependenciesAndDependents_MissingNodeReturnsNil (line 66) | func TestGraph_DependenciesAndDependents_MissingNodeReturnsNil(t *testin...
FILE: pkg/download/abs.go
constant MaxConcurrentFetch (line 17) | MaxConcurrentFetch = 20
constant absPackageURL (line 18) | absPackageURL = "https://gitlab.archlinux.org/archlinux/packaging/p...
type regexReplace (line 26) | type regexReplace struct
function getPackagePKGBUILDURL (line 43) | func getPackagePKGBUILDURL(pkgName string) string {
function getPackageRepoURL (line 49) | func getPackageRepoURL(pkgName string) string {
function convertPkgNameForURL (line 54) | func convertPkgNameForURL(pkgName string) string {
function ABSPKGBUILD (line 62) | func ABSPKGBUILD(httpClient HTTPRequestDoer, dbName, pkgName string) ([]...
function ABSPKGBUILDRepo (line 85) | func ABSPKGBUILDRepo(ctx context.Context, cmdBuilder exe.GitCmdBuilder,
FILE: pkg/download/abs_test.go
constant gitExtrasPKGBUILD (line 19) | gitExtrasPKGBUILD = `pkgname=git-extras
function Test_getPackageURL (line 40) | func Test_getPackageURL(t *testing.T) {
function TestGetABSPkgbuild (line 134) | func TestGetABSPkgbuild(t *testing.T) {
function Test_getPackageRepoURL (line 196) | func Test_getPackageRepoURL(t *testing.T) {
function TestABSPKGBUILDRepo (line 269) | func TestABSPKGBUILDRepo(t *testing.T) {
function TestABSPKGBUILDRepoExistsPerms (line 299) | func TestABSPKGBUILDRepoExistsPerms(t *testing.T) {
FILE: pkg/download/aur.go
function AURPKGBUILD (line 22) | func AURPKGBUILD(httpClient HTTPRequestDoer, pkgName, aurURL string) ([]...
function AURPKGBUILDRepo (line 47) | func AURPKGBUILDRepo(ctx context.Context, cmdBuilder exe.GitCmdBuilder, ...
function AURPKGBUILDRepos (line 53) | func AURPKGBUILDRepos(
type ScannerCloser (line 107) | type ScannerCloser struct
method Close (line 113) | func (s *ScannerCloser) Close() error {
function GetPackageScanner (line 122) | func GetPackageScanner(ctx context.Context, client HTTPRequestDoer, aurU...
FILE: pkg/download/aur_test.go
function TestGetAURPkgbuild (line 19) | func TestGetAURPkgbuild(t *testing.T) {
function TestAURPKGBUILDRepo (line 81) | func TestAURPKGBUILDRepo(t *testing.T) {
function TestAURPKGBUILDRepoExistsPerms (line 111) | func TestAURPKGBUILDRepoExistsPerms(t *testing.T) {
function TestAURPKGBUILDRepos (line 142) | func TestAURPKGBUILDRepos(t *testing.T) {
FILE: pkg/download/errors.go
type ErrAURPackageNotFound (line 10) | type ErrAURPackageNotFound struct
method Error (line 14) | func (e ErrAURPackageNotFound) Error() string {
type ErrGetPKGBUILDRepo (line 18) | type ErrGetPKGBUILDRepo struct
method Error (line 24) | func (e ErrGetPKGBUILDRepo) Error() string {
method Unwrap (line 29) | func (e *ErrGetPKGBUILDRepo) Unwrap() error {
FILE: pkg/download/unified.go
type HTTPRequestDoer (line 22) | type HTTPRequestDoer interface
type DBSearcher (line 26) | type DBSearcher interface
function downloadGitRepo (line 31) | func downloadGitRepo(ctx context.Context, cmdBuilder exe.GitCmdBuilder,
function getURLName (line 76) | func getURLName(pkg db.IPackage) string {
function PKGBUILDs (line 85) | func PKGBUILDs(dbExecutor DBSearcher, aurClient aur.QueryClient, httpCli...
function PKGBUILDRepos (line 139) | func PKGBUILDRepos(ctx context.Context, dbExecutor DBSearcher, aurClient...
function getPackageUsableName (line 208) | func getPackageUsableName(dbExecutor DBSearcher, aurClient aur.QueryClient,
FILE: pkg/download/unified_integration_test.go
function TestIntegrationPKGBUILDReposDefinedDBClone (line 23) | func TestIntegrationPKGBUILDReposDefinedDBClone(t *testing.T) {
function TestIntegrationPKGBUILDReposNotExist (line 52) | func TestIntegrationPKGBUILDReposNotExist(t *testing.T) {
function TestIntegrationPKGBUILDFull (line 84) | func TestIntegrationPKGBUILDFull(t *testing.T) {
FILE: pkg/download/unified_test.go
function newTestLogger (line 26) | func newTestLogger() *text.Logger {
function TestPKGBUILDReposDefinedDBPull (line 34) | func TestPKGBUILDReposDefinedDBPull(t *testing.T) {
function TestPKGBUILDReposDefinedDBClone (line 74) | func TestPKGBUILDReposDefinedDBClone(t *testing.T) {
function TestPKGBUILDReposClone (line 108) | func TestPKGBUILDReposClone(t *testing.T) {
function TestPKGBUILDReposNotFound (line 142) | func TestPKGBUILDReposNotFound(t *testing.T) {
function TestPKGBUILDReposRepoMode (line 176) | func TestPKGBUILDReposRepoMode(t *testing.T) {
function TestPKGBUILDFull (line 210) | func TestPKGBUILDFull(t *testing.T) {
function TestPKGBUILDReposMissingAUR (line 252) | func TestPKGBUILDReposMissingAUR(t *testing.T) {
FILE: pkg/download/utils_test.go
type testRunner (line 20) | type testRunner struct
method Capture (line 22) | func (t *testRunner) Capture(cmd *exec.Cmd) (stdout string, stderr str...
method Show (line 26) | func (t *testRunner) Show(cmd *exec.Cmd) error {
type testGitBuilder (line 30) | type testGitBuilder struct
method BuildGitCmd (line 37) | func (t *testGitBuilder) BuildGitCmd(ctx context.Context, dir string, ...
method Show (line 47) | func (c *testGitBuilder) Show(cmd *exec.Cmd) error {
method Capture (line 51) | func (c *testGitBuilder) Capture(cmd *exec.Cmd) (stdout, stderr string...
type testDB (line 56) | type testDB struct
method Name (line 76) | func (d *testDB) Name() string {
type testPackage (line 60) | type testPackage struct
method DB (line 80) | func (p *testPackage) DB() alpm.Database {
type testDBSearcher (line 64) | type testDBSearcher struct
method SyncPackage (line 84) | func (d *testDBSearcher) SyncPackage(name string) db.IPackage {
method SyncPackageFromDB (line 98) | func (d *testDBSearcher) SyncPackageFromDB(name string, db string) db....
type testClient (line 68) | type testClient struct
method Get (line 112) | func (t *testClient) Get(url string) (*http.Response, error) {
FILE: pkg/intrange/intrange.go
type IntRange (line 12) | type IntRange struct
method Get (line 29) | func (r IntRange) Get(n int) bool {
type IntRanges (line 18) | type IntRanges
method Get (line 35) | func (rs IntRanges) Get(n int) bool {
function makeIntRange (line 20) | func makeIntRange(minVal, maxVal int) IntRange {
function ParseNumberMenu (line 55) | func ParseNumberMenu(input string) (include, exclude IntRanges,
FILE: pkg/intrange/intrange_test.go
function TestParseNumberMenu (line 13) | func TestParseNumberMenu(t *testing.T) {
function TestIntRange_Get (line 103) | func TestIntRange_Get(t *testing.T) {
function intRangesEqual (line 139) | func intRangesEqual(a, b IntRanges) bool {
function TestIntRanges_Get (line 164) | func TestIntRanges_Get(t *testing.T) {
FILE: pkg/menus/clean_menu.go
function anyExistInCache (line 17) | func anyExistInCache(pkgbuildDirs map[string]string) bool {
function CleanFn (line 27) | func CleanFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
FILE: pkg/menus/diff_menu.go
constant gitEmptyTree (line 21) | gitEmptyTree = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
constant gitDiffRefName (line 22) | gitDiffRefName = "AUR_SEEN"
function showPkgbuildDiffs (line 25) | func showPkgbuildDiffs(ctx context.Context, cmdBuilder exe.ICmdBuilder, ...
function gitHasDiff (line 74) | func gitHasDiff(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir str...
function gitHasLastSeenRef (line 95) | func gitHasLastSeenRef(ctx context.Context, cmdBuilder exe.ICmdBuilder, ...
function getLastSeenHash (line 105) | func getLastSeenHash(ctx context.Context, cmdBuilder exe.ICmdBuilder, di...
function gitUpdateSeenRef (line 124) | func gitUpdateSeenRef(ctx context.Context, cmdBuilder exe.ICmdBuilder, d...
function updatePkgbuildSeenRef (line 135) | func updatePkgbuildSeenRef(ctx context.Context, cmdBuilder exe.ICmdBuild...
function DiffFn (line 148) | func DiffFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
FILE: pkg/menus/edit_menu.go
function editor (line 23) | func editor(log *text.Logger, editorConfig, editorFlags string, noConfir...
function editPkgbuilds (line 85) | func editPkgbuilds(log *text.Logger, pkgbuildDirs map[string]string, bas...
function EditFn (line 117) | func EditFn(ctx context.Context, run *runtime.Runtime, w io.Writer,
FILE: pkg/menus/menu.go
function pkgbuildNumberMenu (line 16) | func pkgbuildNumberMenu(logger *text.Logger, pkgbuildDirs map[string]str...
function selectionMenu (line 41) | func selectionMenu(logger *text.Logger, pkgbuildDirs map[string]string, ...
FILE: pkg/multierror/multierror.go
type MultiError (line 6) | type MultiError struct
method Error (line 12) | func (err *MultiError) Error() string {
method Add (line 23) | func (err *MultiError) Add(e error) {
method Return (line 35) | func (err *MultiError) Return() error {
FILE: pkg/news/news.go
type item (line 16) | type item struct
method printNews (line 24) | func (item *item) printNews(logger *text.Logger, buildTime time.Time, ...
type channel (line 48) | type channel struct
type rss (line 57) | type rss struct
function PrintNewsFeed (line 61) | func PrintNewsFeed(ctx context.Context, client *http.Client, logger *tex...
function parseNews (line 104) | func parseNews(str string) string {
FILE: pkg/news/news_test.go
constant lastNews (line 22) | lastNews = `
constant sampleNews (line 43) | sampleNews = `<?xml version="1.0" encoding="utf-8"?>
function TestPrintNewsFeed (line 109) | func TestPrintNewsFeed(t *testing.T) {
function TestPrintNewsFeedSameDay (line 157) | func TestPrintNewsFeedSameDay(t *testing.T) {
FILE: pkg/query/aur_warnings.go
type AURWarnings (line 15) | type AURWarnings struct
method AddToWarnings (line 28) | func (warnings *AURWarnings) AddToWarnings(remote map[string]alpm.Pack...
method CalculateMissing (line 55) | func (warnings *AURWarnings) CalculateMissing(remoteNames []string,
method Print (line 67) | func (warnings *AURWarnings) Print() {
function NewWarnings (line 24) | func NewWarnings(logger *text.Logger) *AURWarnings {
function filterDebugPkgs (line 93) | func filterDebugPkgs(names []string) (normal, debug []string) {
function formatNames (line 108) | func formatNames(names []string) string {
FILE: pkg/query/errors.go
type ErrAURSearch (line 8) | type ErrAURSearch struct
method Error (line 12) | func (e ErrAURSearch) Error() string {
type ErrNoQuery (line 17) | type ErrNoQuery struct
method Error (line 19) | func (e ErrNoQuery) Error() string {
type ErrTargetNotFound (line 23) | type ErrTargetNotFound struct
method Error (line 25) | func (e ErrTargetNotFound) Error() string {
FILE: pkg/query/filter.go
function RemoveInvalidTargets (line 10) | func RemoveInvalidTargets(logger *text.Logger, targets []string, mode pa...
FILE: pkg/query/metric.go
constant minVotes (line 9) | minVotes = 30
constant minPopularity (line 10) | minPopularity = 0.5
constant separateSourceMax (line 12) | separateSourceMax = 45.0
constant separateSourceMin (line 13) | separateSourceMin = 5.0
method aurSortByMetric (line 16) | func (a *abstractResults) aurSortByMetric(pkg *abstractResult) float64 {
method GetMetric (line 27) | func (a *abstractResults) GetMetric(pkg *abstractResult) float64 {
method separateSourceScore (line 62) | func (a *abstractResults) separateSourceScore(source string, score float...
method calculateMetric (line 102) | func (a *abstractResults) calculateMetric(pkg *abstractResult) float64 {
FILE: pkg/query/metric_test.go
function TestSeparateSourceScore_UsesRepoOrderEvenlyDistributed (line 12) | func TestSeparateSourceScore_UsesRepoOrderEvenlyDistributed(t *testing.T) {
FILE: pkg/query/query_builder.go
type SearchVerbosity (line 24) | type SearchVerbosity
constant NumberMenu (line 28) | NumberMenu SearchVerbosity = iota
constant Detailed (line 29) | Detailed
constant Minimal (line 30) | Minimal
type Builder (line 33) | type Builder interface
type SortFunc (line 40) | type SortFunc
type SourceQueryBuilder (line 42) | type SourceQueryBuilder struct
method Execute (line 179) | func (s *SourceQueryBuilder) Execute(ctx context.Context, dbExecutor d...
method Results (line 276) | func (s *SourceQueryBuilder) Results(dbExecutor db.Executor, verboseSe...
method Len (line 308) | func (s *SourceQueryBuilder) Len() int {
method GetTargets (line 312) | func (s *SourceQueryBuilder) GetTargets(include, exclude intrange.IntR...
function NewSourceQueryBuilder (line 56) | func NewSourceQueryBuilder(
type abstractResult (line 80) | type abstractResult struct
type abstractResults (line 92) | type abstractResults struct
method Len (line 104) | func (a *abstractResults) Len() int { return len(a.results) }
method Swap (line 105) | func (a *abstractResults) Swap(i, j int) { a.results[i], a.results[j] ...
method Less (line 107) | func (a *abstractResults) Less(i, j int) bool {
method GetSortFunc (line 114) | func (a *abstractResults) GetSortFunc(sortBy string, bottomUp bool) So...
function matchesSearch (line 335) | func matchesSearch(pkg *aur.Pkg, terms []string) bool {
FILE: pkg/query/query_builder_test.go
function TestSourceQueryBuilder (line 22) | func TestSourceQueryBuilder(t *testing.T) {
function TestSourceQueryBuilderTieSortsByRepoOrder (line 316) | func TestSourceQueryBuilderTieSortsByRepoOrder(t *testing.T) {
function TestSourceQueryBuilderTieDoesNotSeparateSources (line 439) | func TestSourceQueryBuilderTieDoesNotSeparateSources(t *testing.T) {
function TestSourceQueryBuilderSortByFields (line 483) | func TestSourceQueryBuilderSortByFields(t *testing.T) {
function newYayQueryBuilderMocks (line 602) | func newYayQueryBuilderMocks() (*mock.DBExecutor, *mockaur.MockAUR) {
FILE: pkg/query/source.go
function queryAUR (line 11) | func queryAUR(ctx context.Context,
FILE: pkg/query/types.go
function getSearchBy (line 17) | func getSearchBy(value string) aur.By {
function aurPkgSearchString (line 50) | func aurPkgSearchString(
function syncPkgSearchString (line 89) | func syncPkgSearchString(pkg alpm.Package, dbExecutor db.Executor, singl...
FILE: pkg/query/version_diff.go
function GetVersionDiff (line 12) | func GetVersionDiff(oldVersion, newVersion string) (left, right string) {
function isDevelName (line 67) | func isDevelName(name string) bool {
function isDevelPackage (line 77) | func isDevelPackage(pkg alpm.Package) bool {
FILE: pkg/query/version_diff_test.go
function TestVersionDiff (line 12) | func TestVersionDiff(t *testing.T) {
FILE: pkg/runtime/pacman.go
function retrievePacmanConfig (line 13) | func retrievePacmanConfig(cmdArgs *parser.Arguments, pacmanConfigPath st...
FILE: pkg/runtime/pacman_test.go
function normalizePath (line 20) | func normalizePath(p string) string {
function normalizePaths (line 28) | func normalizePaths(paths []string) []string {
function normalizePacmanConf (line 38) | func normalizePacmanConf(conf *pacmanconf.Config) {
function TestPacmanConf (line 46) | func TestPacmanConf(t *testing.T) {
FILE: pkg/runtime/runtime.go
type Runtime (line 29) | type Runtime struct
function NewRuntime (line 41) | func NewRuntime(cfg *settings.Configuration, cmdArgs *parser.Arguments, ...
FILE: pkg/runtime/runtime_test.go
function TestBuildRuntime (line 18) | func TestBuildRuntime(t *testing.T) {
FILE: pkg/settings/args.go
method ParseCommandLine (line 10) | func (c *Configuration) ParseCommandLine(a *parser.Arguments) error {
method extractYayOptions (line 20) | func (c *Configuration) extractYayOptions(a *parser.Arguments) {
method handleOption (line 44) | func (c *Configuration) handleOption(option, value string) bool {
FILE: pkg/settings/config.go
type Configuration (line 30) | type Configuration struct
method Save (line 86) | func (c *Configuration) Save(configPath, version string) error {
method expandEnv (line 96) | func (c *Configuration) expandEnv() {
method String (line 133) | func (c *Configuration) String() string {
method setPrivilegeElevator (line 146) | func (c *Configuration) setPrivilegeElevator() error {
method load (line 254) | func (c *Configuration) load(configPath string) {
function expandEnvOrHome (line 124) | func expandEnvOrHome(path string) string {
function DefaultConfig (line 175) | func DefaultConfig(version string) *Configuration {
function NewConfig (line 206) | func NewConfig(logger *text.Logger, configPath, version string) (*Config...
FILE: pkg/settings/config_test.go
function TestNewConfig (line 19) | func TestNewConfig(t *testing.T) {
function TestNewConfigAURDEST (line 51) | func TestNewConfigAURDEST(t *testing.T) {
function TestNewConfigAURDESTTildeExpansion (line 82) | func TestNewConfigAURDESTTildeExpansion(t *testing.T) {
function TestConfiguration_setPrivilegeElevator (line 117) | func TestConfiguration_setPrivilegeElevator(t *testing.T) {
function TestConfiguration_setPrivilegeElevator_su (line 142) | func TestConfiguration_setPrivilegeElevator_su(t *testing.T) {
function TestConfiguration_setPrivilegeElevator_no_path (line 167) | func TestConfiguration_setPrivilegeElevator_no_path(t *testing.T) {
function TestConfiguration_setPrivilegeElevator_doas (line 185) | func TestConfiguration_setPrivilegeElevator_doas(t *testing.T) {
function TestConfiguration_setPrivilegeElevator_run0 (line 209) | func TestConfiguration_setPrivilegeElevator_run0(t *testing.T) {
function TestConfiguration_setPrivilegeElevator_custom_script (line 233) | func TestConfiguration_setPrivilegeElevator_custom_script(t *testing.T) {
function TestConfiguration_setPrivilegeElevator_pacman_auth_doas (line 259) | func TestConfiguration_setPrivilegeElevator_pacman_auth_doas(t *testing....
function TestConfiguration_setPrivilegeElevator_pacman_auth_sudo (line 290) | func TestConfiguration_setPrivilegeElevator_pacman_auth_sudo(t *testing....
FILE: pkg/settings/dirs.go
constant configFileName (line 9) | configFileName string = "config.json"
constant iniConfigFileName (line 10) | iniConfigFileName string = "yay.conf"
constant vcsFileName (line 11) | vcsFileName string = "vcs.json"
constant completionFileName (line 12) | completionFileName string = "completion.cache"
constant systemdCache (line 13) | systemdCache string = "/var/cache/yay"
function GetConfigPath (line 16) | func GetConfigPath() string {
function GetINIConfigPath (line 36) | func GetINIConfigPath() string {
function getCacheHome (line 54) | func getCacheHome() (string, error) {
function initDir (line 80) | func initDir(dir string) error {
FILE: pkg/settings/dirs_test.go
function Test_getCacheHome (line 18) | func Test_getCacheHome(t *testing.T) {
FILE: pkg/settings/errors.go
type ErrPrivilegeElevatorNotFound (line 9) | type ErrPrivilegeElevatorNotFound struct
method Error (line 13) | func (e *ErrPrivilegeElevatorNotFound) Error() string {
type ErrRuntimeDir (line 17) | type ErrRuntimeDir struct
method Error (line 22) | func (e *ErrRuntimeDir) Error() string {
type ErrUserAbort (line 26) | type ErrUserAbort struct
method Error (line 28) | func (e ErrUserAbort) Error() string {
FILE: pkg/settings/exe/cmd_builder.go
constant SudoLoopDuration (line 23) | SudoLoopDuration = 241
type GitCmdBuilder (line 30) | type GitCmdBuilder interface
type ICmdBuilder (line 35) | type ICmdBuilder interface
type CmdBuilder (line 46) | type CmdBuilder struct
method BuildGPGCmd (line 86) | func (c *CmdBuilder) BuildGPGCmd(ctx context.Context, extraArgs ...str...
method BuildGitCmd (line 116) | func (c *CmdBuilder) BuildGitCmd(ctx context.Context, dir string, extr...
method AddMakepkgFlag (line 137) | func (c *CmdBuilder) AddMakepkgFlag(flag string) {
method BuildMakepkgCmd (line 141) | func (c *CmdBuilder) BuildMakepkgCmd(ctx context.Context, dir string, ...
method deElevateCommand (line 162) | func (c *CmdBuilder) deElevateCommand(ctx context.Context, cmd *exec.C...
method buildPrivilegeElevatorCommand (line 213) | func (c *CmdBuilder) buildPrivilegeElevatorCommand(ctx context.Context...
method BuildPacmanCmd (line 225) | func (c *CmdBuilder) BuildPacmanCmd(ctx context.Context, args *parser....
method waitLock (line 252) | func (c *CmdBuilder) waitLock(dbPath string) {
method SudoLoop (line 272) | func (c *CmdBuilder) SudoLoop() {
method sudoLoopBackground (line 278) | func (c *CmdBuilder) sudoLoopBackground() {
method updateSudo (line 285) | func (c *CmdBuilder) updateSudo() {
method Show (line 296) | func (c *CmdBuilder) Show(cmd *exec.Cmd) error {
method Capture (line 300) | func (c *CmdBuilder) Capture(cmd *exec.Cmd) (stdout, stderr string, er...
method GetKeepSrc (line 304) | func (c *CmdBuilder) GetKeepSrc() bool {
function NewCmdBuilder (line 65) | func NewCmdBuilder(cfg *settings.Configuration, runner Runner, logger *t...
function gitFilteredEnv (line 101) | func gitFilteredEnv() []string {
FILE: pkg/settings/exe/exec.go
type Runner (line 13) | type Runner interface
type OSRunner (line 18) | type OSRunner struct
method Show (line 26) | func (r *OSRunner) Show(cmd *exec.Cmd) error {
method Capture (line 35) | func (r *OSRunner) Capture(cmd *exec.Cmd) (stdout, stderr string, err ...
function NewOSRunner (line 22) | func NewOSRunner(log *text.Logger) *OSRunner {
FILE: pkg/settings/exe/mock.go
type Call (line 12) | type Call struct
method String (line 18) | func (c *Call) String() string {
type MockBuilder (line 22) | type MockBuilder struct
method BuildGPGCmd (line 40) | func (m *MockBuilder) BuildGPGCmd(ctx context.Context, extraArgs ...st...
method BuildMakepkgCmd (line 44) | func (m *MockBuilder) BuildMakepkgCmd(ctx context.Context, dir string,...
method AddMakepkgFlag (line 66) | func (m *MockBuilder) AddMakepkgFlag(flag string) {
method BuildGitCmd (line 69) | func (m *MockBuilder) BuildGitCmd(ctx context.Context, dir string, ext...
method BuildPacmanCmd (line 73) | func (m *MockBuilder) BuildPacmanCmd(ctx context.Context, args *parser...
method SetPacmanDBPath (line 85) | func (m *MockBuilder) SetPacmanDBPath(path string) {
method SudoLoop (line 88) | func (m *MockBuilder) SudoLoop() {
method Capture (line 91) | func (m *MockBuilder) Capture(cmd *exec.Cmd) (stdout, stderr string, e...
method Show (line 95) | func (m *MockBuilder) Show(cmd *exec.Cmd) error {
method GetKeepSrc (line 99) | func (m *MockBuilder) GetKeepSrc() bool {
type MockRunner (line 31) | type MockRunner struct
method Capture (line 103) | func (m *MockRunner) Capture(cmd *exec.Cmd) (stdout, stderr string, er...
method Show (line 120) | func (m *MockRunner) Show(cmd *exec.Cmd) error {
FILE: pkg/settings/ini.go
constant SystemConfigPath (line 12) | SystemConfigPath = "/etc/yay.conf"
method loadINI (line 17) | func (c *Configuration) loadINI(path string) error {
method SaveINI (line 48) | func (c *Configuration) SaveINI(path string) error {
FILE: pkg/settings/ini_test.go
function TestConfigurationLoadINI (line 12) | func TestConfigurationLoadINI(t *testing.T) {
function TestSystemConfigPath (line 239) | func TestSystemConfigPath(t *testing.T) {
function TestConfigurationSaveINI (line 244) | func TestConfigurationSaveINI(t *testing.T) {
FILE: pkg/settings/parser/parser.go
type Option (line 14) | type Option struct
method Add (line 19) | func (o *Option) Add(args ...string) {
method First (line 28) | func (o *Option) First() string {
method Set (line 36) | func (o *Option) Set(arg string) {
method String (line 40) | func (o *Option) String() string {
type Arguments (line 46) | type Arguments struct
method String (line 52) | func (a *Arguments) String() string {
method CreateOrAppendOption (line 56) | func (a *Arguments) CreateOrAppendOption(option string, values ...stri...
method CopyGlobal (line 74) | func (a *Arguments) CopyGlobal() *Arguments {
method Copy (line 86) | func (a *Arguments) Copy() (cp *Arguments) {
method DelArg (line 99) | func (a *Arguments) DelArg(options ...string) {
method NeedRoot (line 105) | func (a *Arguments) NeedRoot(mode TargetMode) bool {
method addOP (line 161) | func (a *Arguments) addOP(op string) error {
method addParam (line 171) | func (a *Arguments) addParam(option, arg string) error {
method AddArg (line 189) | func (a *Arguments) AddArg(options ...string) error {
method ExistsArg (line 201) | func (a *Arguments) ExistsArg(options ...string) bool {
method GetArg (line 211) | func (a *Arguments) GetArg(options ...string) (arg string, double, exi...
method GetArgs (line 222) | func (a *Arguments) GetArgs(option string) (args []string) {
method AddTarget (line 231) | func (a *Arguments) AddTarget(targets ...string) {
method ClearTargets (line 235) | func (a *Arguments) ClearTargets() {
method ExistsDouble (line 240) | func (a *Arguments) ExistsDouble(options ...string) bool {
method FormatArgs (line 250) | func (a *Arguments) FormatArgs() (args []string) {
method FormatGlobals (line 272) | func (a *Arguments) FormatGlobals() (args []string) {
method parseShortOption (line 544) | func (a *Arguments) parseShortOption(arg, param string) (usedNext bool...
method parseLongOption (line 577) | func (a *Arguments) parseLongOption(arg, param string) (usedNext bool,...
method parseStdin (line 598) | func (a *Arguments) parseStdin() error {
method Parse (line 619) | func (a *Arguments) Parse() error {
function MakeArguments (line 66) | func MakeArguments() *Arguments {
function formatArg (line 291) | func formatArg(arg string) string {
function isArg (line 301) | func isArg(arg string) bool {
function isOp (line 448) | func isOp(op string) bool {
function isGlobal (line 471) | func isGlobal(op string) bool {
function hasParam (line 493) | func hasParam(arg string) bool {
FILE: pkg/settings/parser/parser_test.go
function TestOption_Add (line 14) | func TestOption_Add(t *testing.T) {
function TestOption_Set (line 51) | func TestOption_Set(t *testing.T) {
function TestOption_First (line 88) | func TestOption_First(t *testing.T) {
function TestMakeArguments (line 116) | func TestMakeArguments(t *testing.T) {
function TestArguments_CopyGlobal (line 125) | func TestArguments_CopyGlobal(t *testing.T) {
function TestArguments_Copy (line 174) | func TestArguments_Copy(t *testing.T) {
function TestArguments_DelArg (line 220) | func TestArguments_DelArg(t *testing.T) {
function TestArguments_FormatArgs (line 229) | func TestArguments_FormatArgs(t *testing.T) {
function TestArguments_FormatGlobalArgs (line 276) | func TestArguments_FormatGlobalArgs(t *testing.T) {
function Test_isArg (line 323) | func Test_isArg(t *testing.T) {
function TestArguments_ParseStdin (line 332) | func TestArguments_ParseStdin(t *testing.T) {
function TestArguments_ParseStdin_broken_pipe (line 354) | func TestArguments_ParseStdin_broken_pipe(t *testing.T) {
FILE: pkg/settings/parser/rebuild_mode.go
type RebuildMode (line 3) | type RebuildMode
constant RebuildModeNo (line 6) | RebuildModeNo RebuildMode = "no"
constant RebuildModeYes (line 7) | RebuildModeYes RebuildMode = "yes"
constant RebuildModeTree (line 8) | RebuildModeTree RebuildMode = "tree"
constant RebuildModeAll (line 9) | RebuildModeAll RebuildMode = "all"
FILE: pkg/settings/parser/target_mode.go
type TargetMode (line 3) | type TargetMode
method AtLeastAUR (line 11) | func (mode TargetMode) AtLeastAUR() bool {
method AtLeastRepo (line 15) | func (mode TargetMode) AtLeastRepo() bool {
constant ModeAny (line 6) | ModeAny TargetMode = iota
constant ModeAUR (line 7) | ModeAUR
constant ModeRepo (line 8) | ModeRepo
FILE: pkg/sync/build/errors.go
type FailedIgnoredPkgError (line 12) | type FailedIgnoredPkgError struct
method Error (line 16) | func (e *FailedIgnoredPkgError) Error() string {
type PkgDestNotInListError (line 30) | type PkgDestNotInListError struct
method Error (line 34) | func (e *PkgDestNotInListError) Error() string {
type FindPkgDestError (line 38) | type FindPkgDestError struct
method Error (line 42) | func (e *FindPkgDestError) Error() string {
type SetPkgReasonError (line 48) | type SetPkgReasonError struct
method Error (line 52) | func (e *SetPkgReasonError) Error() string {
type NoPkgDestsFoundError (line 61) | type NoPkgDestsFoundError struct
method Error (line 65) | func (e *NoPkgDestsFoundError) Error() string {
FILE: pkg/sync/build/installer.go
type PostInstallHookFunc (line 23) | type PostInstallHookFunc
type Installer (line 24) | type Installer struct
method SetInstallBuiltPackages (line 60) | func (installer *Installer) SetInstallBuiltPackages(install bool) {
method CompileFailedAndIgnored (line 64) | func (installer *Installer) CompileFailedAndIgnored() (map[string]erro...
method AddPostInstallHook (line 74) | func (installer *Installer) AddPostInstallHook(hook PostInstallHookFun...
method RunPostInstallHooks (line 82) | func (installer *Installer) RunPostInstallHooks(ctx context.Context) e...
method Install (line 94) | func (installer *Installer) Install(ctx context.Context,
method appendNoConfirm (line 141) | func (installer *Installer) appendNoConfirm() bool {
method handleLayer (line 145) | func (installer *Installer) handleLayer(ctx context.Context,
method installAURPackages (line 229) | func (installer *Installer) installAURPackages(ctx context.Context,
method buildPkg (line 310) | func (installer *Installer) buildPkg(ctx context.Context,
method pkgsAreAlreadyInstalled (line 368) | func (installer *Installer) pkgsAreAlreadyInstalled(pkgdests map[strin...
method skipAlreadyBuiltPkg (line 389) | func (installer *Installer) skipAlreadyBuiltPkg(isTarget bool, pkgdest...
method isDep (line 403) | func (*Installer) isDep(cmdArgs *parser.Arguments, aurExpNames mapset....
method getNewTargets (line 416) | func (installer *Installer) getNewTargets(pkgdests map[string]string, ...
method installSyncPackages (line 445) | func (installer *Installer) installSyncPackages(ctx context.Context, c...
function NewInstaller (line 41) | func NewInstaller(dbExecutor db.Executor,
function mergeLayers (line 135) | func mergeLayers(layer1, layer2 map[string]*dep.InstallInfo) map[string]...
function pkgsAreBuilt (line 378) | func pkgsAreBuilt(logger *text.Logger, pkgdests map[string]string) bool {
FILE: pkg/sync/build/installer_test.go
function newTestLogger (line 24) | func newTestLogger() *text.Logger {
function ptrString (line 28) | func ptrString(s string) *string {
function TestInstaller_InstallNeeded (line 32) | func TestInstaller_InstallNeeded(t *testing.T) {
function TestInstaller_BuildOnlySkipsInstall (line 185) | func TestInstaller_BuildOnlySkipsInstall(t *testing.T) {
function TestInstaller_InstallMixedSourcesAndLayers (line 281) | func TestInstaller_InstallMixedSourcesAndLayers(t *testing.T) {
function TestInstaller_RunPostHooks (line 544) | func TestInstaller_RunPostHooks(t *testing.T) {
function TestInstaller_CompileFailed (line 573) | func TestInstaller_CompileFailed(t *testing.T) {
function TestInstaller_InstallSplitPackage (line 727) | func TestInstaller_InstallSplitPackage(t *testing.T) {
function TestInstaller_InstallDownloadOnly (line 894) | func TestInstaller_InstallDownloadOnly(t *testing.T) {
function TestInstaller_InstallGroup (line 1043) | func TestInstaller_InstallGroup(t *testing.T) {
function TestInstaller_InstallRebuild (line 1144) | func TestInstaller_InstallRebuild(t *testing.T) {
function TestInstaller_InstallUpgrade (line 1350) | func TestInstaller_InstallUpgrade(t *testing.T) {
function TestInstaller_KeepSrc (line 1437) | func TestInstaller_KeepSrc(t *testing.T) {
function TestInstaller_InstallAsExplicit (line 1544) | func TestInstaller_InstallAsExplicit(t *testing.T) {
FILE: pkg/sync/build/pkg_archive.go
function installPkgArchive (line 19) | func installPkgArchive(ctx context.Context,
function setInstallReason (line 59) | func setInstallReason(ctx context.Context,
function setPkgReason (line 74) | func setPkgReason(ctx context.Context,
function asdeps (line 113) | func asdeps(ctx context.Context,
function asexp (line 120) | func asexp(ctx context.Context,
function parsePackageList (line 127) | func parsePackageList(ctx context.Context, cmdBuilder exe.ICmdBuilder,
FILE: pkg/sync/build/pkg_archive_test.go
function TestParsePackageList (line 15) | func TestParsePackageList(t *testing.T) {
FILE: pkg/sync/srcinfo/pgp/keys.go
type pgpKeySet (line 19) | type pgpKeySet
method toSlice (line 21) | func (set pgpKeySet) toSlice() []string {
method set (line 30) | func (set pgpKeySet) set(key, p string) {
method get (line 37) | func (set pgpKeySet) get(key string) bool {
type GPGCmdBuilder (line 44) | type GPGCmdBuilder interface
function CheckPgpKeys (line 51) | func CheckPgpKeys(ctx context.Context, logger *text.Logger, pkgbuildDirs...
function importKeys (line 96) | func importKeys(ctx context.Context, logger *text.Logger, cmdBuilder GPG...
function formatKeysToImport (line 108) | func formatKeysToImport(logger *text.Logger, keys pgpKeySet) (string, er...
FILE: pkg/sync/srcinfo/pgp/keys_test.go
function newTestLogger (line 24) | func newTestLogger() *text.Logger {
function makeSrcinfo (line 28) | func makeSrcinfo(pkgbase string, pgpkeys ...string) *gosrc.Srcinfo {
function TestCheckPgpKeys (line 36) | func TestCheckPgpKeys(t *testing.T) {
FILE: pkg/sync/srcinfo/service.go
type Service (line 21) | type Service struct
method IncompatiblePkgs (line 50) | func (s *Service) IncompatiblePkgs(ctx context.Context) ([]string, err...
method CheckPGPKeys (line 71) | func (s *Service) CheckPGPKeys(ctx context.Context) error {
method UpdateVCSStore (line 76) | func (s *Service) UpdateVCSStore(ctx context.Context, targets []map[st...
function NewService (line 32) | func NewService(dbExecutor db.Executor, cfg *settings.Configuration, log...
function ParseSrcinfoFilesByBase (line 104) | func ParseSrcinfoFilesByBase(logger *text.Logger, pkgBuildDirs map[strin...
FILE: pkg/sync/srcinfo/service_test.go
function newTestLogger (line 21) | func newTestLogger() *text.Logger {
function TestNewService (line 25) | func TestNewService(t *testing.T) {
function TestService_IncompatiblePkgs (line 46) | func TestService_IncompatiblePkgs(t *testing.T) {
function TestService_CheckPGPKeys (line 80) | func TestService_CheckPGPKeys(t *testing.T) {
function TestService_UpdateVCSStore (line 105) | func TestService_UpdateVCSStore(t *testing.T) {
FILE: pkg/sync/sync.go
type OperationService (line 21) | type OperationService struct
method Run (line 40) | func (o *OperationService) Run(ctx context.Context, run *runtime.Runtime,
method manualConfirmRequired (line 126) | func (o *OperationService) manualConfirmRequired(cmdArgs *parser.Argum...
function NewOperationService (line 28) | func NewOperationService(ctx context.Context,
function confirmIncompatible (line 130) | func confirmIncompatible(logger *text.Logger, incompatible []string) err...
FILE: pkg/sync/workdir/aur_source.go
type ErrDownloadSource (line 17) | type ErrDownloadSource struct
method Error (line 23) | func (e ErrDownloadSource) Error() string {
method Unwrap (line 28) | func (e *ErrDownloadSource) Unwrap() error {
function downloadPKGBUILDSource (line 32) | func downloadPKGBUILDSource(ctx context.Context,
function downloadPKGBUILDSourceWorker (line 54) | func downloadPKGBUILDSourceWorker(ctx context.Context, wg *sync.WaitGroup,
function downloadPKGBUILDSourceFanout (line 70) | func downloadPKGBUILDSourceFanout(ctx context.Context, cmdBuilder exe.IC...
FILE: pkg/sync/workdir/aur_source_test.go
type TestMakepkgBuilder (line 20) | type TestMakepkgBuilder struct
method BuildMakepkgCmd (line 30) | func (z *TestMakepkgBuilder) BuildMakepkgCmd(ctx context.Context, dir ...
method Show (line 49) | func (z *TestMakepkgBuilder) Show(cmd *exec.Cmd) error {
method GetKeepSrc (line 53) | func (z *TestMakepkgBuilder) GetKeepSrc() bool {
function Test_downloadPKGBUILDSource (line 60) | func Test_downloadPKGBUILDSource(t *testing.T) {
function Test_downloadPKGBUILDSourceError (line 105) | func Test_downloadPKGBUILDSourceError(t *testing.T) {
function Test_downloadPKGBUILDSourceFanout (line 122) | func Test_downloadPKGBUILDSourceFanout(t *testing.T) {
function Test_downloadPKGBUILDSourceFanoutNoCC (line 152) | func Test_downloadPKGBUILDSourceFanoutNoCC(t *testing.T) {
function Test_downloadPKGBUILDSourceFanoutError (line 172) | func Test_downloadPKGBUILDSourceFanoutError(t *testing.T) {
FILE: pkg/sync/workdir/clean.go
function removeMake (line 15) | func removeMake(ctx context.Context, config *settings.Configuration,
function cleanAfter (line 38) | func cleanAfter(ctx context.Context, run *runtime.Runtime,
FILE: pkg/sync/workdir/merge.go
function gitMerge (line 12) | func gitMerge(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir strin...
function mergePkgbuilds (line 30) | func mergePkgbuilds(ctx context.Context, cmdBuilder exe.ICmdBuilder, pkg...
FILE: pkg/sync/workdir/preparer.go
type HookType (line 27) | type HookType
constant PreDownloadSourcesHook (line 31) | PreDownloadSourcesHook HookType = "pre-download-sources"
type HookFn (line 34) | type HookFn
type Hook (line 38) | type Hook struct
type Preparer (line 44) | type Preparer struct
method ShouldCleanAURDirs (line 100) | func (preper *Preparer) ShouldCleanAURDirs(run *runtime.Runtime, pkgBu...
method ShouldCleanMakeDeps (line 113) | func (preper *Preparer) ShouldCleanMakeDeps(run *runtime.Runtime, cmdA...
method Run (line 138) | func (preper *Preparer) Run(ctx context.Context, run *runtime.Runtime,
method Present (line 151) | func (preper *Preparer) Present(targets []map[string]*dep.InstallInfo) {
method PrepareWorkspace (line 189) | func (preper *Preparer) PrepareWorkspace(ctx context.Context,
method needToCloneAURBase (line 244) | func (preper *Preparer) needToCloneAURBase(installInfo *dep.InstallInf...
function NewPreparerWithoutHooks (line 55) | func NewPreparerWithoutHooks(dbExecutor db.Executor, cmdBuilder exe.ICmd...
function NewPreparer (line 68) | func NewPreparer(dbExecutor db.Executor, cmdBuilder exe.ICmdBuilder,
FILE: pkg/sync/workdir/preparer_test.go
function newTestLogger (line 17) | func newTestLogger() *text.Logger {
function TestPreDownloadSourcesHooks (line 22) | func TestPreDownloadSourcesHooks(t *testing.T) {
FILE: pkg/text/color.go
constant redCode (line 6) | redCode = "\x1b[31m"
constant greenCode (line 7) | greenCode = "\x1b[32m"
constant yellowCode (line 8) | yellowCode = "\x1b[33m"
constant blueCode (line 9) | blueCode = "\x1b[34m"
constant magentaCode (line 10) | magentaCode = "\x1b[35m"
constant CyanCode (line 11) | CyanCode = "\x1b[36m"
constant boldCode (line 12) | boldCode = "\x1b[1m"
constant ResetCode (line 14) | ResetCode = "\x1b[0m"
function stylize (line 20) | func stylize(startCode, in string) string {
function Red (line 28) | func Red(in string) string {
function Green (line 32) | func Green(in string) string {
function yellow (line 36) | func yellow(in string) string {
function Cyan (line 40) | func Cyan(in string) string {
function Magenta (line 44) | func Magenta(in string) string {
function Blue (line 48) | func Blue(in string) string {
function Bold (line 52) | func Bold(in string) string {
function ColorHash (line 58) | func ColorHash(name string) (output string) {
FILE: pkg/text/convert.go
function Human (line 8) | func Human(size int64) string {
FILE: pkg/text/errors.go
type ErrInputOverflow (line 5) | type ErrInputOverflow struct
method Error (line 7) | func (e ErrInputOverflow) Error() string {
FILE: pkg/text/input.go
method GetInput (line 13) | func (l *Logger) GetInput(defaultValue string, noConfirm bool) (string, ...
method ContinueTask (line 37) | func (l *Logger) ContinueTask(s string, preset, noConfirm bool) bool {
FILE: pkg/text/service.go
constant arrow (line 9) | arrow = "==>"
constant smallArrow (line 10) | smallArrow = " ->"
constant opSymbol (line 11) | opSymbol = "::"
type Logger (line 14) | type Logger struct
method Child (line 32) | func (l *Logger) Child(name string) *Logger {
method Debugln (line 36) | func (l *Logger) Debugln(a ...any) {
method OperationInfoln (line 46) | func (l *Logger) OperationInfoln(a ...any) {
method OperationInfo (line 50) | func (l *Logger) OperationInfo(a ...any) {
method SprintOperationInfo (line 54) | func (l *Logger) SprintOperationInfo(a ...any) string {
method Info (line 58) | func (l *Logger) Info(a ...any) {
method Infoln (line 62) | func (l *Logger) Infoln(a ...any) {
method Warn (line 66) | func (l *Logger) Warn(a ...any) {
method Warnln (line 70) | func (l *Logger) Warnln(a ...any) {
method SprintWarn (line 74) | func (l *Logger) SprintWarn(a ...any) string {
method Error (line 78) | func (l *Logger) Error(a ...any) {
method Errorln (line 82) | func (l *Logger) Errorln(a ...any) {
method SprintError (line 86) | func (l *Logger) SprintError(a ...any) string {
method Printf (line 90) | func (l *Logger) Printf(format string, a ...any) {
method Println (line 94) | func (l *Logger) Println(a ...any) {
method Print (line 98) | func (l *Logger) Print(a ...any) {
function NewLogger (line 22) | func NewLogger(stdout, stderr io.Writer, r io.Reader, debug bool, name s...
FILE: pkg/text/text.go
constant yDefault (line 9) | yDefault = "y"
constant nDefault (line 10) | nDefault = "n"
function SplitDBFromName (line 14) | func SplitDBFromName(pkg string) (db, name string) {
function LessRunes (line 25) | func LessRunes(iRunes, jRunes []rune) bool {
function CreateOSC8Link (line 62) | func CreateOSC8Link(url, text string) string {
function CreateRepoLink (line 68) | func CreateRepoLink(repo, arch, pkgName, text string) string {
FILE: pkg/text/text_test.go
function TestLessRunes (line 18) | func TestLessRunes(t *testing.T) {
function TestContinueTask (line 51) | func TestContinueTask(t *testing.T) {
function TestContinueTaskRU (line 84) | func TestContinueTaskRU(t *testing.T) {
function TestContinueTaskDE (line 132) | func TestContinueTaskDE(t *testing.T) {
function TestCreateRepoLink (line 181) | func TestCreateRepoLink(t *testing.T) {
FILE: pkg/text/time.go
function FormatTime (line 6) | func FormatTime(i int) string {
function FormatTimeQuery (line 12) | func FormatTimeQuery(i int) string {
FILE: pkg/upgrade/service.go
constant cutOffExtra (line 25) | cutOffExtra = 2
type UpgradeService (line 27) | type UpgradeService struct
method upGraph (line 56) | func (u *UpgradeService) upGraph(ctx context.Context, graph *topo.Grap...
method graphToUpSlice (line 184) | func (u *UpgradeService) graphToUpSlice(graph *topo.Graph[string, *dep...
method GraphUpgrades (line 236) | func (u *UpgradeService) GraphUpgrades(ctx context.Context,
method UserExcludeUpgrades (line 254) | func (u *UpgradeService) UserExcludeUpgrades(graph *topo.Graph[string,...
function NewUpgradeService (line 39) | func NewUpgradeService(grapher *dep.Grapher, aurCache aur.QueryClient,
FILE: pkg/upgrade/service_test.go
function ptrString (line 31) | func ptrString(s string) *string {
function TestUpgradeService_GraphUpgrades (line 35) | func TestUpgradeService_GraphUpgrades(t *testing.T) {
function TestUpgradeService_GraphUpgradesMissingDep (line 385) | func TestUpgradeService_GraphUpgradesMissingDep(t *testing.T) {
function TestUpgradeService_GraphUpgradesNoUpdates (line 567) | func TestUpgradeService_GraphUpgradesNoUpdates(t *testing.T) {
function TestUpgradeService_Warnings (line 689) | func TestUpgradeService_Warnings(t *testing.T) {
function TestUpgradeService_GraphUpgrades_zfs_dkms (line 785) | func TestUpgradeService_GraphUpgrades_zfs_dkms(t *testing.T) {
FILE: pkg/upgrade/sources.go
function UpDevel (line 14) | func UpDevel(
function printIgnoringPackage (line 53) | func printIgnoringPackage(log *text.Logger, pkg db.IPackage, newPkgVersi...
function UpAUR (line 65) | func UpAUR(log *text.Logger, remote map[string]db.IPackage, aurdata map[...
FILE: pkg/upgrade/sources_test.go
function Test_upAUR (line 23) | func Test_upAUR(t *testing.T) {
function Test_upDevel (line 129) | func Test_upDevel(t *testing.T) {
FILE: pkg/upgrade/upgrade.go
type Filter (line 13) | type Filter
function StylizedNameWithRepository (line 18) | func StylizedNameWithRepository(u *Upgrade) string {
type UpSlice (line 23) | type UpSlice struct
method Len (line 29) | func (u UpSlice) Len() int { return len(u.Up) }
method Swap (line 30) | func (u UpSlice) Swap(i, j int) { u.Up[i], u.Up[j] = u.Up[j], u.Up[i] }
method Less (line 32) | func (u UpSlice) Less(i, j int) bool {
method Print (line 73) | func (u UpSlice) Print(logger *text.Logger) {
method PrintDeps (line 93) | func (u UpSlice) PrintDeps(logger *text.Logger) {
function calculateFormatting (line 56) | func calculateFormatting(upgrades []Upgrade) (longestName, longestVersio...
FILE: pkg/upgrade/upgrade_test.go
function TestGetVersionDiff (line 13) | func TestGetVersionDiff(t *testing.T) {
FILE: pkg/vcs/mock.go
type Mock (line 11) | type Mock struct
method ToUpgrade (line 16) | func (m *Mock) ToUpgrade(ctx context.Context, pkgName string) bool {
method Update (line 20) | func (m *Mock) Update(ctx context.Context, pkgName string, sources []g...
method Save (line 23) | func (m *Mock) Save() error {
method RemovePackages (line 27) | func (m *Mock) RemovePackages(pkgs []string) {
method Load (line 30) | func (m *Mock) Load() error {
method CleanOrphans (line 34) | func (m *Mock) CleanOrphans(pkgs map[string]alpm.Package) {
FILE: pkg/vcs/vcs.go
constant defaultTimeout (line 23) | defaultTimeout = 15 * time.Second
type Store (line 25) | type Store interface
type InfoStore (line 42) | type InfoStore struct
method getCommit (line 84) | func (v *InfoStore) getCommit(ctx context.Context, url, branch string,...
method Update (line 120) | func (v *InfoStore) Update(ctx context.Context, pkgName string, source...
method ToUpgrade (line 206) | func (v *InfoStore) ToUpgrade(ctx context.Context, pkgName string) bool {
method needsUpdate (line 214) | func (v *InfoStore) needsUpdate(ctx context.Context, infos OriginInfoB...
method Save (line 260) | func (v *InfoStore) Save() error {
method RemovePackages (line 281) | func (v *InfoStore) RemovePackages(pkgs []string) {
method Load (line 300) | func (v *InfoStore) Load() error {
method CleanOrphans (line 318) | func (v *InfoStore) CleanOrphans(pkgs map[string]alpm.Package) {
type OriginInfoByURL (line 51) | type OriginInfoByURL
type OriginInfo (line 63) | type OriginInfo struct
function NewInfoStore (line 69) | func NewInfoStore(filePath string, cmdBuilder exe.GitCmdBuilder,
function parseSource (line 163) | func parseSource(source string) (url, branch string, protocols []string) {
FILE: pkg/vcs/vcs_test.go
function newTestLogger (line 26) | func newTestLogger() *text.Logger {
function TestParsing (line 30) | func TestParsing(t *testing.T) {
function TestNewInfoStore (line 66) | func TestNewInfoStore(t *testing.T) {
type MockRunner (line 99) | type MockRunner struct
method Show (line 104) | func (r *MockRunner) Show(cmd *exec.Cmd) error {
method Capture (line 108) | func (r *MockRunner) Capture(cmd *exec.Cmd) (stdout, stderr string, er...
function TestInfoStoreToUpgrade (line 116) | func TestInfoStoreToUpgrade(t *testing.T) {
function TestInfoStore_NeedsUpdate (line 248) | func TestInfoStore_NeedsUpdate(t *testing.T) {
function TestInfoStore_Update (line 377) | func TestInfoStore_Update(t *testing.T) {
function TestInfoStore_Remove (line 443) | func TestInfoStore_Remove(t *testing.T) {
function TestInfoStore_CleanOrphans (line 490) | func TestInfoStore_CleanOrphans(t *testing.T) {
FILE: print.go
function printInfo (line 29) | func printInfo(logger *text.Logger, config *settings.Configuration, a *a...
function biggestPackages (line 69) | func biggestPackages(logger *text.Logger, dbExecutor db.Executor) {
function localStatistics (line 82) | func localStatistics(ctx context.Context, run *runtime.Runtime, dbExecut...
function printUpdateList (line 122) | func printUpdateList(ctx context.Context, run *runtime.Runtime, cmdArgs ...
function printInfoValue (line 200) | func printInfoValue(logger *text.Logger, key string, values ...string) {
function getColumnCount (line 251) | func getColumnCount() int {
FILE: print_test.go
function TestPrintUpdateList (line 31) | func TestPrintUpdateList(t *testing.T) {
FILE: query.go
function syncSearch (line 23) | func syncSearch(ctx context.Context, pkgS []string,
function syncInfo (line 37) | func syncInfo(ctx context.Context, run *runtime.Runtime,
function packageSlices (line 127) | func packageSlices(toCheck []string, config *settings.Configuration, dbE...
type mapSetMap (line 151) | type mapSetMap
method Add (line 156) | func (mss mapSetMap[T]) Add(n, v T) {
function hangingPackages (line 167) | func hangingPackages(removeOptional bool, dbExecutor db.Executor) (hangi...
function getFolderSize (line 243) | func getFolderSize(path string) (size int64) {
function statistics (line 260) | func statistics(run *runtime.Runtime, dbExecutor db.Executor) (res struct {
FILE: query_test.go
function getFromFile (line 29) | func getFromFile(t *testing.T, filePath string) mockaur.GetFunc {
function TestSyncInfo (line 45) | func TestSyncInfo(t *testing.T) {
function TestSyncSearchAURDB (line 186) | func TestSyncSearchAURDB(t *testing.T) {
FILE: sync.go
function syncInstall (line 21) | func syncInstall(ctx context.Context,
function earlyRefresh (line 93) | func earlyRefresh(ctx context.Context, cfg *settings.Configuration, cmdB...
FILE: sync_test.go
function TestSyncUpgrade (line 34) | func TestSyncUpgrade(t *testing.T) {
function TestSyncUpgrade_IgnoreAll (line 146) | func TestSyncUpgrade_IgnoreAll(t *testing.T) {
function TestSyncUpgrade_IgnoreOne (line 257) | func TestSyncUpgrade_IgnoreOne(t *testing.T) {
function TestSyncUpgradeAURPinnedSplitPackage (line 389) | func TestSyncUpgradeAURPinnedSplitPackage(t *testing.T) {
function sanitizeCalls (line 581) | func sanitizeCalls(calls []exe.Call, tmpDir, makepkg, pacman, git string...
function sanitizeCall (line 591) | func sanitizeCall(s, tmpDir, makepkg, pacman, git string) string {
function TestSyncUpgrade_NoCombinedUpgrade (line 612) | func TestSyncUpgrade_NoCombinedUpgrade(t *testing.T) {
FILE: vcs.go
function infoToInstallInfo (line 17) | func infoToInstallInfo(info []aur.Pkg) []map[string]*dep.InstallInfo {
function createDevelDB (line 33) | func createDevelDB(ctx context.Context, run *runtime.Runtime, dbExecutor...
FILE: vote.go
type ErrAURVote (line 14) | type ErrAURVote struct
method Error (line 19) | func (e *ErrAURVote) Error() string {
function handlePackageVote (line 23) | func handlePackageVote(ctx context.Context,
Condensed preview — 214 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,927K chars).
[
{
"path": ".dockerignore",
"chars": 61,
"preview": "*\n!*.go\n!pkg\n!go.mod\n!go.sum\n!Makefile\n!po\n!doc\n!completions\n"
},
{
"path": ".github/CODEOWNERS",
"chars": 15,
"preview": "* @Jguer\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 16,
"preview": "github: [Jguer]\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 878,
"preview": "---\nname: Bug report\nabout: Report a malfunction to help us improve\ntitle: \"\"\nlabels: \"Status: Triage, Type: Bug\"\nassign"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 671,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: \"\"\nlabels: \"Type: Feature Request, Status: Disc"
},
{
"path": ".github/dependabot.yml",
"chars": 587,
"preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
},
{
"path": ".github/workflows/builder-image.yml",
"chars": 3598,
"preview": "name: Builder Image\n\non:\n schedule:\n - cron: \"0 3 * * 1\" # Every Monday at 3 AM\n push:\n paths:\n - \"ci.Dock"
},
{
"path": ".github/workflows/multiarch-build.yml",
"chars": 2754,
"preview": "name: Build Release\n\non:\n push:\n tags:\n - v*\n\njobs:\n build-releases:\n strategy:\n matrix:\n arch:"
},
{
"path": ".github/workflows/testing-git.yml",
"chars": 1202,
"preview": "name: Test against pacman-git\non:\n pull_request:\n paths-ignore:\n - \"doc/**\"\n - \"**/*.po\"\n - \"README.m"
},
{
"path": ".github/workflows/testing.yml",
"chars": 1179,
"preview": "name: Test against pacman\non:\n pull_request:\n\njobs:\n build:\n name: Lint and test yay\n runs-on: ubuntu-latest\n "
},
{
"path": ".gitignore",
"chars": 296,
"preview": "# Compiled Object files, Static and Dynamic libs (Shared Objects)\n*.o\n*.a\n*.so\n\n# Folders\n_obj\n_test\n.vscode\n\n*.cgo1.go\n"
},
{
"path": ".golangci.yml",
"chars": 1824,
"preview": "version: \"2\"\nrun:\n go: \"1.26\"\nlinters:\n default: none\n enable:\n - bodyclose\n - dogsled\n - dupl\n - errchec"
},
{
"path": ".pre-commit-config.yaml",
"chars": 735,
"preview": "default_stages: [commit]\n\nrepos:\n - repo: https://github.com/dnephin/pre-commit-golang\n rev: v0.5.1\n hooks:\n "
},
{
"path": "CONTRIBUTING.md",
"chars": 2123,
"preview": "# Contributing to yay\n\n## Translation\n\n[Transifex](https://www.transifex.com/yay-1/yay/)\n\n## Quality Assurance\n\n```sh\npa"
},
{
"path": "Dockerfile",
"chars": 248,
"preview": "FROM ghcr.io/jguer/yay-builder:latest\nLABEL maintainer=\"Jguer,docker@jguer.space\"\n\nARG VERSION\nARG PREFIX\nARG ARCH\n\nWORK"
},
{
"path": "LICENSE",
"chars": 35141,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "Makefile",
"chars": 3777,
"preview": "export GO111MODULE=on\nGOPROXY ?= https://proxy.golang.org,direct\nexport GOPROXY\n\nBUILD_TAG = devel\nARCH ?= $(shell uname"
},
{
"path": "README.md",
"chars": 8833,
"preview": "[](https://aur."
},
{
"path": "SECURITY.md",
"chars": 557,
"preview": "# Security Policy\n\nThank you for helping keep yay secure!\n\n## Supported Versions\n\nWe only provide security updates and s"
},
{
"path": "ci.Dockerfile",
"chars": 828,
"preview": "FROM quay.io/gmanka/archlinuxarm:base-devel\nLABEL maintainer=\"Jguer,docker@jguer.space\"\n\nENV GO111MODULE=on\nWORKDIR /app"
},
{
"path": "clean.go",
"chars": 4985,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/Jguer/aur\"\n\tmapset \"github.com/deckarep/golang-se"
},
{
"path": "clean_test.go",
"chars": 5448,
"preview": "//go:build !integration\n// +build !integration\n\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepat"
},
{
"path": "cmd.go",
"chars": 16098,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\n\talpm \"github.com/Jguer/dyalpm\"\n\t\"github.com/"
},
{
"path": "cmd_test.go",
"chars": 3733,
"preview": "//go:build !integration\n// +build !integration\n\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"string"
},
{
"path": "completions/bash",
"chars": 4249,
"preview": "# This file is in the public domain.\n\n_arch_compgen() {\n local i r\n COMPREPLY=($(compgen -W '$*' -- \"$cur\"))\n for ((i"
},
{
"path": "completions/fish",
"chars": 17358,
"preview": "# vim:fdm=marker foldlevel=0 tabstop=2 shiftwidth=2 filetype=fish\n# Original Author for pacman: Giorgio Lando <patroclo7"
},
{
"path": "completions/zsh",
"chars": 20867,
"preview": "#compdef yay\n# vim:noexpandtab tabstop=2 shiftwidth=2 filetype=zsh\n\ntypeset -A opt_args\nsetopt extendedglob\n\n# options f"
},
{
"path": "doc/yay.8",
"chars": 17320,
"preview": ".TH \"YAY\" \"8\" \"2019\\-10\\-21\" \"Yay v12.0+\" \"Yay Manual\"\n.nh\n.ad l\n.SH NAME\nyay \\- AUR Helper written in go\n\n.SH SYNOPSIS\n"
},
{
"path": "errors.go",
"chars": 163,
"preview": "package main\n\nimport (\n\t\"errors\"\n\n\t\"github.com/leonelquinteros/gotext\"\n)\n\nvar ErrPackagesNotFound = errors.New(gotext.Ge"
},
{
"path": "get.go",
"chars": 1850,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/Jguer/aur\"\n\t\"github.com/leonelquinte"
},
{
"path": "go.mod",
"chars": 1155,
"preview": "module github.com/Jguer/yay/v12\n\nrequire (\n\tgithub.com/Jguer/aur v1.3.0\n\tgithub.com/Jguer/dyalpm v0.1.1\n\tgithub.com/Jgue"
},
{
"path": "go.sum",
"chars": 6507,
"preview": "github.com/Jguer/aur v1.3.0 h1:skdjp/P9kB75TBaJmn9PKK/kCeA9QsgjdUrORZ3gldU=\ngithub.com/Jguer/aur v1.3.0/go.mod h1:F8Awo+"
},
{
"path": "local_install.go",
"chars": 3063,
"preview": "// Experimental code for install local with dependency refactoring\n// Not at feature parity with install.go\npackage main"
},
{
"path": "local_install_test.go",
"chars": 35547,
"preview": "//go:build !integration\n// +build !integration\n\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/f"
},
{
"path": "main.go",
"chars": 3097,
"preview": "package main // import \"github.com/Jguer/yay\"\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime/debug\"\n\t\"strings"
},
{
"path": "pkg/cmd/graph/main.go",
"chars": 1877,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/Jguer/yay/v12/pkg/db/ialpm\"\n\t\"gi"
},
{
"path": "pkg/completion/completion.go",
"chars": 2845,
"preview": "package completion\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Jguer/yay/v12/pkg/"
},
{
"path": "pkg/completion/completion_test.go",
"chars": 14016,
"preview": "//go:build !integration\n// +build !integration\n\npackage completion\n\nimport (\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"context\"\n\t\"erro"
},
{
"path": "pkg/db/executor.go",
"chars": 1705,
"preview": "package db\n\nimport (\n\t\"time\"\n\n\talpm \"github.com/Jguer/dyalpm\"\n\n\t\"github.com/Jguer/yay/v12/pkg/text\"\n)\n\ntype (\n\tIPackage "
},
{
"path": "pkg/db/ialpm/alpm.go",
"chars": 11611,
"preview": "package ialpm\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n\n\talpm \"github.com/Jguer/dyalpm\"\n\tpacmanconf \"github.c"
},
{
"path": "pkg/db/ialpm/alpm_test.go",
"chars": 3307,
"preview": "//go:build !integration\n// +build !integration\n\npackage ialpm\n\nimport (\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n\n\talpm \"github.com/J"
},
{
"path": "pkg/db/ialpm/high_level.go",
"chars": 1444,
"preview": "package ialpm\n\nimport (\n\talpm \"github.com/Jguer/dyalpm\"\n\n\t\"github.com/Jguer/yay/v12/pkg/text\"\n)\n\n// GetPackageNamesBySou"
},
{
"path": "pkg/db/mock/executor.go",
"chars": 5189,
"preview": "package mock\n\nimport (\n\t\"time\"\n\n\t\"github.com/Jguer/yay/v12/pkg/db\"\n\t\"github.com/Jguer/yay/v12/pkg/text\"\n\n\talpm \"github.c"
},
{
"path": "pkg/db/mock/repo.go",
"chars": 5583,
"preview": "package mock\n\nimport (\n\t\"io\"\n\t\"time\"\n\n\talpm \"github.com/Jguer/dyalpm\"\n)\n\n// DependList is a lightweight helper for test "
},
{
"path": "pkg/db/types.go",
"chars": 169,
"preview": "package db\n\nimport \"slices\"\n\nfunc ArchIsSupported(alpmArch []string, arch string) bool {\n\tif arch == \"any\" {\n\t\treturn tr"
},
{
"path": "pkg/dep/dep.go",
"chars": 1648,
"preview": "package dep\n\nimport (\n\t\"strings\"\n\n\t\"github.com/Jguer/yay/v12/pkg/db\"\n\taur \"github.com/Jguer/yay/v12/pkg/query\"\n)\n\nfunc s"
},
{
"path": "pkg/dep/dep_graph.go",
"chars": 22035,
"preview": "package dep\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\taurc \"github.com/Jguer/aur\"\n\talpm \"github.com/Jguer/dyal"
},
{
"path": "pkg/dep/dep_graph_bench_test.go",
"chars": 19428,
"preview": "//go:build !integration\n// +build !integration\n\npackage dep\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\t\"testing\"\n\n\taurc \"github.c"
},
{
"path": "pkg/dep/dep_graph_rpc_test.go",
"chars": 31273,
"preview": "//go:build !integration\n// +build !integration\n\n// Package dep provides tests for tree resolution and parsing using RPC/"
},
{
"path": "pkg/dep/dep_graph_test.go",
"chars": 34478,
"preview": "//go:build !integration\n// +build !integration\n\npackage dep\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n"
},
{
"path": "pkg/dep/mock/aur.go",
"chars": 340,
"preview": "package mock\n\nimport (\n\t\"context\"\n\n\t\"github.com/Jguer/aur\"\n)\n\ntype GetFunc func(ctx context.Context, query *aur.Query) ("
},
{
"path": "pkg/dep/target_handler.go",
"chars": 562,
"preview": "package dep\n\nimport \"github.com/Jguer/yay/v12/pkg/text\"\n\ntype Target struct {\n\tDB string\n\tName string\n\tMod s"
},
{
"path": "pkg/dep/testdata/android-sdk.json",
"chars": 707,
"preview": "[\n{\"ID\":1055234,\"Name\":\"android-sdk\",\"PackageBaseID\":13751,\"PackageBase\":\"android-sdk\",\"Version\":\"26.1.1-2\",\"Description"
},
{
"path": "pkg/dep/testdata/aws-cli-git.json",
"chars": 913,
"preview": "[\n {\"ID\":1266542,\"Name\":\"aws-cli-git\",\"PackageBaseID\":75029,\"PackageBase\":\"aws-cli-git\",\"Version\":\"1.27.145.r11217.g5"
},
{
"path": "pkg/dep/testdata/clion.json",
"chars": 2638,
"preview": "[\n {\"ID\":1937213,\"Name\":\"clion\",\"PackageBaseID\":92202,\"PackageBase\":\"clion\",\"Version\":\"2025.3.1.1-1\",\"Description\":\"C"
},
{
"path": "pkg/dep/testdata/gstreamer-git.json",
"chars": 1891,
"preview": "[\n {\"ID\":1000001,\"Name\":\"gstreamer-git\",\"PackageBaseID\":100001,\"PackageBase\":\"gstreamer-git\",\"Version\":\"1.24.0.r37-1\""
},
{
"path": "pkg/dep/testdata/jellyfin-server.json",
"chars": 554,
"preview": "[\n {\"ID\":1176791,\"Name\":\"jellyfin-server\",\"PackageBaseID\":138631,\"PackageBase\":\"jellyfin\",\"Version\":\"10.8.8-1\",\"Descr"
},
{
"path": "pkg/dep/testdata/jellyfin-web.json",
"chars": 466,
"preview": "[\n{\"ID\":1176790,\"Name\":\"jellyfin-web\",\"PackageBaseID\":138631,\"PackageBase\":\"jellyfin\",\"Version\":\"10.8.8-1\",\"Description\""
},
{
"path": "pkg/dep/testdata/jellyfin.json",
"chars": 532,
"preview": "[\n {\"ID\":1176789,\"Name\":\"jellyfin\",\"PackageBaseID\":138631,\"PackageBase\":\"jellyfin\",\"Version\":\"10.8.8-1\",\"Description\""
},
{
"path": "pkg/dep/testdata/liri-desktop-git.json",
"chars": 3319,
"preview": "[\n {\"ID\":2000001,\"Name\":\"liri-desktop-git\",\"PackageBaseID\":200001,\"PackageBase\":\"liri-desktop-git\",\"Version\":\"0.1.0.r"
},
{
"path": "pkg/dep/testdata/mesa-git.json",
"chars": 841,
"preview": "[\n {\"ID\":3000001,\"Name\":\"mesa-git\",\"PackageBaseID\":300001,\"PackageBase\":\"mesa-git\",\"Version\":\"24.0.0.r1234-1\",\"Descri"
},
{
"path": "pkg/dep/testdata/nx.json",
"chars": 2809,
"preview": "[\n {\"ID\":1313798,\"Name\":\"libxcomp\",\"PackageBaseID\":177611,\"PackageBase\":\"nx\",\"Version\":\"3.5.99.27-3\",\"Description\":\"N"
},
{
"path": "pkg/dep/testdata/python-pydantic.json",
"chars": 603,
"preview": "[\n {\"ID\":2000001,\"Name\":\"python-pydantic\",\"PackageBaseID\":200001,\"PackageBase\":\"python-pydantic\",\"Version\":\"2.5.0-1\","
},
{
"path": "pkg/dep/testdata/samsung-unified-driver.json",
"chars": 2198,
"preview": "[\n {\"ID\":1734381,\"Name\":\"samsung-unified-driver\",\"PackageBaseID\":44188,\"PackageBase\":\"samsung-unified-driver\",\"Versio"
},
{
"path": "pkg/dep/topo/dep.go",
"chars": 11977,
"preview": "package topo\n\nimport (\n\t\"fmt\"\n\t\"maps\"\n\t\"strings\"\n\n\talpm \"github.com/Jguer/dyalpm\"\n)\n\ntype (\n\t// NodeSet is a set of node"
},
{
"path": "pkg/dep/topo/dep_test.go",
"chars": 2341,
"preview": "package topo\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGraph_DependenciesAndDependents_Di"
},
{
"path": "pkg/dep/topo/errors.go",
"chars": 623,
"preview": "package topo\n\nimport \"errors\"\n\nvar (\n\t// ErrSelfReferential is returned when attempting to create an edge where a node d"
},
{
"path": "pkg/download/abs.go",
"chars": 2564,
"preview": "package download\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"regexp\"\n\n\t\"github.com/leonelquinteros/gotext\""
},
{
"path": "pkg/download/abs_test.go",
"chars": 8640,
"preview": "//go:build !integration\n// +build !integration\n\npackage download\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/fil"
},
{
"path": "pkg/download/aur.go",
"chars": 3820,
"preview": "package download\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"compress/gzip\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"path\"\n\t\"s"
},
{
"path": "pkg/download/aur_test.go",
"chars": 4305,
"preview": "//go:build !integration\n// +build !integration\n\npackage download\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/fil"
},
{
"path": "pkg/download/errors.go",
"chars": 634,
"preview": "package download\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/leonelquinteros/gotext\"\n)\n\n// ErrAURPackageNotFound means that package w"
},
{
"path": "pkg/download/unified.go",
"chars": 5809,
"preview": "package download\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\n\t\"github.com/leonelquinteros/gotext\"\n\n"
},
{
"path": "pkg/download/unified_integration_test.go",
"chars": 3124,
"preview": "//go:build integration\n// +build integration\n\npackage download\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\t\"testi"
},
{
"path": "pkg/download/unified_test.go",
"chars": 8134,
"preview": "//go:build !integration\n// +build !integration\n\npackage download\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/fil"
},
{
"path": "pkg/download/utils_test.go",
"chars": 2169,
"preview": "package download\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/"
},
{
"path": "pkg/intrange/intrange.go",
"chars": 2472,
"preview": "package intrange\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n\n\tmapset \"github.com/deckarep/golang-set/v2\"\n)\n\n// IntRange "
},
{
"path": "pkg/intrange/intrange_test.go",
"chars": 5859,
"preview": "//go:build !integration\n// +build !integration\n\npackage intrange\n\nimport (\n\t\"testing\"\n\n\tmapset \"github.com/deckarep/gola"
},
{
"path": "pkg/menus/clean_menu.go",
"chars": 1891,
"preview": "// Clean Build Menu functions\npackage menus\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\n\tmapset \"github.com/deckarep/golang-set/v2"
},
{
"path": "pkg/menus/diff_menu.go",
"chars": 4807,
"preview": "// file dedicated to diff menu\npackage menus\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\tmapset \"github.com/deckarep/"
},
{
"path": "pkg/menus/edit_menu.go",
"chars": 3835,
"preview": "// edit menu\npackage menus\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\tgosrc \"gi"
},
{
"path": "pkg/menus/menu.go",
"chars": 2756,
"preview": "package menus\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/leonelquinteros/gotext\"\n\n\t\"github.com/Jguer/yay/v12/pkg/intrange\"\n\t\"g"
},
{
"path": "pkg/multierror/multierror.go",
"chars": 799,
"preview": "package multierror\n\nimport \"sync\"\n\n// MultiError type handles error accumulation from goroutines.\ntype MultiError struct"
},
{
"path": "pkg/news/.snapshots/TestPrintNewsFeed-all-quiet",
"chars": 840,
"preview": "\u001b[1m\u001b[35m2019-12-20\u001b[0m\u001b[0m \u001b[1mXorg cleanup requires manual intervention\u001b[0m\n\u001b[1m\u001b[35m2020-01-04\u001b[0m\u001b[0m \u001b[1mNow using "
},
{
"path": "pkg/news/.snapshots/TestPrintNewsFeed-all-verbose",
"chars": 7131,
"preview": "\u001b[1m\u001b[35m2019-12-20\u001b[0m\u001b[0m \u001b[1mXorg cleanup requires manual intervention\u001b[0m\nIn the process of Xorg cleanup the update "
},
{
"path": "pkg/news/.snapshots/TestPrintNewsFeed-latest-quiet",
"chars": 199,
"preview": "\u001b[1m\u001b[35m2020-04-13\u001b[0m\u001b[0m \u001b[1mnss>=3.51.1-1 and lib32-nss>=3.51.1-1 updates require manual intervention\u001b[0m\n\u001b[1m\u001b[35m2"
},
{
"path": "pkg/news/.snapshots/TestPrintNewsFeed-latest-quiet-topdown",
"chars": 199,
"preview": "\u001b[1m\u001b[35m2020-04-14\u001b[0m\u001b[0m \u001b[1mzn_poly 0.9.2-2 update requires manual intervention\u001b[0m\n\u001b[1m\u001b[35m2020-04-13\u001b[0m\u001b[0m \u001b[1m"
},
{
"path": "pkg/news/.snapshots/TestPrintNewsFeedSameDay",
"chars": 165,
"preview": "\u001b[1m\u001b[35m2020-04-14\u001b[0m\u001b[0m \u001b[1mzn_poly 0.9.2-2 update requires manual intervention\u001b[0m\nThe zn_poly package prior to ver"
},
{
"path": "pkg/news/news.go",
"chars": 3241,
"preview": "package news\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/xml\"\n\t\"html\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/Jg"
},
{
"path": "pkg/news/news_test.go",
"chars": 16466,
"preview": "//go:build !integration\n// +build !integration\n\npackage news\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\t\"t"
},
{
"path": "pkg/query/aur_warnings.go",
"chars": 2676,
"preview": "package query\n\nimport (\n\t\"strings\"\n\n\t\"github.com/leonelquinteros/gotext\"\n\n\t\"github.com/Jguer/aur\"\n\talpm \"github.com/Jgue"
},
{
"path": "pkg/query/errors.go",
"chars": 577,
"preview": "package query\n\nimport (\n\t\"github.com/leonelquinteros/gotext\"\n)\n\n// ErrAURSearch means that it was not possible to connec"
},
{
"path": "pkg/query/filter.go",
"chars": 796,
"preview": "package query\n\nimport (\n\t\"github.com/leonelquinteros/gotext\"\n\n\t\"github.com/Jguer/yay/v12/pkg/settings/parser\"\n\t\"github.c"
},
{
"path": "pkg/query/metric.go",
"chars": 2344,
"preview": "package query\n\nimport (\n\t\"strings\"\n\n\t\"github.com/adrg/strutil\"\n)\n\nconst minVotes = 30\nconst minPopularity = 0.5\nconst (\n"
},
{
"path": "pkg/query/metric_test.go",
"chars": 1530,
"preview": "//go:build !integration\n// +build !integration\n\npackage query\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert"
},
{
"path": "pkg/query/query_builder.go",
"chars": 8975,
"preview": "package query\n\nimport (\n\t\"cmp\"\n\t\"context\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/Jguer/aur\"\n\talpm \"githu"
},
{
"path": "pkg/query/query_builder_test.go",
"chars": 24437,
"preview": "//go:build !integration\n// +build !integration\n\npackage query\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github"
},
{
"path": "pkg/query/source.go",
"chars": 577,
"preview": "package query\n\nimport (\n\t\"context\"\n\n\t\"github.com/Jguer/aur\"\n\t\"github.com/hashicorp/go-multierror\"\n)\n\n// queryAUR searche"
},
{
"path": "pkg/query/types.go",
"chars": 2892,
"preview": "package query\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/Jguer/aur\"\n\talpm \"github.com/Jguer/dyalpm\"\n\t\"github.com/leonelqu"
},
{
"path": "pkg/query/version_diff.go",
"chars": 1807,
"preview": "package query\n\nimport (\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/Jguer/yay/v12/pkg/text\"\n\n\talpm \"github.com/Jguer/dyalpm\"\n)\n\n"
},
{
"path": "pkg/query/version_diff_test.go",
"chars": 1816,
"preview": "//go:build !integration\n// +build !integration\n\npackage query\n\nimport (\n\t\"testing\"\n\n\t\"github.com/Jguer/yay/v12/pkg/text\""
},
{
"path": "pkg/runtime/pacman.go",
"chars": 1633,
"preview": "package runtime\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/Jguer/yay/v12/pkg/settings/parser\"\n\n\tpacmanconf \"github.com/Morgana"
},
{
"path": "pkg/runtime/pacman_test.go",
"chars": 3115,
"preview": "//go:build !integration\n// +build !integration\n\npackage runtime\n\nimport (\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"testi"
},
{
"path": "pkg/runtime/runtime.go",
"chars": 3823,
"preview": "package runtime\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/leonelquinteros/got"
},
{
"path": "pkg/runtime/runtime_test.go",
"chars": 1229,
"preview": "//go:build !integration\n// +build !integration\n\npackage runtime_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com"
},
{
"path": "pkg/settings/args.go",
"chars": 3878,
"preview": "package settings\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/Jguer/yay/v12/pkg/settings/parser\"\n)\n\nfunc (c *Configurat"
},
{
"path": "pkg/settings/config.go",
"chars": 8941,
"preview": "package settings\n\nimport (\n\t\"bytes\"\n\t_ \"embed\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"g"
},
{
"path": "pkg/settings/config_test.go",
"chars": 8456,
"preview": "//go:build !integration\n// +build !integration\n\npackage settings\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"tes"
},
{
"path": "pkg/settings/dirs.go",
"chars": 2553,
"preview": "package settings\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nconst (\n\tconfigFileName string = \"config.json\" // configFileNam"
},
{
"path": "pkg/settings/dirs_test.go",
"chars": 723,
"preview": "//go:build !integration\n// +build !integration\n\npackage settings\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.c"
},
{
"path": "pkg/settings/errors.go",
"chars": 576,
"preview": "package settings\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/leonelquinteros/gotext\"\n)\n\ntype ErrPrivilegeElevatorNotFound struct {\n\tc"
},
{
"path": "pkg/settings/exe/cmd_builder.go",
"chars": 7546,
"preview": "package exe\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"os/user\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\""
},
{
"path": "pkg/settings/exe/exec.go",
"chars": 1041,
"preview": "package exe\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"syscall\"\n\n\t\"github.com/Jguer/yay/v12/pkg/text\"\n)\n\ntype Run"
},
{
"path": "pkg/settings/exe/mock.go",
"chars": 2955,
"preview": "package exe\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"sync\"\n\n\t\"github.com/Jguer/yay/v12/pkg/settings/parser\"\n)\n\ntype Call"
},
{
"path": "pkg/settings/ini.go",
"chars": 1995,
"preview": "package settings\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"gopkg.in/ini.v1\"\n)\n\n// SystemConfigPath is the path to the s"
},
{
"path": "pkg/settings/ini_test.go",
"chars": 9438,
"preview": "package settings\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretch"
},
{
"path": "pkg/settings/parser/parser.go",
"chars": 12267,
"preview": "package parser\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"maps\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/leonelquinteros/gotext\"\n)\n\ntyp"
},
{
"path": "pkg/settings/parser/parser_test.go",
"chars": 8496,
"preview": "//go:build !integration\n// +build !integration\n\npackage parser\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify"
},
{
"path": "pkg/settings/parser/rebuild_mode.go",
"chars": 199,
"preview": "package parser\n\ntype RebuildMode string\n\nconst (\n\tRebuildModeNo RebuildMode = \"no\"\n\tRebuildModeYes RebuildMode = \"yes"
},
{
"path": "pkg/settings/parser/target_mode.go",
"chars": 273,
"preview": "package parser\n\ntype TargetMode int\n\nconst (\n\tModeAny TargetMode = iota\n\tModeAUR\n\tModeRepo\n)\n\nfunc (mode TargetMode) AtL"
},
{
"path": "pkg/settings/yay.conf",
"chars": 940,
"preview": "# /etc/yay.conf - System-wide yay configuration\n[options]\n\n# AUR Settings\nAurUrl = https://aur.archlinux.org\n#AurRpcUrl "
},
{
"path": "pkg/sync/build/errors.go",
"chars": 1400,
"preview": "package build\n\nimport (\n\t\"errors\"\n\t\"strings\"\n\n\t\"github.com/leonelquinteros/gotext\"\n)\n\nvar ErrInstallRepoPkgs = errors.Ne"
},
{
"path": "pkg/sync/build/installer.go",
"chars": 13771,
"preview": "package build\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"maps\"\n\t\"os\"\n\n\t\"github.com/Jguer/yay/v12/pkg/db\"\n\t\"github.com/Jguer/yay/v12/p"
},
{
"path": "pkg/sync/build/installer_test.go",
"chars": 50452,
"preview": "package build\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/"
},
{
"path": "pkg/sync/build/pkg_archive.go",
"chars": 3917,
"preview": "package build\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/leonelquinteros/gote"
},
{
"path": "pkg/sync/build/pkg_archive_test.go",
"chars": 4799,
"preview": "package build\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stre"
},
{
"path": "pkg/sync/srcinfo/pgp/keys.go",
"chars": 3479,
"preview": "package pgp\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"os/exec\"\n\t\"strings\"\n\n\tgosrc \"github.com/Morganamilo/go-srcinfo\"\n\t\""
},
{
"path": "pkg/sync/srcinfo/pgp/keys_test.go",
"chars": 8873,
"preview": "//go:build !integration\n// +build !integration\n\npackage pgp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"sort\"\n\t"
},
{
"path": "pkg/sync/srcinfo/pgp/testdata/11E521D646982372EB577A1F8F0871F202119294",
"chars": 4516,
"preview": "mQENBFNoLTkBCADXH3jKqmlGe+g54RIJ73YbqtSn1YCuZwSjdhG1nsvpglp8CZSd3ZwAUBRA\nrRttrWNFMQNNBBt/10JKCw5MTEYzSeDgoVXmrOKcWjC7JGK"
},
{
"path": "pkg/sync/srcinfo/pgp/testdata/487EACC08557AD082088DABA1EB2638FF56C0C53",
"chars": 16675,
"preview": "mQENBE4GMa8BCADKNWK/JmB7qzU3Dfw+/9iDNvGlpNvIuUuNY20RKjrS+91rdSV2EtrDD/1A\nd55a17BdzcNcaYf1PTAljfoB0KyTYjYuyE0S9YxW0m5Em3m"
},
{
"path": "pkg/sync/srcinfo/pgp/testdata/647F28654894E3BD457199BE38DBBDC86092693E",
"chars": 91346,
"preview": "mQINBE58tdUBEADY5iQsoL4k8l06dNt+uP2lH8IPi14M51/tOHsW1ZNc8Iok0stH+uA8w0Lp\nN97UgNhsvXFEkIK2JjLalasUTiUoIeeTshD9t+ekFBx5a9S"
},
{
"path": "pkg/sync/srcinfo/pgp/testdata/A314827C4E4250A204CE6E13284FC34C8E4B1A25",
"chars": 16225,
"preview": "mQINBE3BJdkBEADYKuL5YdWRXfkhWFlc3yaBed/f5phxTLGcfypX8TntSsM0d3WQ/un6+9y9\n3JS3UzA4RAvjh4QXAjTQ3Ig+uwUuUL9itODPwPJHv4+rPct"
},
{
"path": "pkg/sync/srcinfo/pgp/testdata/ABAF11C65A2970B130ABE3C479BE3E4300411886",
"chars": 102377,
"preview": "mQENBE55CJIBCACkn+aOLmsaq1ejUcXCAOXkO3w7eiLqjR/ziTL2KZ30p7bxP8cTUXvfM7fw\nE7EnqCCkji25x2xsoKXB8AlUswIEYUFCOupj2BOsVmJ/rKZ"
},
{
"path": "pkg/sync/srcinfo/pgp/testdata/B6C8F98282B944E3B0D5C2530FC3042E345AD05D",
"chars": 6171,
"preview": "mQINBFS+1SABEACnmkESkY7eZq0GhDjbkWpKmURGk9+ycsfAhA44NqUvf4tk1GPM5SkJ/fYe\ndYZJaDVhIp98fHgucD0O+vjOzghtgwtITusYjiPHPFBd/MN"
},
{
"path": "pkg/sync/srcinfo/pgp/testdata/C52048C0C0748FEE227D47A2702353E0F7E48EDB",
"chars": 58025,
"preview": "mQGiBD/4r7IRBADFuacEqf9fye+NQSm7xjNP705aq75VrUd2hJyPmSiFUIyQEfc44GQXGdFg\n+/Apq4iq/50/8pR8YXOKwP5OE69emEp7IxjST41orGUk5Zw"
},
{
"path": "pkg/sync/srcinfo/service.go",
"chars": 3380,
"preview": "package srcinfo\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"path/filepath\"\n\n\tgosrc \"github.com/Morganamilo/go-srcinfo\"\n\t\"git"
},
{
"path": "pkg/sync/srcinfo/service_test.go",
"chars": 2896,
"preview": "package srcinfo\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n\n\tgosrc \"github.com/Morganamilo/go-srcinfo\"\n\n\t\"github.c"
},
{
"path": "pkg/sync/sync.go",
"chars": 4062,
"preview": "package sync\n\nimport (\n\t\"context\"\n\n\t\"github.com/Jguer/yay/v12/pkg/completion\"\n\t\"github.com/Jguer/yay/v12/pkg/db\"\n\t\"githu"
},
{
"path": "pkg/sync/workdir/aur_source.go",
"chars": 3021,
"preview": "package workdir\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"runtime\"\n\t\"sync\"\n\n\tmapset \"github.com/deckarep/golang-set/v2\"\n\t\"github.com"
},
{
"path": "pkg/sync/workdir/aur_source_test.go",
"chars": 5379,
"preview": "//go:build !integration\n// +build !integration\n\npackage workdir\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"path/filepath\"\n"
},
{
"path": "pkg/sync/workdir/clean.go",
"chars": 1582,
"preview": "package workdir\n\nimport (\n\t\"context\"\n\n\t\"github.com/leonelquinteros/gotext\"\n\n\t\"github.com/Jguer/yay/v12/pkg/runtime\"\n\t\"gi"
},
{
"path": "pkg/sync/workdir/merge.go",
"chars": 865,
"preview": "package workdir\n\nimport (\n\t\"context\"\n\t\"errors\"\n\n\t\"github.com/leonelquinteros/gotext\"\n\n\t\"github.com/Jguer/yay/v12/pkg/set"
},
{
"path": "pkg/sync/workdir/preparer.go",
"chars": 6842,
"preview": "package workdir\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Jguer/yay/v12/pkg/db\"\n"
},
{
"path": "pkg/sync/workdir/preparer_test.go",
"chars": 1440,
"preview": "//go:build !integration\n// +build !integration\n\npackage workdir\n\nimport (\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stre"
},
{
"path": "pkg/text/color.go",
"chars": 1287,
"preview": "package text\n\nimport \"fmt\"\n\nconst (\n\tredCode = \"\\x1b[31m\"\n\tgreenCode = \"\\x1b[32m\"\n\tyellowCode = \"\\x1b[33m\"\n\tblueC"
},
{
"path": "pkg/text/convert.go",
"chars": 401,
"preview": "package text\n\nimport (\n\t\"fmt\"\n)\n\n// Human method returns results in human readable format.\nfunc Human(size int64) string"
},
{
"path": "pkg/text/errors.go",
"chars": 172,
"preview": "package text\n\nimport \"github.com/leonelquinteros/gotext\"\n\ntype ErrInputOverflow struct{}\n\nfunc (e ErrInputOverflow) Erro"
},
{
"path": "pkg/text/input.go",
"chars": 1728,
"preview": "package text\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/leonelquinteros/gotext\"\n)\n\nfu"
},
{
"path": "pkg/text/service.go",
"chars": 1964,
"preview": "package text\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\nconst (\n\tarrow = \"==>\"\n\tsmallArrow = \" ->\"\n\topSymbol = \"::\"\n)\n\ntype Logger"
},
{
"path": "pkg/text/text.go",
"chars": 2082,
"preview": "package text\n\nimport (\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst (\n\tyDefault = \"y\"\n\tnDefault = \"n\"\n)\n\n// SplitDBFromName split apar"
},
{
"path": "pkg/text/text_test.go",
"chars": 6707,
"preview": "//go:build !integration\n// +build !integration\n\npackage text\n\nimport (\n\t\"io\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"gith"
},
{
"path": "pkg/text/time.go",
"chars": 383,
"preview": "package text\n\nimport \"time\"\n\n// Formats a unix timestamp to ISO 8601 date (yyyy-mm-dd).\nfunc FormatTime(i int) string {\n"
},
{
"path": "pkg/upgrade/.snapshots/Test_upAUR-No_Updates",
"chars": 100,
"preview": "\u001b[1m\u001b[33m ->\u001b[0m\u001b[0m \u001b[36mignored\u001b[0m: ignoring package upgrade (\u001b[31m1.0.0\u001b[0m => \u001b[32m2.0.0\u001b[0m)\n\n"
},
{
"path": "pkg/upgrade/.snapshots/Test_upAUR-Simple_Update",
"chars": 1,
"preview": "\n"
},
{
"path": "pkg/upgrade/.snapshots/Test_upAUR-Time_Update",
"chars": 1,
"preview": "\n"
},
{
"path": "pkg/upgrade/service.go",
"chars": 9409,
"preview": "package upgrade\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/Jguer/aur\"\n\talpm \"github.com/Jguer/dyalpm\"\n"
},
{
"path": "pkg/upgrade/service_test.go",
"chars": 24894,
"preview": "//go:build !integration\n// +build !integration\n\npackage upgrade\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n"
},
{
"path": "pkg/upgrade/sources.go",
"chars": 2341,
"preview": "package upgrade\n\nimport (\n\t\"context\"\n\n\t\"github.com/leonelquinteros/gotext\"\n\n\t\"github.com/Jguer/yay/v12/pkg/db\"\n\t\"github."
},
{
"path": "pkg/upgrade/sources_test.go",
"chars": 6732,
"preview": "//go:build !integration\n// +build !integration\n\npackage upgrade\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n"
},
{
"path": "pkg/upgrade/upgrade.go",
"chars": 3289,
"preview": "package upgrade\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/Jguer/yay/v12/pkg/db\"\n\t\"github.com/Jguer/yay/v12/pkg/query\"\n\t\""
},
{
"path": "pkg/upgrade/upgrade_test.go",
"chars": 2273,
"preview": "//go:build !integration\n// +build !integration\n\npackage upgrade\n\nimport (\n\t\"testing\"\n\n\t\"github.com/Jguer/yay/v12/pkg/que"
},
{
"path": "pkg/vcs/.snapshots/TestInfoStore_Update-simple",
"chars": 165,
"preview": "{\n\t\"hello\": {\n\t\t\"github.com/jguer/yay.git\": {\n\t\t\t\"protocols\": [\n\t\t\t\t\"git\"\n\t\t\t],\n\t\t\t\"branch\": \"master\",\n\t\t\t\"sha\": \"aaaaaa"
},
{
"path": "pkg/vcs/mock.go",
"chars": 634,
"preview": "package vcs\n\nimport (\n\t\"context\"\n\t\"slices\"\n\n\talpm \"github.com/Jguer/dyalpm\"\n\tgosrc \"github.com/Morganamilo/go-srcinfo\"\n)"
},
{
"path": "pkg/vcs/vcs.go",
"chars": 7397,
"preview": "package vcs\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\""
},
{
"path": "pkg/vcs/vcs_test.go",
"chars": 13360,
"preview": "//go:build !integration\n// +build !integration\n\npackage vcs\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n"
},
{
"path": "po/ca.po",
"chars": 18873,
"preview": "# \n# Translators:\n# Davidmp <medipas@gmail.com>, 2025\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: Davidmp <medipas@gmail.com"
},
{
"path": "po/ca_ES.po",
"chars": 18887,
"preview": "# \n# Translators:\n# Davidmp <medipas@gmail.com>, 2025\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: Davidmp <medipas@gmail.com"
},
{
"path": "po/cs.po",
"chars": 18404,
"preview": "#\n# Translators:\n# Fjuro Fjuro, 2022\n# a30a45d5047eb877c4dc397ded846f36_1de9be1, 2023\n# Matyáš Černý, 2023\n# walken, 202"
},
{
"path": "po/de.po",
"chars": 19232,
"preview": "# \n# Translators:\n# Julian Neupert <julian.neupert@gmail.com>, 2021\n# Chris Boesch, 2021\n# Oliver Conzen, 2021\n# J G, 20"
},
{
"path": "po/en.po",
"chars": 13268,
"preview": "msgid \"\"\nmsgstr \"\"\n\"Plural-Forms: nplurals=2; plural=(n != 1);\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Type: text/plain; chars"
},
{
"path": "po/es.po",
"chars": 19189,
"preview": "# \n# Translators:\n# J G, 2021\n# Ivan Garcia, 2021\n# Percy De La Rosa, 2022\n# Brighton Saldaña, 2022\n# Antonio Alvarado-H"
},
{
"path": "po/eu.po",
"chars": 20671,
"preview": "#\n# Translators:\n# J G <transifex@jguer.space>, 2021\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: PACKAGE VERSION\\n\"\n\"PO-Re"
},
{
"path": "po/fi.po",
"chars": 19033,
"preview": "# Translators:\n# Joonas Miettinen, 2026\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: Joonas Miettinen, 2026\\n\"\n\"Language-Team"
},
{
"path": "po/fr.po",
"chars": 19501,
"preview": "# Translators:\n# Benjamin Chenebault, 2023\n# anthony tonitch <d.tonitch@gmail.com>, 2024\n# Edgar Fournival, 2024\n# J G, "
},
{
"path": "po/fr_FR.po",
"chars": 19502,
"preview": "# Translators:\n# J G, 2021\n# Mr Strik3, 2022\n# Maxime Demolin, 2023\n# Mathias Brugger, 2023\n# Sylvain Bx, 2023\n# Bertran"
},
{
"path": "po/he.po",
"chars": 17391,
"preview": "#\n# Translators:\n# lavi landa, 2024\n# Yaron Shahrabani <sh.yaron@gmail.com>, 2024\n#\nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator:"
},
{
"path": "po/he_IL.po",
"chars": 17403,
"preview": "#\n# Translators:\n# Yaron Shahrabani <sh.yaron@gmail.com>, 2024\n# lavi landa, 2024\n#\nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator:"
},
{
"path": "po/hu.po",
"chars": 19119,
"preview": "# \n# Translators:\n# Szigeti Péter, 2021\n# summoner <summoner@disroot.org>, 2025\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: "
},
{
"path": "po/id.po",
"chars": 18856,
"preview": "# \n# Translators:\n# Ludovico, 2022\n# Alif Fathur, 2024\n# Linerly <linerly@proton.me>, 2024\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-T"
},
{
"path": "po/it_IT.po",
"chars": 19368,
"preview": "# \n# Translators:\n# Cardellino, 2021\n# Giulio Terigi, 2022\n# Simone Dotto <simonedotto@protonmail.com>, 2022\n# jheitz223"
},
{
"path": "po/ja.po",
"chars": 18330,
"preview": "#\n# Translators:\n# J G <transifex@jguer.space>, 2021\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: PACKAGE VERSION\\n\"\n\"PO-Re"
},
{
"path": "po/ko.po",
"chars": 16260,
"preview": "# \n# Translators:\n# J G, 2021\n# JungHee Lee <daemul72@gmail.com>, 2025\n# \nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: JungHee L"
},
{
"path": "po/nl.po",
"chars": 19346,
"preview": "# \n# Translators:\n# Jonathan van der Steege <jonakeys@hotmail.com>, 2023\n# Loek Le Blansch <loek@pipeframe.xyz>, 2023\n# "
},
{
"path": "po/pl.po",
"chars": 19105,
"preview": "# \n# Translators:\n# J G, 2021\n# Oskar <me@medzik.dev>, 2022\n# A_Salata, 2024\n# SMT Broadcast, 2024\n# Chair n, 2024\n# Paw"
},
{
"path": "po/pl_PL.po",
"chars": 19105,
"preview": "# \n# Translators:\n# J G, 2021\n# Oskar <me@medzik.dev>, 2022\n# A_Salata, 2024\n# SMT Broadcast, 2024\n# Chair n, 2024\n# Paw"
},
{
"path": "po/pt.po",
"chars": 18736,
"preview": "# \n# Translators:\n# J G, 2021\n# Eduardo Ervideira, 2023\n# Hugo Carvalho <hugokarvalho@hotmail.com>, 2023\n# Matheus Caleg"
},
{
"path": "po/pt_BR.po",
"chars": 19043,
"preview": "# \n# Translators:\n# J G, 2021\n# Otto Micheletti <michelettiotto@gmail.com>, 2021\n# Harrison Ferreira, 2022\n# Zisa, 2022\n"
},
{
"path": "po/ru.po",
"chars": 18800,
"preview": "# \n# Translators:\n# Vladislav Zenkov, 2022\n# Kira Malinova, 2023\n# Victor Golovanenko <drygdryg2014@yandex.ru>, 2023\n# D"
},
{
"path": "po/ru_RU.po",
"chars": 18938,
"preview": "# \n# Translators:\n# J G, 2021\n# makvasm, 2021\n# antsif.a, 2022\n# Demir Yerli, 2022\n# Антон Карасев <uselessfire@gmail.co"
},
{
"path": "po/sk.po",
"chars": 18655,
"preview": "#\n# Translators:\n# Matej Mrenica, 2022\n# Peter Cyprich, 2024\n# Michal Fusatý, 2024\n#\nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator"
},
{
"path": "po/sv.po",
"chars": 18514,
"preview": "# \n# Translators:\n# J G, 2021\n# August Wikerfors, 2023\n# Luna Jernberg <droidbittin@gmail.com>, 2026\n# \nmsgid \"\"\nmsgstr "
},
{
"path": "po/tr.po",
"chars": 19601,
"preview": "#\n# Translators:\n# Ahmet Arda Kavakcı, 2022\n# Mehmet Özgür Bayhan <mozgurbayhan@gmail.com>, 2023\n# can avar, 2023\n# yiği"
},
{
"path": "po/uk.po",
"chars": 18673,
"preview": "#\n# Translators:\n# Volodymyr Markiv <vov4uk21@gmail.com>, 2021\n# Igor Lukyanov, 2023\n# Andrii Lytvyn, 2023\n# null null, "
},
{
"path": "po/vi.po",
"chars": 18552,
"preview": "# \n# Translators:\n# Tín Nguyễn, 2022\n# Katoji Rikito, 2023\n# Nguyễn Tri Phương, 2024\n# Phong Phạm Thanh, 2025\n# Nguyễn H"
},
{
"path": "po/vi_VN.po",
"chars": 18302,
"preview": "# \n# Translators:\n# su va, 2023\n# Tín Nguyễn, 2024\n# Nguyễn Tri Phương, 2024\n# Phong Phạm Thanh, 2025\n# Minh Nguyen <mr."
},
{
"path": "po/zh_CN.po",
"chars": 15665,
"preview": "# \n# Translators:\n# J G, 2022\n# Moon Xanadu <xmoonox@gmail.com>, 2023\n# kanna 5, 2023\n# Songer Hy, 2023\n# Celestially H."
},
{
"path": "po/zh_TW.po",
"chars": 15637,
"preview": "# \n# Translators:\n# J G, 2022\n# lakejason0 <sunliyuan200402@outlook.com>, 2023\n# Oliver Tzeng, 2025\n# zangmen hsu(neko_0"
},
{
"path": "print.go",
"chars": 8354,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unicode\"\n\n\taur \"github.com/Jguer"
},
{
"path": "print_test.go",
"chars": 7520,
"preview": "//go:build !integration\n// +build !integration\n\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\t\"testin"
},
{
"path": "query.go",
"chars": 7120,
"preview": "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"path/filepath\"\n\n\taur \"github.com/Jguer/aur\"\n\talpm \"github.com/Jguer/"
}
]
// ... and 14 more files (download for full content)
About this extraction
This page contains the full source code of the Jguer/yay GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 214 files (1.7 MB), approximately 669.7k tokens, and a symbol index with 890 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.