mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-21 11:12:04 +00:00
Create switchprobe link during xCAT-probe installation (#5272)
* Create switchprobe link during xCAT-probe installation * remove debug message * Modify upgrade path * make symbolic link
This commit is contained in:
parent
7576e04e24
commit
cc158f7755
1
makerpm
1
makerpm
@ -13,7 +13,6 @@ function xcat_probe_copy {
|
||||
# xCAT-probe uses some functions shipped with xCAT, copying for the following reasons:
|
||||
# 1. make xCAT-probe code be self-contained
|
||||
# 2. do not maintain two files for each script
|
||||
# 3. symbolic link can't work during packaging
|
||||
RPMNAME=${1}
|
||||
if [ $RPMNAME = "xCAT-probe" ]; then
|
||||
mkdir -p ${RPMNAME}/lib/perl/xCAT/
|
||||
|
@ -53,13 +53,6 @@ if ($help) {
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if (!-d "$currdir/bin") {
|
||||
mkpath("$currdir/bin/");
|
||||
}
|
||||
if (!-e "$currdir/bin/switchprobe") {
|
||||
link("$::XCATROOT/bin/xcatclient", "$currdir/bin/switchprobe");
|
||||
}
|
||||
|
||||
if ($test) {
|
||||
`$currdir/bin/switchprobe -h`;
|
||||
if ($?) {
|
||||
|
@ -61,5 +61,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
- "Create xCAT probe package"
|
||||
|
||||
%post
|
||||
if [ -e %{prefix}/probe/subcmds/bin/switchprobe ]; then
|
||||
rm -rf %{prefix}/probe/subcmds/bin/switchprobe
|
||||
else
|
||||
mkdir -p %{prefix}/probe/subcmds/bin/
|
||||
fi
|
||||
cd %{prefix}/probe/subcmds/bin/
|
||||
if [ -e %{prefix}/bin/xcatclient ]; then
|
||||
ln -s %{prefix}/bin/xcatclient switchprobe
|
||||
fi
|
||||
|
||||
%preun
|
||||
#remove the bin directory if not on upgrade
|
||||
if [ "$1" != "1" ]; then
|
||||
rm -rf %{prefix}/probe/subcmds/bin/
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user