From 038ad9dbd5255586163eb8c986d4b5b79716f95e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 1 Jul 2020 15:14:09 +0200 Subject: liste-verfuegbare-Versionen: suche in arm und sonstigen repos nach provides, die ich sonst noch nicht gefunden habe --- liste-verfuegbare-Versionen | 69 +++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 30 deletions(-) (limited to 'liste-verfuegbare-Versionen') diff --git a/liste-verfuegbare-Versionen b/liste-verfuegbare-Versionen index a87afba35..13540ed19 100755 --- a/liste-verfuegbare-Versionen +++ b/liste-verfuegbare-Versionen @@ -2,37 +2,46 @@ provided=$(mktemp) -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 - } - /^%PROVIDES%$/,/^$/ { - /^[^%]/ p - } -' \ -| sed -n ' - s/^\(\S\+\)=\(\S\+\)-\(64\|32\)$/\2 \1/ - T no_provides - p - d - :no_provides - /^%NAME%/ { - N - s/^%NAME% \(\S\+\)\n%VERSION% \(\S\+\)-\S\+$/\2 \1/ - T +sources=( + /var/lib/pacman/sync + /mnt/archlinux/archlinux + /mnt/archlinux +) + +for i in "${!sources[@]}"; do + find "${sources["${i}"]}" -name '*.db' \ + -exec bsdtar -Oxzf {} \; \ + 2>/dev/null \ + | sed -n ' + /^%\(NAME\|VERSION\)%$/ { + N + s/\n/ / + p + } + /^%PROVIDES%$/,/^$/ { + /^[^%]/ p + } + ' \ + | sed -n ' + s/^\(\S\+\)=\(\S\+\)-\(64\|32\)$/\2 \1/ + T no_provides p - } -' \ -| sort -k2,2 -k1Vr,1 \ -| uniq -f1 \ + d + :no_provides + /^%NAME%/ { + N + s/^%NAME% \(\S\+\)\n%VERSION% \(\S\+\)-\S\+$/\2 \1/ + T + p + } + ' \ + | sed ' + s/^/'"${i}"' / + ' +done \ +| sort -k3,3 -k1n,1 -k2Vr,2 \ +| uniq -f2 \ +| cut -d' ' -f2,3 \ >"${provided}" printf '%s\n' "${provided}" -- cgit v1.2.3-70-g09d2