-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_all_packages
executable file
·77 lines (69 loc) · 2.06 KB
/
build_all_packages
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
#!/bin/bash
default_config="/home/vascom/yandex.disk/rfr_package_builds.csv"
if [ -z "$1" ]
then
if [ -e $default_config ]
then
config_build=$default_config
else
echo "Config file for build not found."
exit 1
fi
else
config_build=$1
fi
#Parameters
SEQ=( 6 7 rawhide 25 24 23 )
SEQ_NUM=( 4 5 6 7 8 9 )
NAME_FIELD=f1
LINES_FIELD=f2
GITREV_FIELD=f3
SCRATCH_FIELD=f13
ENABLE_FIELD=f14
SLEEP_FAST=10
SLEEP_SLOW=10
task_count=0
number_lines=`head -n 1 $config_build | cut -d "," -$LINES_FIELD`
temp_line=`head -n $number_lines $config_build | tail -n +2`
for n in $temp_line
do
build_enable=`echo $n | cut -d "," -$ENABLE_FIELD`
#echo $build_enable $n
if [ "$build_enable" = "+" ]
then
pkg_name=`echo $n | cut -d "," -$NAME_FIELD`
pkg_rev=`echo $n | cut -d "," -$GITREV_FIELD`
#echo $pkg_name $pkg_rev
for ((k=0; k < "${#SEQ[@]}" ; k++))
do
pkg_state=`echo $n | cut -d "," -f${SEQ_NUM[$k]}`
build=${SEQ[$k]}
#echo $pkg_name $pkg_state
if [[ "$pkg_state" = "-" && "$2" != "repo" ]]
then
scratch=`echo $n | cut -d "," -$SCRATCH_FIELD`
if [[ "$scratch" = "-" || "$2" = "test" ]]
then
scratch_build="--scratch"
else
scratch_build=""
fi
echo "Building $pkg_name $build"
./koji_run build $pkg_name $pkg_rev $build $scratch_build --quiet
if [ $task_count -lt 3 ]
then sleep $SLEEP_FAST
else sleep $SLEEP_SLOW
fi
task_count=`expr $task_count + 1`
elif [[ ("$pkg_state" = '+' || "$pkg_state" = 'b+') && "$2" = "repo" ]]
then
reponum=`expr $k + 3`
inrepo=`echo $n | cut -d "," -f$reponum`
if [[ "$inrepo" = "-" ]]
then
echo "$pkg_name not in repo $build"
fi
fi
done
fi
done