#! /bin/bash

dir="mga5/x86_64"

rpms=""
for f in "$dir/"*.rpm ; do
    case "X$f" in
	*CodeMeter*)
	    ;;
	*intel-ipp*)
	    ;;
	*)
	    if rpm -qip "$f" | grep -q '^Signature *:.*\(none\)'; then
		rpms="$rpms $f"
	    fi
    esac
done
if [ -n "$rpms" ]; then
    rpmsign --resign --define '_gpg_name Yate RAN Products' $rpms
    echo signed $rpms
fi

genhdlist2 --clean --xml-info "$dir"
