aurutils: 10b

This commit is contained in:
Alad Wenter 2022-07-10 14:44:52 +02:00
parent 7fd0a0f4cd
commit eed5f3d396
6 changed files with 64 additions and 181 deletions

View File

@ -1,7 +1,7 @@
pkgbase = aurutils
pkgdesc = helper tools for the arch user repository
pkgver = 9.6
pkgrel = 3
pkgver = 10b
pkgrel = 1
url = https://github.com/AladW/aurutils
install = aurutils.install
changelog = aurutils.changelog
@ -11,19 +11,12 @@ pkgbase = aurutils
depends = jq
depends = pacutils
depends = curl
depends = expect
optdepends = bash-completion: bash completion
optdepends = zsh: zsh completion
optdepends = devtools: aur-chroot
optdepends = vifm: default pager
optdepends = ninja: aur-sync ninja support
source = aurutils-9.6.tar.gz::https://github.com/AladW/aurutils/archive/refs/tags/9.6.tar.gz
source = 0001-sync-tsort-exit.patch
source = 0002-sync-filter-deps.patch
source = 0003-fetch-git-checkout.patch
sha256sums = 825d6ab3d66faf84ee3856e677de138dcdb3af2a5c38164f69601ee0a4e96954
sha256sums = 2f0e039c6544dc2204dbb25f15f2c3fcefbc742a196fedb60925b7dc3311665e
sha256sums = a65dace12d686d8a77380af9875af5633c2fd12e6c6ed8802a202e22861b77c0
sha256sums = cca4ea1456d1cd8cde333d7e60c0749c9bc2c78b4f4b3eda751432cc3555aa65
source = aurutils-10b.tar.gz::https://github.com/AladW/aurutils/archive/refs/tags/10b.tar.gz
sha256sums = f66cdb98149365ec520003875762dca527c28d75ea7744a6cfe0a9aa8b94c806
pkgname = aurutils

View File

@ -1,27 +0,0 @@
From 6f56ae7e4df06a0142d8970275986754041955c4 Mon Sep 17 00:00:00 2001
From: Alad Wenter <alad@archlinux.org>
Date: Thu, 21 Apr 2022 19:11:27 +0200
Subject: [PATCH] sync: preserve tsort exit status
Regression in commit 01af4500d77ac1bce6105089603051b4ad554c92
---
lib/aur-sync | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/aur-sync b/lib/aur-sync
index f2cf93d07..248a0565e 100755
--- a/lib/aur-sync
+++ b/lib/aur-sync
@@ -355,6 +355,12 @@ cut -f1-3 depends | tr_ver 2 | select_ignores 2 filter - | lib32 - >graph_0
# (e.g. sort -u) with checks for cycles done at build-time.
select_pkgbase graph_0 graph_0 | tee graph | tsort | tac >queue
+# XXX: preserve tsort exit status
+if (( PIPESTATUS[2] )); then
+ error '%s: dependency cycle detected' "$argv0"
+ exit 22
+fi
+
if [[ -s queue ]]; then
cd_safe "$AURDEST"
else

View File

