diff options
author | Erich Eckner <git@eckner.net> | 2020-07-01 08:48:11 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-07-01 08:48:11 +0200 |
commit | b1c147123314195abbb62ba9fbafc292eaaf9783 (patch) | |
tree | 1615278d9ef7cf1681906517be2d9584a94f57d0 /checkPinnedDependencies | |
parent | ac8774bee88dde8c1a8782d4de542a0056737f87 (diff) | |
download | archlinuxewe-b1c147123314195abbb62ba9fbafc292eaaf9783.tar.xz |
checkPinnedDependencies new
Diffstat (limited to 'checkPinnedDependencies')
-rwxr-xr-x | checkPinnedDependencies | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/checkPinnedDependencies b/checkPinnedDependencies new file mode 100755 index 000000000..9a0f22a73 --- /dev/null +++ b/checkPinnedDependencies @@ -0,0 +1,49 @@ +#!/bin/bash + +join -1 1 -2 2 -v 2 <( + find /var/lib/pacman/sync \ + -name '*.db' \ + -exec bsdtar -Oxf {} \; \ + | sed -n ' + /^%FILENAME%/ { + N + s/^%FILENAME%\n\(\S\+\)-\([^-]\+-[^-]\+\)-[^-]\+$/\1=\2/ + p + s/-[^-]\+$// + p + d + } + /^%PROVIDES%$/,/^$/ { + s/-64$// + /^[^%]/p + } + ' \ + | sort -u +) <( + for pkgbuild in */PKGBUILD; do + sed -n ' + /^\s*_pinned_dependencies[^[:space:]=]*=([^)]*$/,/)/p + /^\s*_pinned_dependencies[^[:space:]=]*=([^)]*)/p + ' "${pkgbuild}" \ + | sed ' + s/^\s*_pinned_dependencies[^[:space:]=]*=(// + s/).*$// + ' \ + | tr '[:space:]' '\n' \ + | sort -u \ + | grep -vxF '' \ + | sed ' + s@^\(['"'"'"]\)\(\S\+\)\1$@\2@ + /^glibc>=/d + s@^@'"${pkgbuild%/*}"' @ + ' + done \ + | sort -k2,2 +) \ +| if [ "x$1" = 'x-m' ]; then + cut -d' ' -f2 +else + while read -r dep pkg; do + printf '%s: %s\n' "${pkg}" "${dep}" + done +fi |