-
Notifications
You must be signed in to change notification settings - Fork 2
/
rpm-dispatch
executable file
·56 lines (48 loc) · 979 Bytes
/
rpm-dispatch
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
# move build into arched repos
arches="x86_64 i386 ppc64le ppc64 aarch64 armhfp"
shopt -s nullglob
rm -f *s390x.rpm
for arch in $arches ; do
# Dispatch
case "$arch" in
i386)
[ -d i386 ] || continue
for f in *i?86.rpm; do
mv "${f}" i386
done
for f in *noarch.rpm ; do
ln "${f}" i386
done
;;
armhfp)
[ -d armhfp ] || continue
for f in *.armv7h{,n}l.rpm ; do
mv "${f}" armhfp
done
for f in *noarch.rpm ; do
ln "${f}" armhfp
done
;;
*)
[ -d $arch ] || continue
for f in *${arch}.rpm ; do
mv "${f}" ${arch}
done
for f in *noarch.rpm ; do
ln "${f}" ${arch}
done
;;
esac
# Createrepo
pushd ${arch}
if [ -f $(which createrepo_c) ] ; then
createrepo_c .
elif [ -f $(which createrepo) ] ; then
createrepo .
else
echo "no createrepo"
exit 2
fi
popd &>/dev/null
done