summaryrefslogtreecommitdiff
path: root/checkPinnedDependencies
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-07-06 10:07:02 +0200
committerErich Eckner <git@eckner.net>2020-07-06 10:07:02 +0200
commit578b2eadbb92020c2f42b7c13607b429a7be449d (patch)
tree3a8ae47b0c16c37873ed26836f24c293c8a50282 /checkPinnedDependencies
parent88d416b5affbc6d1351605ab452c59451008308a (diff)
downloadarchlinuxewe-578b2eadbb92020c2f42b7c13607b429a7be449d.tar.xz
checkPinnedDependencies: use liste-verfuegbare-Versionen
Diffstat (limited to 'checkPinnedDependencies')
-rwxr-xr-xcheckPinnedDependencies42
1 files changed, 24 insertions, 18 deletions
diff --git a/checkPinnedDependencies b/checkPinnedDependencies
index 7f04e768e..07fe7cea1 100755
--- a/checkPinnedDependencies
+++ b/checkPinnedDependencies
@@ -2,24 +2,30 @@
cd "$(dirname "$0")"
+machineReadable=false
+unset provided
+
+while [ $# -gt 0 ]; do
+
+ if [ "x$1" = 'x-m' ]; then
+ machineReadable=true
+ elif [ -f "$1" ]; then
+ provided="$1"
+ else
+ >&2 printf 'unknown option "%s"\n' "$1"
+ fi
+
+ shift
+
+done
+
+if [ -z "${provided}" ]; then
+ provided=$("./liste-verfuegbare-Versionen")
+ trap 'rm -f "${provided}"' EXIT
+fi
+
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
- }
- ' \
+ awk '{print $2 "=" $1}' <"${provided}" \
| sort -u
) <(
for pkgbuild in */PKGBUILD; do
@@ -42,7 +48,7 @@ join -1 1 -2 2 -v 2 <(
done \
| sort -k2,2
) \
-| if [ "x$1" = 'x-m' ]; then
+| if ${machineReadable}; then
cut -d' ' -f2
else
while read -r dep pkg; do