From 27d32d110e696f28a012a1f0eb389977f54da6a8 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 20 Feb 2021 17:28:14 +0100 Subject: [PATCH] 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 --- autoport | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoport b/autoport index 545153a..55b1ae6 100755 --- a/autoport +++ b/autoport @@ -557,6 +557,14 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do autoport_log ${JOB_CURRENT} prepare failed $tmpfile 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 -n "(OK) " autoport_log ${JOB_CURRENT} prepare ok $tmpfile