autoport: add safety check that .spec version matches srcpkglist to fix packages sent in wrong repositories when the latter file is not up to date

This commit is contained in:
Silvan Calarco 2021-02-20 17:28:14 +01:00
parent 7dcd16b2ca
commit 27d32d110e

View File

@ -557,6 +557,14 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
autoport_log ${JOB_CURRENT} prepare failed $tmpfile autoport_log ${JOB_CURRENT} prepare failed $tmpfile
continue continue
} || { } || {
spec_version=`grep "^Version:" ${SPECDIR}/${JOB_CURRENT}.spec | awk '{ print $2}'`
spec_release=`grep "^Release:" ${SPECDIR}/${JOB_CURRENT}.spec | awk '{ print $2}'`
if [ "${spec_version}-${spec_release}" != "$src_version-$src_release" ]; then
echo "< (FAILED) [wrong version ${src_version}-${src_release} != ${spec_version}-${spec_release}]"
JOB_CANTPREPARE=(${JOB_CANTPREPARE[*]} $JOB_CURRENT)
autoport_log ${JOB_CURRENT} prepare failed $tmpfile
continue
fi
echo $JOB_CURRENT >> $DATAARCHDIR/preparedjobs echo $JOB_CURRENT >> $DATAARCHDIR/preparedjobs
echo -n "(OK) " echo -n "(OK) "
autoport_log ${JOB_CURRENT} prepare ok $tmpfile autoport_log ${JOB_CURRENT} prepare ok $tmpfile