summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-04-26 09:19:39 +0200
committerRemi Collet <remi@php.net>2024-04-26 09:19:39 +0200
commitfe4a06d6bd6cea9899295c550076894b19c3f09b (patch)
treef5b00deb636431c236271a6c9d47086ee845370b
parent9976999105048d7cb4c99686b46bbe7a2cb1e43b (diff)
split queue per arch
-rwxr-xr-xmockit8
-rwxr-xr-xmockrun15
2 files changed, 17 insertions, 6 deletions
diff --git a/mockit b/mockit
index 7adaa82..5721b32 100755
--- a/mockit
+++ b/mockit
@@ -49,8 +49,10 @@ 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)
@@ -125,7 +127,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 mock "$CMD"
+ redis-cli sadd $QUEUE "$CMD"
else
echo -n "$(date +%X) $i "
$CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
@@ -138,7 +140,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 mock "$CMD"
+ redis-cli sadd $QUEUE "$CMD"
else
echo -n "$(date +%X) scl$i "
$CMD --uniqueext=$ID && echo " Ok." || echo " Error !"
@@ -147,7 +149,7 @@ do
done
if [ $REDIS -ge 1 ]; then
- echo "Queue size: " $(redis-cli scard mock)
+ echo "Queue size: " $(redis-cli scard $QUEUE)
else
date +%X
fi
diff --git a/mockrun b/mockrun
index fddac87..1d3e51a 100755
--- a/mockrun
+++ b/mockrun
@@ -3,6 +3,15 @@
CHECK=$(redis-cli ping)
[ "$CHECK" = "PONG" ] || exit 1
+# ARCH detection and check
+if [ "$(uname -m)" = "x86_64" ]; then
+ SUF=x
+ QUEUE=mockx
+else
+ SUF=a
+ QUEUE=mocka
+fi
+
if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage $0 [ option ]"
echo " -e --erase to empty the queue"
@@ -12,17 +21,17 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then
exit 0
elif [ "$1" = "-l" -o "$1" = "--list" ]; then
- redis-cli smembers mock
+ redis-cli smembers $QUEUE
exit 0
elif [ "$1" = "-e" -o "$1" = "--erase" ]; then
- redis-cli del mock
+ redis-cli del $QUEUE
exit 0
fi
while true
do
- CMD=$(redis-cli spop mock)
+ CMD=$(redis-cli spop $QUEUE)
if [ -z "$CMD" ]; then
if [ "$1" = "-p" -o "$1" = "--perm" ]; then
echo -n .