summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlad Wenter2022-04-28 17:21:37 +0200
committerAlad Wenter2022-04-28 17:21:37 +0200
commit7fd0a0f4cdf7ad041080b28ab74ba83e30ad41b1 (patch)
tree105fbf84ed596afd01021667c8535730adcdea04
parentc82ab162285526d91bde1964c1a6398ba2462987 (diff)
downloadaur-7fd0a0f4cdf7ad041080b28ab74ba83e30ad41b1.tar.gz
aurutils: 9.6-3
Do not patch changelog (merge conflict between 9.x and 10)
-rw-r--r--.SRCINFO10
-rw-r--r--0001-sync-tsort-exit.patch27
-rw-r--r--0002-sync-filter-deps.patch91
-rw-r--r--0003-fetch-git-checkout.patch33
-rw-r--r--PKGBUILD12
5 files changed, 162 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3829511d3b47..8816494a7ba3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = aurutils
pkgdesc = helper tools for the arch user repository
pkgver = 9.6
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/AladW/aurutils
install = aurutils.install
changelog = aurutils.changelog
@@ -18,12 +18,12 @@ pkgbase = aurutils
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::https://github.com/AladW/aurutils/commit/6f56ae7e4df06a0142d8970275986754041955c4.patch
- source = 0002-sync-filter-deps.patch::https://github.com/AladW/aurutils/commit/3c818fccc3b431d7aea4198e82cd1ccda1e43e5c.patch
- source = 0003-fetch-git-checkout.patch::https://github.com/AladW/aurutils/commit/c9e57188b5bb356b2373bc087474e2e68872505d.patch
+ source = 0001-sync-tsort-exit.patch
+ source = 0002-sync-filter-deps.patch
+ source = 0003-fetch-git-checkout.patch
sha256sums = 825d6ab3d66faf84ee3856e677de138dcdb3af2a5c38164f69601ee0a4e96954
sha256sums = 2f0e039c6544dc2204dbb25f15f2c3fcefbc742a196fedb60925b7dc3311665e
- sha256sums = 695d1b77c67ac87304445b593a2d6b0600adf076d81ed007af3f1c26ea9a8539
+ sha256sums = a65dace12d686d8a77380af9875af5633c2fd12e6c6ed8802a202e22861b77c0
sha256sums = cca4ea1456d1cd8cde333d7e60c0749c9bc2c78b4f4b3eda751432cc3555aa65
pkgname = aurutils
diff --git a/0001-sync-tsort-exit.patch b/0001-sync-tsort-exit.patch
new file mode 100644
index 000000000000..d15d8a1511e7
--- /dev/null
+++ b/0001-sync-tsort-exit.patch
@@ -0,0 +1,27 @@
+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
diff --git a/0002-sync-filter-deps.patch b/0002-sync-filter-deps.patch
new file mode 100644
index 000000000000..11e322fb7928
--- /dev/null
+++ b/0002-sync-filter-deps.patch
@@ -0,0 +1,91 @@
+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
+
diff --git a/0003-fetch-git-checkout.patch b/0003-fetch-git-checkout.patch
new file mode 100644
index 000000000000..86a3efe4cdaa
--- /dev/null
+++ b/0003-fetch-git-checkout.patch
@@ -0,0 +1,33 @@
+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
+
diff --git a/PKGBUILD b/PKGBUILD
index 92607c1a4ca7..fbed1187eccc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,21 +2,21 @@
# Co-Maintainer: Cedric Girard <cgirard [dot] archlinux [at] valinor [dot] fr>
pkgname=aurutils
pkgver=9.6
-pkgrel=2
+pkgrel=3
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::$url/commit/6f56ae7e4df06a0142d8970275986754041955c4.patch"
- "0002-sync-filter-deps.patch::$url/commit/3c818fccc3b431d7aea4198e82cd1ccda1e43e5c.patch"
- "0003-fetch-git-checkout.patch::$url/commit/c9e57188b5bb356b2373bc087474e2e68872505d.patch")
+_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[@]}")
changelog=aurutils.changelog
install=aurutils.install
sha256sums=('825d6ab3d66faf84ee3856e677de138dcdb3af2a5c38164f69601ee0a4e96954'
'2f0e039c6544dc2204dbb25f15f2c3fcefbc742a196fedb60925b7dc3311665e'
- '695d1b77c67ac87304445b593a2d6b0600adf076d81ed007af3f1c26ea9a8539'
+ 'a65dace12d686d8a77380af9875af5633c2fd12e6c6ed8802a202e22861b77c0'
'cca4ea1456d1cd8cde333d7e60c0749c9bc2c78b4f4b3eda751432cc3555aa65')
depends=('git' 'jq' 'pacutils' 'curl' 'expect')
optdepends=('bash-completion: bash completion'
@@ -28,7 +28,7 @@ optdepends=('bash-completion: bash completion'
prepare() {
cd "$pkgname-$pkgver"
for _b in "${_backports[@]}"; do
- git apply "$srcdir/${_b%%::*}"
+ patch -p1 < "$srcdir/$_b"
done
}