#!/bin/sh
-
-LOCALREPO=$HOME/smock/yum
-#ARCHES="i386 x86_64"
-ARCHES=i386
+if [ -z "$LOCALREPO" -o -z "$ARCHES" ]; then
+ echo '$LOCALREPO must point to local repository'
+ echo '$ARCHES must contain list of architectures to build'
+ exit 1
+fi
help() {
echo "syntax: $0 DIST SRPM"
mock -r $DIST-$ARCH --resultdir $LOCALREPO/scratch $SRPM
+ if [ $? != 0 ]; then
+ echo "Build failed, leaving logs in $LOCALREPO/scratch"
+ exit 1
+ fi
mv $LOCALREPO/scratch/*.src.rpm $LOCALREPO/$DIST/src/SRPMS
mv $LOCALREPO/scratch/*.rpm $LOCALREPO/$DIST/$ARCH/RPMS
mv $LOCALREPO/scratch/*.log $LOCALREPO/$DIST/$ARCH/logs/$SRPM/
done
createrepos
+