From b0a1c7e0aff57ff754929b7508203eec9e80a092 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 18 Jul 2018 13:24:58 +0200 Subject: bin/seed-build-list: entries in conf/seed-ignore-packages do not make _all_ matching packages ignored, but only upstream-mirror ones (-m) --- bin/seed-build-list | 94 ++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/bin/seed-build-list b/bin/seed-build-list index 6f3efe7..12b829d 100755 --- a/bin/seed-build-list +++ b/bin/seed-build-list @@ -7,9 +7,6 @@ # shellcheck source=../lib/load-configuration . "${0%/*}/../lib/load-configuration" -# TODO: conf/seed-ignore-packages should only make upstream packages being ignored, -# not all packages! - # shellcheck disable=SC2016 usage() { >&2 echo '' @@ -75,10 +72,6 @@ update=true wait_for_lock='-n' lock_error=1 -if [ -r "${base_dir}/conf/seed-ignore-packages" ]; then - cp "${base_dir}/conf/seed-ignore-packages" "${tmp_dir}/ignore-packages" -fi - while true do case "$1" in @@ -171,49 +164,56 @@ repos=$( # generate must-haves query from mirror delta if [ -s "${tmp_dir}/mirrors" ]; then { - # theirs - while read -r mirror; do - if [ -z "${mirror}" ]; then - continue - fi - for repo in ${repos}; do - curl -sS "${mirror}/${repo}/os/x86_64/${repo}.db.tar.gz" | \ - tar -Oxz --wildcards '*/desc' | \ - sed ' - /^%FILENAME%$/!d - N - s/^.*\n// - s/-x86_64\(\.pkg\.tar\.xz\)$/-i686\1/ - s/^\(.*\)-\([^-]\+-[^-]\+\)-\([^-]\+\)$/theirs \2 \3 \1/ - ' - done - done < \ - "${tmp_dir}/mirrors" - # ours - # shellcheck disable=SC2016 { - printf 'SELECT ' - mysql_package_name_query - printf ' FROM `binary_packages`' - mysql_join_binary_packages_architectures - mysql_join_binary_packages_binary_packages_in_repositories - printf ' WHERE NOT `binary_packages_in_repositories`.`is_to_be_deleted`' + # theirs + while read -r mirror; do + if [ -z "${mirror}" ]; then + continue + fi + for repo in ${repos}; do + curl -sS "${mirror}/${repo}/os/x86_64/${repo}.db.tar.gz" | \ + tar -Oxz --wildcards '*/desc' | \ + sed ' + /^%FILENAME%$/!d + N + s/^.*\n// + s/-x86_64\(\.pkg\.tar\.xz\)$/-i686\1/ + s/^\(.*\)-\([^-]\+-[^-]\+\)-\([^-]\+\)$/theirs \2 \3 \1/ + ' + done + done < \ + "${tmp_dir}/mirrors" + # ours + # shellcheck disable=SC2016 + { + printf 'SELECT ' + mysql_package_name_query + printf ' FROM `binary_packages`' + mysql_join_binary_packages_architectures + mysql_join_binary_packages_binary_packages_in_repositories + printf ' WHERE NOT `binary_packages_in_repositories`.`is_to_be_deleted`' + } | \ + mysql_run_query | \ + sed ' + s/^\(.*\)-\([^-]\+-[^-]\+\)-\([^-]\+\)$/ours \2 \3 \1/ + ' } | \ - mysql_run_query | \ - sed ' - s/^\(.*\)-\([^-]\+-[^-]\+\)-\([^-]\+\)$/ours \2 \3 \1/ - ' + expand_version 2 | \ + sort -k3,4 -k2Vr,2 -k1,1 | \ + shrink_version 2 | \ + uniq -f2 | \ + sed -n ' + s/^theirs \(\S\+ \)\{2\}// + T + p + ' | \ + sort -u + if [ -r "${base_dir}/conf/seed-ignore-packages" ]; then + sed 'p' "${base_dir}/conf/seed-ignore-packages" + fi } | \ - expand_version 2 | \ - sort -k3,4 -k2Vr,2 -k1,1 | \ - shrink_version 2 | \ - uniq -f2 | \ - sed -n ' - s/^theirs \(\S\+ \)\{2\}// - T - p - ' | \ - sort -u > \ + sort | \ + uniq -u > \ "${tmp_dir}/must-haves" fi -- cgit v1.2.3-70-g09d2