#!/bin/bash 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") || exit $? trap 'rm -f "${provided}"' EXIT fi join -1 1 -2 2 -v 2 <( awk '{print $2 "=" $1}' <"${provided}" \ | 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 ${machineReadable}; then cut -d' ' -f2 else while read -r dep pkg; do printf '%s: %s\n' "${pkg}" "${dep}" done fi