@ -1,91 +0,0 @@
From 3c818fccc3b431d7aea4198e82cd1ccda1e43e5c Mon Sep 17 00:00:00 2001
From: Alad Wenter <alad@archlinux.org>
Date: Thu, 28 Apr 2022 14:44:28 +0200
Subject: [PATCH] sync: filter dependency graph by pkgname, not depends
Before filtering, the dependency graph is in the format:
$pkgname $depends $pkgbase
Since revision 01af4500d77ac1bce6105089603051b4ad554c92, this graph is
filtered (e.g. by packages already in the local repository) by $depends.
In some cases, this does not filter all targets.
For example, when uprading r-cli and r-testthat, aur-sync would build 7
targets instead of 2:
# cut -f1-3 $tmp/depends
...
r-tibble r-vctrs r-tibble
r-pillar r-vctrs r-pillar
r-vctrs r-vctrs r-vctrs
r-vctrs r r-vctrs
r-vctrs r-cli r-vctrs
r-vctrs r-glue r-vctrs
r-vctrs r-rlang r-vctrs
...
# after filtering r-vctrs from $2
# r-vctrs is still a target!
...
r-vctrs r r-vctrs
r-vctrs r-cli r-vctrs
r-vctrs r-glue r-vctrs
r-vctrs r-rlang r-vctrs
...
---
lib/aur-sync | 16 ++++++++--------
makepkg/aurutils.changelog | 3 ++-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/lib/aur-sync b/lib/aur-sync
index 6bb0d5559..6d3e93a4e 100755
--- a/lib/aur-sync
+++ b/lib/aur-sync
@@ -44,21 +44,21 @@ select_pkgbase() {
# argv[1]: $1 pkgname (possibly empty, #910)
# argv[2]: $1 pkgname $2 pkgver
select_ignores() {
- awk -v target="$1" 'ARGV[1] == FILENAME {
+ awk 'ARGV[1] == FILENAME {
map[$1] = 1
next
}
- !($target in map) {
+ !($1 in map) {
print
- }' "${@:2}"
+ }' "$@"
}
# argv[1]: $1 pkgname $2 depends[<>=]
tr_ver() {
- awk -v target="$1" '{
- sub(/[<>=].*/, "", $target)
+ awk '{
+ sub(/[<>=].*/, "", $2)
print
- }' "${@:2}"
+ }' "$@"
}
complement() {
@@ -285,7 +285,7 @@ fi >&2
# db_info: $1 pkgname $2 pkgver
( set -o pipefail
- aur repo "${repo_args[@]}" --list -d "$db_name" -r "$db_root" | select_ignores 1 igni -
+ aur repo "${repo_args[@]}" --list -d "$db_name" -r "$db_root" | select_ignores igni -
) >db_info
{ if (( $# )); then
@@ -344,7 +344,7 @@ cut -f2,5 --complement depends | sort -u >pkginfo
} >filter
# $1 pkgname $2 depends $3 pkgbase, filter by $2 (depends and self)
-cut -f1-3 depends | tr_ver 2 | select_ignores 2 filter - | lib32 - >graph_0
+cut -f1-3 depends | tr_ver | select_ignores filter - | lib32 - >graph_0
# XXX a flat file is needed for aur-{graph,fetch,view}. `ninja` requires the
# build files to be present before dependency resolution (with `ninja -n`) can

View File

@ -1,33 +0,0 @@
From c9e57188b5bb356b2373bc087474e2e68872505d Mon Sep 17 00:00:00 2001
From: Alad Wenter <alad@archlinux.org>
Date: Thu, 28 Apr 2022 15:16:31 +0200
Subject: [PATCH] fetch: use git-checkout instead of git-merge for empty
working tree
---
lib/aur-fetch | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/aur-fetch b/lib/aur-fetch
index a21a8a130..104be7794 100755
--- a/lib/aur-fetch
+++ b/lib/aur-fetch
@@ -147,16 +147,12 @@ fi | while read -r pkg; do
results 'fetch' "${prev_head:-0}" "$fetch_head" "$PWD/$pkg" "$results_file"
fi
else
+ error '%s: %s: failed to %s repository' "$argv0" "$pkg" fetch
exit 1
fi
- # If the index has no commits, merge from upstream and move to the next package.
if [[ ! $prev_head ]]; then
- git merge 'origin/master'
-
- if [[ -v results_file ]]; then
- results 'merge' '0' "$fetch_head" "$PWD/$pkg" "$results_file"
- fi
+ git checkout 'master'
continue
fi

View File

@ -1,37 +1,23 @@
# Maintainer: Alad Wenter <https://github.com/AladW>
# Co-Maintainer: Cedric Girard <cgirard [dot] archlinux [at] valinor [dot] fr>
pkgname=aurutils
pkgver=9.6
pkgrel=3
pkgver=10b
pkgrel=1
pkgdesc='helper tools for the arch user repository'
url='https://github.com/AladW/aurutils'
arch=('any')
license=('custom:ISC')
_backports=("0001-sync-tsort-exit.patch"
"0002-sync-filter-deps.patch"
"0003-fetch-git-checkout.patch")
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz"
"${_backports[@]}")
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
changelog=aurutils.changelog
install=aurutils.install
sha256sums=('825d6ab3d66faf84ee3856e677de138dcdb3af2a5c38164f69601ee0a4e96954'
'2f0e039c6544dc2204dbb25f15f2c3fcefbc742a196fedb60925b7dc3311665e'
'a65dace12d686d8a77380af9875af5633c2fd12e6c6ed8802a202e22861b77c0'
'cca4ea1456d1cd8cde333d7e60c0749c9bc2c78b4f4b3eda751432cc3555aa65')
depends=('git' 'jq' 'pacutils' 'curl' 'expect')
sha256sums=('f66cdb98149365ec520003875762dca527c28d75ea7744a6cfe0a9aa8b94c806')
depends=('git' 'jq' 'pacutils' 'curl')
optdepends=('bash-completion: bash completion'
'zsh: zsh completion'
'devtools: aur-chroot'
'vifm: default pager'
'ninja: aur-sync ninja support')
prepare() {
cd "$pkgname-$pkgver"
for _b in "${_backports[@]}"; do
patch -p1 < "$srcdir/$_b"
done
}
build() {
cd "$pkgname-$pkgver"
make AURUTILS_VERSION="$pkgver"

View File

@ -1,3 +1,58 @@
## 10
* `aur`
+ support environment files (`$AUR_ENV`, defaults to `$XDG_CONFIG_HOME/aurutils/env`)
+ add `--env`
* `aur-build`
+ use `AUR_PACMAN_AUTH` as elevation command (prior: `PACMAN_AUTH`)
+ use `$PWD` as default value for `$LOGDEST`
+ bug fixes for gpg signing (`--sign`)
* `aur-chroot`
+ use `AUR_PACMAN_AUTH` as elevation command (prior: `PACMAN_AUTH`)
* `aur-fetch`
+ `--sync=auto`: run `git-merge` instead of `git-reset`
- add `--ff`, `--ff-only`, `--no-ff`, `--no-commit` options
- fix a bug where setting `aurutils.rebase` affected unrelated targets
- set default author for merge commits to `aurutils@localhost`
+ `--sync=auto` now preserves local changes by default
- `--discard` (`-f`) resets the branch on new upstream commits
+ add `--reset`, `--rebase`, `--auto` (`--sync=reset`, `--sync=rebase`, `--sync=auto`)
+ support multiple branches, with commits merged from `origin/master`
* `aur-pkglist`
+ output is now independent of command-line argument order
+ deprecate `-I`, `-S`, `-u`
- renamed to: `-i` (`--info`), `-s` (`--search`) `-q` (`--quiet`)
+ deprecate `-J` (`--json`)
- behaves like `--plain`, remove pretty-printing with `jq`
+ add `--systime`
* `aur-repo`
+ `-q` now applies to `--list` and `--upgrades`
+ add `--list-attr`
+ deprecate `--status-file`
* `aur-search`
+ add `--color` (`auto`, `always`, `none`)
* `aur-srcver`
+ remove `-E`, `--env` (deprecated in v8)
* `aur-sync`
+ use pkgspec `<REPOSITORY>/<PACKAGE>` format for `--ignore-file`
- support for sections (introduced with v6.3) is removed (#880)
- <PACKAGE> ignores apply to all local repositories
+ add `--rebase`, `--reset` options for `aur-fetch`
+ exit 22 on dependency cycles (v7 regression)
+ filter dependency graph by pkgname, not depends (v7 regression)
+ store `build.ninja` files in `$XDG_RUNTIME_DIR/aurutils`
* `completions`
+ major overhaul of zsh completions (#990)
## 9.6
* `aur-pkglist`