-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitrepo
executable file
·74 lines (62 loc) · 1.24 KB
/
initrepo
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
#!/bin/bash
initrepo () {
for distro_and_version in $DIST_VER
do
mkdir -p ${distro_and_version}
for arch in $ARCH
do
mkdir ${distro_and_version}/${arch}
pushd ${distro_and_version}/${arch} >/dev/null 2>&1
createrepo .
gpg --default-key "${signer}" --detach-sign --armor repodata/repomd.xml
popd >/dev/null 2>&1
done
done
}
usage () {
cat << EOF
usage: $0 options
This initializes yum repositories for distro/version.
Options:
-h Show this message
-s Signer identification string
-a Arch to target. Defaults: ${ARCH}
-d distro/version to target ex. -d fedora/16
EOF
}
while getopts "hd:a:s:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
s)
SIGNER=$OPTARG
;;
a)
ARCH=$OPTARG
;;
d)
DIST_VER=$OPTARG
;;
?)
usage
exit 1
esac
done
if [[ -z $ARCH ]]
then
ARCH='i686 i686/debuginfo x86_64 x86_64/debuginfo SRPMS'
fi
if [[ -z $SIGNER ]]
then
SIGNER='Wendall Cada <wendallc@example.com>'
fi
if [[ -z $DIST_VER ]]
then
usage
exit 1
else
initrepo
fi