fix: packaging/tools/install.sh for main (#19649)
This commit is contained in:
parent
fd5820b052
commit
0251750c89
|
@ -743,6 +743,34 @@ function is_version_compatible() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deb_erase() {
|
||||||
|
confirm=""
|
||||||
|
while [ "" == "${confirm}" ]; do
|
||||||
|
echo -e -n "${RED}Exist tdengine deb detected, do you want to remove it? [yes|no] ${NC}:"
|
||||||
|
read confirm
|
||||||
|
if [ "yes" == "$confirm" ]; then
|
||||||
|
${csudo}dpkg --remove tdengine ||:
|
||||||
|
break
|
||||||
|
elif [ "no" == "$confirm" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
rpm_erase() {
|
||||||
|
confirm=""
|
||||||
|
while [ "" == "${confirm}" ]; do
|
||||||
|
echo -e -n "${RED}Exist tdengine rpm detected, do you want to remove it? [yes|no] ${NC}:"
|
||||||
|
read confirm
|
||||||
|
if [ "yes" == "$confirm" ]; then
|
||||||
|
${csudo}rpm -e tdengine ||:
|
||||||
|
break
|
||||||
|
elif [ "no" == "$confirm" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function updateProduct() {
|
function updateProduct() {
|
||||||
# Check if version compatible
|
# Check if version compatible
|
||||||
if ! is_version_compatible; then
|
if ! is_version_compatible; then
|
||||||
|
@ -755,6 +783,13 @@ function updateProduct() {
|
||||||
echo "File ${tarName} does not exist"
|
echo "File ${tarName} does not exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if echo $osinfo | grep -qwi "centos"; then
|
||||||
|
rpm -q tdengine 2>&1 > /dev/null && rpm_erase tdengine ||:
|
||||||
|
elif echo $osinfo | grep -qwi "ubuntu"; then
|
||||||
|
dpkg -l tdengine 2>&1 > /dev/null && deb_erase tdengine ||:
|
||||||
|
fi
|
||||||
|
|
||||||
tar -zxf ${tarName}
|
tar -zxf ${tarName}
|
||||||
install_jemalloc
|
install_jemalloc
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue