summaryrefslogtreecommitdiffstats
path: root/mockit
diff options
context:
space:
mode:
Diffstat (limited to 'mockit')
-rwxr-xr-xmockit27
1 files changed, 15 insertions, 12 deletions
diff --git a/mockit b/mockit
index 5721b32..0989305 100755
--- a/mockit
+++ b/mockit
@@ -13,8 +13,19 @@ BUILD_BASE=1
BUILD_SCLS=1
REDIS=0
+# ARCH detection and check
+if [ "$(uname -m)" = "x86_64" ]; then
+ SUF=x
+ QUEUE=mockx
+ REDISCLI="redis-cli"
+else
+ SUF=a
+ QUEUE=mocka
+ REDISCLI="redis-cli -h remi"
+fi
+
if [ "$1" == "--redis" ]; then
- CHECK=$(redis-cli ping)
+ CHECK=$($REDISCLI ping)
[ "$CHECK" = "PONG" ] || exit 1
REDIS=1
shift
@@ -46,14 +57,6 @@ else
shift
fi
-# ARCH detection and check
-if [ "$(uname -m)" = "x86_64" ]; then
- SUF=x
- QUEUE=mockx
-else
- SUF=a
- QUEUE=mocka
-fi
case $DIST in
*x)
if [ $SUF != x ]; then
@@ -127,7 +130,7 @@ do
if [ 0$i -ge $MIN -a 0$i -le $MAX ]; then
CMD="mock -q --configdir=$mocketc -r ${DIST}${i} rebuild $SRPM $@"
if [ $REDIS -ge 1 ]; then
- redis-cli sadd $QUEUE "$CMD"
+ $REDISCLI sadd $QUEUE "$CMD"
else
echo -n "$(date +%X) $i "
$CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
@@ -140,7 +143,7 @@ do
if [ 0$i -ge $MIN -a 0$i -le $MAX ]; then
CMD="mock -q --configdir=$mocketc -r ${DIST}scl${i} rebuild $SRPM $@"
if [ $REDIS -ge 1 ]; then
- redis-cli sadd $QUEUE "$CMD"
+ $REDISCLI sadd $QUEUE "$CMD"
else
echo -n "$(date +%X) scl$i "
$CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
@@ -149,7 +152,7 @@ do
done
if [ $REDIS -ge 1 ]; then
- echo "Queue size: " $(redis-cli scard $QUEUE)
+ echo "Queue size: " $($REDISCLI scard $QUEUE)
else
date +%X
fi