-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkoji_run
executable file
·56 lines (52 loc) · 1.64 KB
/
koji_run
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
#!/bin/bash
function help_usage() {
echo -e "Format isn't correct!"
echo -e "Use \e[1;30m$0 \e[32mbuild\e[0m project_name commit_number dist_number\e[0m to build package"
echo -e "Use \e[1;30m$0 \e[32mregen dist\e[0m to repos regen"
echo -e "Use \e[1;30m$0 \e[32madd-pkg\e[0m project_name owner dist1 dist2 dist3 \e[0m to add package"
exit
}
if [ -z "$1" -o -z "$2" ]
then
help_usage
fi
koji_config="/etc/koji-rf.conf"
function dist_expand() {
case $1 in
[67]) dist="dist-el$1";;
rawhide) dist="dist-rfr-rawhide";;
# 25) dist="dist-rfr$1-devel";;
23|24|25) dist="dist-rfr$1";;
*) echo -e "\e[31mUnknown target!\e[0m"
exit 1;;
esac
}
# dist_expand $3
# echo "koji $5 -c $koji_config build $4 $dist git://github.com/RussianFedora/$1.git?#$2"
case $1 in
"regen")
dist_expand $2
koji -c $koji_config regen-repo $dist-build;;
"add-pkg")
args=("$@")
args_n=`expr $# - 1`
echo -en "Adding $2 to "
for i in `seq 3 $args_n`
do
dist_expand ${args[$i]}
echo -en "${args[$i]} "
koji -c $koji_config add-pkg $dist $2 --owner=$3
done
echo -en "\n";;
"build")
if [ -z "$4" ]
then
echo "Need first dist_number"
else
dist_expand $4
#echo "koji -c $koji_config build $5 $dist git://github.com/RussianFedora/$2.git?#$3 1>/dev/null"
koji -c $koji_config build $5 $dist git://github.com/RussianFedora/$2.git?#$3 --nowait 1>/dev/null
fi;;
*)
help_usage;;
esac