From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Wed, 24 Sep 2008 13:07:49 +0000 (+0100) Subject: Only rebuild packages as necessary. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=9cd34bd0035429e207e427df2286857a180e530b;p=fedora-mingw.git Only rebuild packages as necessary. --- diff --git a/build-everything-in-mock.sh b/build-everything-in-mock.sh index 6b079ad..a4179d6 100755 --- a/build-everything-in-mock.sh +++ b/build-everything-in-mock.sh @@ -1,6 +1,12 @@ -#!/bin/sh - +#!/bin/bash - DIST=fedora-9 +SKIP_BUILT_RPMS=1 + +LOCALREPO=$HOME/public_html/smock/yum +ARCHES="i386 x86_64" + +export DIST SKIP_BUILT_SRPMS LOCALREPO ARCHES specs=`perl show-build-order.pl | grep -v '^#' | @@ -15,7 +21,26 @@ for spec in $specs do set -e dir=`dirname $spec` - srcrpm=`rpmbuild --define "_sourcedir $pwd/$dir" -bs $spec | - awk '{print $2}'` - smock/smock $DIST $srcrpm + srcrpm=`rpmbuild --define "_sourcedir $pwd/$dir" -bs $spec` + if [ $? != 0 ]; then exit 1; fi + srcrpm=`echo $srcrpm | awk '{print $2}'` + + # Test if all the output RPMs exist already. + skip= + if [ $SKIP_BUILT_RPMS ]; then + skip=1 + baserpm=`basename $srcrpm | sed 's/\.fc[[:digit:]]*\.src\.rpm//g'` + for arch in $ARCHES; do + if [ ! -f $LOCALREPO/$DIST/$arch/RPMS/$baserpm.* ]; then + skip= + fi + done + fi + echo result of skip = $skip + + if [ $skip ]; then + echo "skipping $srcrpm" + else + echo smock/smock.sh $DIST $srcrpm + fi done 2>&1 | tee -a buildall.log