From 38e2189c1288293b87ef2cb37f2c8f530d831f01 Mon Sep 17 00:00:00 2001 From: Thomas Oulevey Date: Jun 26 2017 21:09:00 +0000 Subject: qa for arch detection testing on cbs --- diff --git a/scripts/mash_run.sh b/scripts/mash_run.sh index 0f01a14..32263e3 100755 --- a/scripts/mash_run.sh +++ b/scripts/mash_run.sh @@ -97,6 +97,7 @@ fi print_mash_template() { local tag=$1 + local arches=$2 cat << EOF [${tag}] rpm_path = ${MASH_DEST}/${tag}/%(arch)s/os/Packages @@ -110,7 +111,7 @@ inherit = False strict_keys = False repoviewurl = ${MASH_VIEWURL}/${tag}/%(arch)s/os/ repoviewtitle = "${tag^^}" -arches = ppc64le i386 x86_64 aarch64 +arches = ${arches} delta = True EOF } @@ -119,11 +120,17 @@ mash_prepare () { local tag=$1 local log=$2 + local arches=$3 + local conf=`mktemp` ( $optionv ) && echo "* Checking ${tag} mash config..." # config mash already ok - [ -f ${MASH_CONF}/${tag}.mash ] && return ( $optionv ) && echo " -> [INFO] creating mash config: ${tag}.mash..." - print_mash_template "${tag}" > ${MASH_CONF}/${tag}.mash + print_mash_template "${tag}" "${arches}" > $conf + [ -f ${MASH_CONF}/${tag}.mash ] && diff $conf ${MASH_CONF}/${tag}.mash + if [ $? -gt 0 ] + then + mv $conf ${MASH_CONF}/${tag}.mash + fi } mash_run () { @@ -157,6 +164,7 @@ echo $$ > $pidfile for TAG in ${TAGS} do + BUILDTAG="" LOG="${LOG_DIR}/mash.${TAG}.log" if [ ! -f $MASH_CACHE/$TAG.buildlist ] then @@ -164,19 +172,21 @@ do else BUILDLIST=`mktemp` ${KOJI} list-tagged $TAG > $BUILDLIST - diff $BUILDLIST $MASH_CACHE/$TAG.buildlist &>> $LOG - if [ $? -eq 0 ] - then - echo " -> skipping. No new build in $TAG" &>> $LOG + diff $BUILDLIST $MASH_CACHE/$TAG.buildlist &>> $LOG + if [ $? -eq 0 ] + then + echo " -> skipping. No new build in $TAG" &>> $LOG rm -rf $BUILDLIST - continue - else - echo " -> updating cache for $TAG" &>> $LOG - cp $BUILDLIST $MASH_CACHE/$TAG.buildlist + continue + else + echo " -> updating cache for $TAG" &>> $LOG + cp $BUILDLIST $MASH_CACHE/$TAG.buildlist fi rm -rf $BUILDLIST fi - mash_prepare "${TAG}" "${LOG}" + BUILDTAG=`${KOJI} list-targets --quiet | grep ${TAG}| awk '{print $2}'` + ARCHES=`${KOJI} taginfo ${BUILDTAG} | grep Arches | cut -d ":" -f 2-` + mash_prepare "${TAG}" "${LOG}" "${ARCHES}" mash_run "${TAG}" "${LOG}" & done