summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-06-03 15:20:28 +0200
committerErich Eckner <git@eckner.net>2020-06-03 15:20:28 +0200
commit99966f46fd3a3b76de0c52d157e771817e8275d1 (patch)
treeff72415e45584238df89cd05804468d25a2fec6d
parent3e1f16897f9a0aae2a7a64f49cbfa3140ced2216 (diff)
downloadarchlinuxewe-99966f46fd3a3b76de0c52d157e771817e8275d1.tar.xz
bumpPkgrel: update _pinned_dependencies, too
-rwxr-xr-xbumpPkgrel51
1 files changed, 50 insertions, 1 deletions
diff --git a/bumpPkgrel b/bumpPkgrel
index 110cf7833..e0b187189 100755
--- a/bumpPkgrel
+++ b/bumpPkgrel
@@ -19,10 +19,59 @@ if [ $# -eq 1 ]; then
pkg="${1%/}"
cd "${pkg}"
eval "$(
- grep '^pkgrel=' 'PKGBUILD'
+ sed -n '
+ /^pkgrel=/p
+ /^_pinned_dependencies=(.*)/p
+ /^_pinned_dependencies=([^)]*$/,/)/p
+ ' 'PKGBUILD'
)"
+ mapfile -t _pinned_dependencies < <(
+ printf '%s\n' "${_pinned_dependencies[@]}" \
+ | sed -n '
+ s/=.*$//
+ /^[^<=>]\+$/ p
+ ' \
+ | sort -u \
+ | join -1 1 -2 2 -o 1.1,2.1 - <(
+ find /var/lib/pacman/sync/ -name '*.db' \
+ -not -exec tar -Oxzf {} --wildcards '*/desc' \; \
+ -not -exec tar -OxJf {} --wildcards '*/desc' \; \
+ -not -exec tar -Oxjf {} --wildcards '*/desc' \; \
+ -not -exec tar -Oxf {} --wildcards '*/desc' \; \
+ 2>/dev/null \
+ | sed -n '
+ /^%\(NAME\|VERSION\)%$/ {
+ N
+ s/\n/ /
+ p
+ }
+ ' \
+ | sed -n '
+ /^%NAME%/ {
+ N
+ s/^%NAME% \(\S\+\)\n%VERSION% \(\S\+\)-\S\+$/\2 \1/
+ T
+ p
+ }
+ ' \
+ | sort -k2,2 -k1Vr,1 \
+ | uniq -f1
+ ) \
+ | awk '{print $1 "=" $2}'
+ )
sed -i '
s@^\(pkgrel=\)\('"'"'\?\)[0-9]\+\2$@\1'"$((pkgrel+1))"'@
+ /^_pinned_dependencies=(/ {
+ :a
+ /)/ {
+ s@.*@_pinned_dependencies=(\n'"$(printf ' '"'"'%s'"'"'\\n' "${_pinned_dependencies[@]}")"')@
+ b
+ }
+ $! {
+ N
+ ba
+ }
+ }
' 'PKGBUILD'
if ${commit}; then
if [ -d '.git' ] || [ -f '.git' ]; then