-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-all-yum-repos
executable file
·107 lines (93 loc) · 3.5 KB
/
update-all-yum-repos
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
#!/bin/sh
# Generates various metadata for yum and wbm repos.
# Run after any changes to groups.a (Prefer update-universal for webmin/virtualmin updates.)
# VM7
basedir="$HOME/result/vm/7"
cachedir="$HOME/rpmcache.vm7"
distrodirs="centos/7/x86_64 gpl/centos/7/x86_64 centos/8/x86_64 gpl/centos/8/x86_64 universal gpl/universal"
# metadata repos
for i in $distrodirs; do
echo "Working on $basedir/$i"
mkdir -p $cachedir/$i
# Clean up old packages
repomanage --keep=2 --old $basedir/$i | xargs rm -f
cd "$basedir/$i"
del-broken-links
createrepo -q -c $cachedir/$i $basedir/$i
createrepo -q --deltas --oldpackagedirs $basedir/$i $basedir/$i
done
# Update comps.xml
cd $HOME/src/virtualmin-yum-groups
git pull
git checkout master
# Virtualmin Core
rm $basedir/universal/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-core-comps.xml $basedir/universal
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-core-comps.xml $basedir/gpl/universal
# CentOS 7
rm $basedir/centos/7/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-7-comps.xml $basedir/centos/7/x86_64
rm $basedir/gpl/centos/7/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-7-comps.xml $basedir/gpl/centos/7/x86_64
# CentOS 8
rm $basedir/centos/8/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-8-comps.xml $basedir/centos/8/x86_64
rm $basedir/gpl/centos/8/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-8-comps.xml $basedir/gpl/centos/8/x86_64
# Tarball mess
# wbm/wbt
cd $basedir/wbm
./make-updates.pl > updates.txt
./make-versions.pl
# wbm/wbt
cd $basedir/gpl/wbm
del-broken-links
./make-updates.pl > updates.txt
./make-versions.pl
# Don't do vm6 until we've tested local repo generation
exit 0
# VM6
basedir="$HOME/result/vm/6"
cachedir="$HOME/rpmcache.vm6"
# metadata repos
distrodirs="centos/7/x86_64 gpl/centos/7/x86_64 centos/8/x86_64 gpl/centos/8/x86_64 universal gpl/universal"
for i in $distrodirs; do
echo "Working on $basedir/$i"
mkdir -p $cachedir/$i
# Clean up old packages
repomanage --keep=2 --old $basedir/$i | xargs rm -f
# Generate metadata
cd "$basedir/$i"
del-broken-links
createrepo -q -c $cachedir/$i $basedir/$i
createrepo -q --deltas --oldpackagedirs $basedir/$i $basedir/$i
done
# Update comps.xml
cd $HOME/src/virtualmin-yum-groups
git pull
git checkout vm6
# Virtualmin Core
rm $basedir/universal/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-core-comps.xml $basedir/universal
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-core-comps.xml $basedir/gpl/universal
# CentOS 7
rm $basedir/centos/7/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-7-comps.xml $basedir/centos/7/x86_64
rm $basedir/gpl/centos/7/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-7-comps.xml $basedir/gpl/centos/7/x86_64
# CentOS 8
rm $basedir/centos/8/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-8-comps.xml $basedir/centos/8/x86_64
rm $basedir/gpl/centos/8/x86_64/repodata/*comps*
createrepo -g $HOME/src/virtualmin-yum-groups/virtualmin-centos-8-comps.xml $basedir/gpl/centos/8/x86_64
# Tarball mess
# wbm/wbt
cd $basedir/wbm
./make-updates.pl > updates.txt
./make-versions.pl
# wbm/wbt
cd $basedir/gpl/wbm
del-broken-links
./make-updates.pl > updates.txt
./make-versions.pl
updateslib.sh