-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathci-rpm-common
executable file
·149 lines (144 loc) · 5.12 KB
/
ci-rpm-common
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
export REMOVERPMS="libnozzle1 libknet1 libqb* corosynclib libcorosync* resource-agents libpacemaker-devel pacemaker-libs-devel pacemaker-schemas fence-agents fence-agents-common corosync-qdevice-devel"
cleanbr() {
if [ -n "$(which zypper 2>/dev/null)" ]; then
zypper remove -y $REMOVERPMS || true
zypper removerepo knet-build || true
zypper removerepo libqb-build || true
zypper removerepo corosync-build || true
zypper removerepo pcmk-build || true
zypper removerepo qdevice-build || true
zypper removerepo sbd-build || true
zypper removerepo fas-build || true
zypper removerepo ras-build || true
zypper removerepo booth-build || true
zypper clean
fi
if [ -n "$(which yum 2>/dev/null)" ]; then
yum erase -y $REMOVERPMS || true
rm -rf /etc/yum.repos.d/knet-build.repo || true
rm -rf /etc/yum.repos.d/libqb-build.repo || true
rm -rf /etc/yum.repos.d/corosync-build.repo || true
rm -rf /etc/yum.repos.d/pcmk-build.repo || true
rm -rf /etc/yum.repos.d/qdevice-build.repo || true
rm -rf /etc/yum.repos.d/sbd-build.repo || true
rm -rf /etc/yum.repos.d/fas-build.repo || true
rm -rf /etc/yum.repos.d/ras-build.repo || true
rm -rf /etc/yum.repos.d/booth-build.repo || true
yum clean all
fi
}
# always restore BaseOS libqb-devel
removerpmdeps() {
cleanbr
if [ -n "$(which zypper 2>/dev/null)" ]; then
zypper install -y libqb-devel
fi
if [ -n "$(which yum 2>/dev/null)" ]; then
yum install -y libqb-devel
fi
return $1
}
installrpmdeps() {
if [ "x$bootstrap" = "x1" ]; then
ret="true"
else
ret="removerpmdeps 1"
fi
cleanbr
if [ -n "$(which zypper 2>/dev/null)" ]; then
if [ -n "$KNET_REPO_PATH" ]; then
zypper addrepo $KNET_REPO_PATH knet-build || $ret
zypper modifyrepo -p 1 -e -f -G knet-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $KNET_REPO_PATH; then
zypper removerepo knet-build || true
fi
fi
if [ -n "$LIBQB_REPO_PATH" ]; then
zypper addrepo $LIBQB_REPO_PATH libqb-build || $ret
zypper modifyrepo -p 1 -e -f -G libqb-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $LIBQB_REPO_PATH; then
zypper removerepo libqb-build || true
fi
fi
if [ -n "$COROSYNC_REPO_PATH" ]; then
zypper addrepo $COROSYNC_REPO_PATH corosync-build || $ret
zypper modifyrepo -p 1 -e -f -G corosync-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $COROSYNC_REPO_PATH; then
zypper removerepo corosync-build || true
fi
fi
if [ -n "$PCMK_REPO_PATH" ]; then
zypper addrepo $PCMK_REPO_PATH pcmk-build || $ret
zypper modifyrepo -p 1 -e -f -G pcmk-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $PCMK_REPO_PATH; then
zypper removerepo pcmk-build || true
fi
fi
if [ -n "$QDEVICE_REPO_PATH" ]; then
zypper addrepo $QDEVICE_REPO_PATH qdevice-build || $ret
zypper modifyrepo -p 1 -e -f -G qdevice-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $QDEVICE_REPO_PATH; then
zypper removerepo qdevice-build || true
fi
fi
if [ -n "$SBD_REPO_PATH" ]; then
zypper addrepo $SBD_REPO_PATH sbd-build || $ret
zypper modifyrepo -p 1 -e -f -G sbd-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $SBD_REPO_PATH; then
zypper removerepo sbd-build || true
fi
fi
if [ -n "$FAS_REPO_PATH" ]; then
zypper addrepo $FAS_REPO_PATH fas-build || $ret
zypper modifyrepo -p 1 -e -f -G fas-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $FAS_REPO_PATH; then
zypper removerepo fas-build || true
fi
fi
if [ -n "$RAS_REPO_PATH" ]; then
zypper addrepo $RAS_REPO_PATH ras-build || $ret
zypper modifyrepo -p 1 -e -f -G ras-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $RAS_REPO_PATH; then
zypper removerepo ras-build || true
fi
fi
if [ -n "$BOOTH_REPO_PATH" ]; then
zypper addrepo $BOOTH_REPO_PATH booth-build || $ret
zypper modifyrepo -p 1 -e -f -G booth-build || $ret
if [ "x$bootstrap" = "x1" ] && ! wget -4 -q -O /dev/null $BOOTH_REPO_PATH; then
zypper removerepo booth-build || true
fi
fi
zypper install -y $RPMDEPS || removerpmdeps 1
fi
if [ -n "$(which yum 2>/dev/null)" ]; then
if [ -n "$KNET_REPO" ]; then
wget -4 -O /etc/yum.repos.d/knet-build.repo $KNET_REPO || $ret
fi
if [ -n "$LIBQB_REPO" ]; then
wget -4 -O /etc/yum.repos.d/libqb-build.repo $LIBQB_REPO || $ret
fi
if [ -n "$COROSYNC_REPO" ]; then
wget -4 -O /etc/yum.repos.d/corosync-build.repo $COROSYNC_REPO || $ret
fi
if [ -n "$PCMK_REPO" ]; then
wget -4 -O /etc/yum.repos.d/pcmk-build.repo $PCMK_REPO || $ret
fi
if [ -n "$QDEVICE_REPO" ]; then
wget -4 -O /etc/yum.repos.d/qdevice-build.repo $QDEVICE_REPO || $ret
fi
if [ -n "$SBD_REPO" ]; then
wget -4 -O /etc/yum.repos.d/sbd-build.repo $SBD_REPO || $ret
fi
if [ -n "$FAS_REPO" ]; then
wget -4 -O /etc/yum.repos.d/fas-build.repo $FAS_REPO || $ret
fi
if [ -n "$RAS_REPO" ]; then
wget -4 -O /etc/yum.repos.d/ras-build.repo $RAS_REPO || $ret
fi
if [ -n "$BOOTH_REPO" ]; then
wget -4 -O /etc/yum.repos.d/booth-build.repo $BOOTH_REPO || $ret
fi
yum install -y $RPMDEPS || removerpmdeps 1
fi
}