-
Notifications
You must be signed in to change notification settings - Fork 6
/
el-round.sh
executable file
·81 lines (72 loc) · 2.82 KB
/
el-round.sh
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
#!/bin/sh
ARCHES="x86_64 aarch64 ppc64le"
FVERSION="7 8 9"
REPOS="rpmfusion_free rpmfusion_nonfree"
FLAVOUR="epel epel-next"
etc_mock=../mock/mock-core-configs/etc/mock
# uncomment the next line to compare mock fedora configurations on /etc/mock
# with mock rpmfusion configuration
#etc_mock=/etc/mock
for arch in $ARCHES ; do
for repo in $REPOS ; do
for fver in $FVERSION ; do
for flavour in $FLAVOUR; do
#### script
# RPMFusion el7 don't have aarch64 builders
if [ "$arch" = "aarch64" ] && [ "${fver}" -lt "8" ] ; then
continue
fi
# RPMFusion el7 don't have ppc64le builders
if [ "$arch" = "ppc64le" ] && [ "${fver}" -lt "8" ] ; then
continue
fi
# RPMFusion el8 don't have next repos
if [ "$flavour" = "epel-next" ] && [ "${fver}" -lt "9" ] ; then
continue
fi
# if $etc_mock directory exist check .cfg,
if [ -d "${etc_mock}" ] && [ ! -f "${etc_mock}/${flavour}-${fver}-${arch}.cfg" ] ; then
echo "doesnt exist ${etc_mock}/${flavour}-${fver}-${arch}.cfg"
continue
fi
cfg_name_new="${flavour}+${repo}-${fver}-${arch}.cfg"
cfg_name_old="${flavour}-${fver}-${arch}-${repo}.cfg"
if [ "$repo" = rpmfusion_free ] ; then
echo "include('${flavour}-${fver}-${arch}.cfg')" > "$cfg_name_new"
if [ "${flavour}" = "epel-next" ] ; then
echo "include('templates/rpmfusion_free-epel.tpl')" >> "$cfg_name_new"
fi
echo "include('templates/rpmfusion_free-${flavour}.tpl')" >> "$cfg_name_new"
fi
if [ "$repo" = rpmfusion_nonfree ] ; then
echo "include('${flavour}+rpmfusion_free-${fver}-${arch}.cfg')" > "$cfg_name_new"
if [ "${flavour}" = "epel-next" ] ; then
#echo "include('epel-next-${fver}-${arch}.cfg')" > "$cfg_name_new"
echo "include('templates/rpmfusion_nonfree-epel.tpl')" >> "$cfg_name_new"
fi
echo "include('templates/rpmfusion_nonfree-${flavour}.tpl')" >> "$cfg_name_new"
fi
# yum.conf on epel-7
if [ "${fver}" -lt "8" ]; then
# No Next repo before el8
if [ "$flavour" = "epel-next" ] ; then
continue
else
sed -i -e "s|epel.tpl|epel_yum.tpl|g" "$cfg_name_new"
fi
fi
#git add fedora-${fver}-${arch}-${repo}.cfg
# sed -i -e "s|\$basearch|${arch}|g" epel-${fver}-${arch}-${repo}.cfg
# sed -i -e "s|\$releasever|${fver}|g" epel-${fver}-${arch}-${repo}.cfg
#sed -i -e "s|mirrorlist=http://mirrors.rpmfusion.org|#mirrorlist=http://mirrors.rpmfusion.org|g" fedora-${fver}-${arch2}-${repo}.cfg
#sed -i -e "s|kojipkgs.fedoraproject.org|sparc.koji.fedoraproject.org|g" fedora-${fver}-${arch2}-${repo}.cfg
#sed -i -e "s|#baseurl=http://download1.rpmfusion.org/nonfree/fedora/|baseurl=http://download1.rpmfusion.org/nonfree/fedora-secondary/|g" fedora-${fver}-${arch2}-${repo}.cfg
#done
ln -sr "$cfg_name_new" "$cfg_name_old"
mv "$cfg_name_new" etc/mock/
mv "$cfg_name_old" etc/mock/
### /script
done
done
done
done