-
Notifications
You must be signed in to change notification settings - Fork 11
/
ci-rpm-common
executable file
·81 lines (76 loc) · 2.59 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
export REMOVERPMS="libnozzle1 libknet1 libqb* corosynclib libcorosync* resource-agents libpacemaker-devel pacemaker-libs-devel pacemaker-schemas fence-agents fence-agents-common corosync-qdevice-devel dlm*"
cleanbr() {
if [ -n "$(which yum 2>/dev/null)" ]; then
yum remove -y $REMOVERPMS || true
rm -rf /etc/yum.repos.d/kronosnet-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/pacemaker-build.repo || true
rm -rf /etc/yum.repos.d/corosync-qdevice-build.repo || true
rm -rf /etc/yum.repos.d/sbd-build.repo || true
rm -rf /etc/yum.repos.d/fence-agents-build.repo || true
rm -rf /etc/yum.repos.d/resource-agents-build.repo || true
rm -rf /etc/yum.repos.d/booth-build.repo || true
rm -rf /etc/yum.repos.d/dlm-build.repo || true
rm -rf /etc/yum.repos.d/gfs2utils-build.repo || true
yum clean all
fi
}
# always restore BaseOS libqb-devel
removerpmdeps() {
cleanbr
osdeps="libqb-devel"
case ${NODE_NAME} in
*ci-test*)
osdeps="$osdeps libknet1-devel"
;;
esac
if [ -n "$(which yum 2>/dev/null)" ]; then
yum install -y $osdeps
fi
return $1
}
installrpmdeps() {
if [ "x$bootstrap" = "x1" ]; then
ret="true"
else
ret="removerpmdeps 1"
fi
cleanbr
if [ -n "$(which yum 2>/dev/null)" ]; then
if [ -n "$KRONOSNET_REPO" ]; then
wget -4 -O /etc/yum.repos.d/kronosnet-build.repo $KRONOSNET_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 "$PACEMAKER_REPO" ]; then
wget -4 -O /etc/yum.repos.d/pacemaker-build.repo $PACEMAKER_REPO || $ret
fi
if [ -n "$COROSYNC_QDEVICE_REPO" ]; then
wget -4 -O /etc/yum.repos.d/corosync-qdevice-build.repo $COROSYNC_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 "$FENCE_AGENTS_REPO" ]; then
wget -4 -O /etc/yum.repos.d/fence-agents-build.repo $FENCE_AGENTS_REPO || $ret
fi
if [ -n "$RESOURCE_AGENTS_REPO" ]; then
wget -4 -O /etc/yum.repos.d/resource-agents-build.repo $RESOURCE_AGENTS_REPO || $ret
fi
if [ -n "$BOOTH_REPO" ]; then
wget -4 -O /etc/yum.repos.d/booth-build.repo $BOOTH_REPO || $ret
fi
if [ -n "$DLM_REPO" ]; then
wget -4 -O /etc/yum.repos.d/dlm-build.repo $DLM_REPO || $ret
fi
if [ -n "$GFS2UTILS_REPO" ]; then
wget -4 -O /etc/yum.repos.d/gfs2utils-build.repo $GFS2UTILS_REPO || $ret
fi
yum install -y $RPMDEPS || removerpmdeps 1
fi
}