blob: cce9f1332ad0b70684780493b8aef6b8a90e405e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
#!/bin/bash
if [ "$2" = "" ]; then
echo usage SRPM distro [ min_ver [, max_ver [, mock_options ]]]
exit 0
fi
BUILD_BASE=1
BUILD_SCLS=1
REDIS=0
if [ "$1" == "--nobase" -o "$1" == "--scl" ]; then
BUILD_BASE=0
shift
fi
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
shift 2
if [ "$1" = "" ]; then
MIN=0
else
MIN=$1
shift
fi
if [ "$1" = "" ]; then
MAX=999
else
MAX=$1
shift
fi
case $DIST in
*x)
mocketc=/home/rpmbuild/SPECS/remirepo/tools/mock
srpmdir=/home/rpmbuild/site/rpms/SRPMS
;;
*a)
mocketc=/home/remi/mock
srpmdir=/home/remi/SRPMS
;;
esac
if [ -f $srpmdir/$SRPM ]; then
SRPM=$srpmdir/$SRPM
elif [ ! -f $SRPM ]; then
echo "file not found '$SRPM'"
exit 1
fi
echo mockit $SRPM $DIST $MIN $MAX $@
case $DIST in
fc38x|fc39x|fc39a|fc40x|fc40a|el9x|el9a)
LST="82 81 74 80 83"
SCL="74 80 81 82 83"
;;
el8a)
LST="72 73 74 80 81 82 83"
SCL="72 73 74 80 81 82 83"
;;
el8x)
LST="72 73 74 80 81 82 83"
SCL="56 70 71 72 73 74 80 81 82 83"
;;
el7x)
LST="54 55 56 70 71 72 73 74 80 81 82 83"
SCL="54 55 56 70 71 72 73 74 80 81 82 83"
;;
*)
echo Unkown DIST $DIST
exit 1
;;
esac
ID=${QUEUE:-$PPID}
[ $BUILD_BASE -ge 1 ] && for i in $LST
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"
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
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
if [ $REDIS -ge 1 ]; then
echo "Queue size: " $(redis-cli scard mock)
else
date +%X
fi
|