#!/bin/bash reqs=$(pdb query --filter \ 'yast2-trans-?? yast2-trans-??\_??,status:production' \ | awk '{printf ("%s ", $1) }') # echo $reqs # for f in $(sed -n 's/^Conflicts: *\(.*\)/\1/gp' *.spec); do # [ -z "$f" ] && break # reqs=$(echo $reqs | sed "s/$f//") # done # # echo $reqs # check whether all wanted packages are available in stable (noarch) if [ -d /work/SRC/noarch ]; then for f in $reqs; do [ -d /work/SRC/noarch/$f ] || missing="$missing $f" done else echo "warning: /work/SRC/noarch does not exist; skipping package check" fi # report result if [ -n "$missing" ]; then echo "missing package in /work/SRC/noach :" echo " \"$missing\"" exit 1 fi sed -i.old "s/^Requires.*/Requires: $reqs/" yast2-trans-allpacks.spec diff -u yast2-trans-allpacks.spec.old yast2-trans-allpacks.spec exit 0