#!/bin/bash if [ "$2" = "" ]; then echo usage SRPM distro [ min_ver [, max_ver [, mock_options ]]] exit 0 fi BUILD_BASE=1 BUILD_SCLS=1 if [ "$1" == "--nobase" -o "$1" == "--scl" ]; then BUILD_BASE=0 shift fi if [ "$1" == "--noscl" -o "$1" == "--base" ]; then BUILD_SCLS=0 shift fi SRPM=$1 DIST=$2 shift 2 if [ "$1" = "" ]; then MIN=0 else MIN=$1 shift fi if [ "$1" = "" ]; then MAX=999 else MAX=$1 shift fi case $DIST in *x) mocketc=/home/rpmbuild/SPECS/remirepo/tools/mock srpmdir=/home/rpmbuild/site/rpms/SRPMS ;; *a) mocketc=/home/remi/mock srpmdir=/home/remi/SRPMS ;; esac if [ -f $srpmdir/$SRPM ]; then SRPM=$srpmdir/$SRPM elif [ ! -f $SRPM ]; then echo "file not found '$SRPM'" exit 1 fi echo mockit $SRPM $DIST $MIN $MAX $@ case $DIST in fc37x|fc38x|fc39x|el9x|el9a|el8a) LST="81 74 80 82 83" SCL="74 80 81 82 83" ;; el8x) LST="72 73 74 80 81 82 83" SCL="56 70 71 72 73 74 80 81 82 83" ;; el7x) LST="54 55 56 70 71 72 73 74 80 81 82 83" SCL="54 55 56 70 71 72 73 74 80 81 82 83" ;; *) echo Unkown DIST $DIST exit 1 ;; esac [ $BUILD_BASE -ge 1 ] && for i in $LST do if [ 0$i -ge $MIN -a 0$i -le $MAX ]; then echo -n "$(date +%X) $i " mock -q --configdir=$mocketc --uniqueext=$(uuidgen) -r ${DIST}${i} rebuild $SRPM "$@" && echo " Ok." || echo " Error !" fi done [ $BUILD_SCLS -ge 1 ] && for i in $SCL do if [ 0$i -ge $MIN -a 0$i -le $MAX ]; then echo -n "$(date +%X) scl$i " mock -q --configdir=$mocketc --uniqueext=$(uuidgen) -r ${DIST}scl${i} rebuild $SRPM "$@" && echo " Ok." || echo " Error !" fi done date +%X