summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-04-26 09:24:37 +0200
committerRemi Collet <remi@php.net>2024-04-26 09:24:37 +0200
commiteb7e370cb03a68bfb9cc229088dc5b8c78a47040 (patch)
treeb020a1b138c248abc0220428b0996b047f0170f2
parentfe4a06d6bd6cea9899295c550076894b19c3f09b (diff)
fix redis server address
-rwxr-xr-xmockit27
-rwxr-xr-xmockrun16
2 files changed, 23 insertions, 20 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
diff --git a/mockrun b/mockrun
index 1d3e51a..4554626 100755
--- a/mockrun
+++ b/mockrun
@@ -1,17 +1,17 @@
#!/bin/bash
-CHECK=$(redis-cli ping)
-[ "$CHECK" = "PONG" ] || exit 1
-
# 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
+CHECK=$($REDISCLI ping)
+[ "$CHECK" = "PONG" ] || exit 1
+
if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage $0 [ option ]"
echo " -e --erase to empty the queue"
@@ -21,17 +21,17 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then
exit 0
elif [ "$1" = "-l" -o "$1" = "--list" ]; then
- redis-cli smembers $QUEUE
+ $REDISCLI smembers $QUEUE
exit 0
elif [ "$1" = "-e" -o "$1" = "--erase" ]; then
- redis-cli del $QUEUE
+ $REDISCLI del $QUEUE
exit 0
fi
while true
do
- CMD=$(redis-cli spop $QUEUE)
+ CMD=$($REDISCLI spop $QUEUE)
if [ -z "$CMD" ]; then
if [ "$1" = "-p" -o "$1" = "--perm" ]; then
echo -n .