summaryrefslogtreecommitdiffstats
path: root/mockit
diff options
context:
space:
mode:
Diffstat (limited to 'mockit')
-rwxr-xr-xmockit31
1 files changed, 26 insertions, 5 deletions
diff --git a/mockit b/mockit
index 783500b..907e79c 100755
--- a/mockit
+++ b/mockit
@@ -7,6 +7,7 @@ fi
BUILD_BASE=1
BUILD_SCLS=1
+REDIS=0
if [ "$1" == "--nobase" -o "$1" == "--scl" ]; then
BUILD_BASE=0
@@ -16,6 +17,12 @@ if [ "$1" == "--noscl" -o "$1" == "--base" ]; then
BUILD_SCLS=0
shift
fi
+if [ "$1" == "--redis" ]; then
+ CHECK=$(redis-cli ping)
+ [ "$CHECK" = "PONG" ] || exit 1
+ REDIS=1
+ shift
+fi
SRPM=$1
DIST=$2
@@ -81,16 +88,30 @@ ID=${QUEUE:-$PPID}
[ $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=$ID -r ${DIST}${i} rebuild $SRPM "$@" && echo " Ok." || echo " Error !"
+ CMD="mock -q --configdir=$mocketc -r ${DIST}${i} rebuild $SRPM $@"
+ if [ $REDIS -ge 1 ]; then
+ redis-cli sadd mock "$CMD"
+ else
+ echo -n "$(date +%X) $i "
+ $CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
+ fi
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=$ID -r ${DIST}scl${i} rebuild $SRPM "$@" && echo " Ok." || echo " Error !"
+ CMD="mock -q --configdir=$mocketc -r ${DIST}scl${i} rebuild $SRPM $@"
+ if [ $REDIS -ge 1 ]; then
+ redis-cli sadd mock "$CMD"
+ else
+ echo -n "$(date +%X) scl$i "
+ $CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
+ fi
fi
done
-date +%X
+if [ $REDIS -ge 1 ]; then
+ echo "Queue size: " $(redis-cli scard mock)
+else
+ date +%X
+fi