提交 29c5d777 编写于 作者: H Hui Li

[add link for libtaos.so to /usr/lib64]

上级 32c81edc
...@@ -10,6 +10,7 @@ set -e ...@@ -10,6 +10,7 @@ set -e
# -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...] # -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...]
# -V [stable | beta] # -V [stable | beta]
# -l [full | lite] # -l [full | lite]
# -n [2.0.0.3]
# set parameters by default value # set parameters by default value
verMode=edge # [cluster, edge] verMode=edge # [cluster, edge]
...@@ -17,8 +18,9 @@ verType=stable # [stable, beta] ...@@ -17,8 +18,9 @@ verType=stable # [stable, beta]
cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...] cpuType=x64 # [aarch32 | aarch64 | x64 | x86 | mips64 ...]
osType=Linux # [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...] osType=Linux # [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...]
pagMode=full # [full | lite] pagMode=full # [full | lite]
verNumber=""
while getopts "hv:V:c:o:l:" arg while getopts "hv:V:c:o:l:n:" arg
do do
case $arg in case $arg in
v) v)
...@@ -37,12 +39,16 @@ do ...@@ -37,12 +39,16 @@ do
#echo "pagMode=$OPTARG" #echo "pagMode=$OPTARG"
pagMode=$(echo $OPTARG) pagMode=$(echo $OPTARG)
;; ;;
n)
#echo "verNumber=$OPTARG"
verNumber=$(echo $OPTARG)
;;
o) o)
#echo "osType=$OPTARG" #echo "osType=$OPTARG"
osType=$(echo $OPTARG) osType=$(echo $OPTARG)
;; ;;
h) h)
echo "Usage: `basename $0` -v [cluster | edge] -c [aarch32 | aarch64 | x64 | x86 | mips64 ...] -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...] -V [stable | beta] -l [full | lite]" echo "Usage: `basename $0` -v [cluster | edge] -c [aarch32 | aarch64 | x64 | x86 | mips64 ...] -o [Linux | Kylin | Alpine | Raspberrypi | Darwin | Windows | ...] -V [stable | beta] -l [full | lite] -n [version number]"
exit 0 exit 0
;; ;;
?) #unknow option ?) #unknow option
...@@ -52,7 +58,7 @@ do ...@@ -52,7 +58,7 @@ do
esac esac
done done
echo "verMode=${verMode} verType=${verType} cpuType=${cpuType} osType=${osType} pagMode=${pagMode}" echo "verMode=${verMode} verType=${verType} cpuType=${cpuType} osType=${osType} pagMode=${pagMode} verNumber=${verNumber}"
curr_dir=$(pwd) curr_dir=$(pwd)
...@@ -80,7 +86,6 @@ function is_valid_version() { ...@@ -80,7 +86,6 @@ function is_valid_version() {
if [[ $1 =~ $rx ]]; then if [[ $1 =~ $rx ]]; then
return 0 return 0
fi fi
return 1 return 1
} }
...@@ -89,26 +94,25 @@ function vercomp () { ...@@ -89,26 +94,25 @@ function vercomp () {
echo 0 echo 0
exit 0 exit 0
fi fi
local IFS=. local IFS=.
local i ver1=($1) ver2=($2) local i ver1=($1) ver2=($2)
# fill empty fields in ver1 with zeros # fill empty fields in ver1 with zeros
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
ver1[i]=0 ver1[i]=0
done done
for ((i=0; i<${#ver1[@]}; i++)); do for ((i=0; i<${#ver1[@]}; i++)); do
if [[ -z ${ver2[i]} ]] if [[ -z ${ver2[i]} ]]; then
then
# fill empty fields in ver2 with zeros # fill empty fields in ver2 with zeros
ver2[i]=0 ver2[i]=0
fi fi
if ((10#${ver1[i]} > 10#${ver2[i]})) if ((10#${ver1[i]} > 10#${ver2[i]})); then
then
echo 1 echo 1
exit 0 exit 0
fi fi
if ((10#${ver1[i]} < 10#${ver2[i]})) if ((10#${ver1[i]} < 10#${ver2[i]})); then
then
echo 2 echo 2
exit 0 exit 0
fi fi
...@@ -120,10 +124,11 @@ function vercomp () { ...@@ -120,10 +124,11 @@ function vercomp () {
version=$(cat ${versioninfo} | grep " version" | cut -d '"' -f2) version=$(cat ${versioninfo} | grep " version" | cut -d '"' -f2)
compatible_version=$(cat ${versioninfo} | grep " compatible_version" | cut -d '"' -f2) compatible_version=$(cat ${versioninfo} | grep " compatible_version" | cut -d '"' -f2)
while true; do if [ -z ${verNumber} ]; then
read -p "Do you want to release a new version? [y/N]: " is_version_change while true; do
read -p "Do you want to release a new version? [y/N]: " is_version_change
if [[ ( "${is_version_change}" == "y") || ( "${is_version_change}" == "Y") ]]; then if [[ ( "${is_version_change}" == "y") || ( "${is_version_change}" == "Y") ]]; then
read -p "Please enter the new version: " tversion read -p "Please enter the new version: " tversion
while true; do while true; do
if (! is_valid_version $tversion) || [ "$(vercomp $tversion $version)" = '2' ]; then if (! is_valid_version $tversion) || [ "$(vercomp $tversion $version)" = '2' ]; then
...@@ -152,13 +157,24 @@ while true; do ...@@ -152,13 +157,24 @@ while true; do
done done
break break
elif [[ ( "${is_version_change}" == "n") || ( "${is_version_change}" == "N") ]]; then elif [[ ( "${is_version_change}" == "n") || ( "${is_version_change}" == "N") ]]; then
echo "Use old version: ${version} compatible version: ${compatible_version}." echo "Use old version: ${version} compatible version: ${compatible_version}."
break break
else else
continue continue
fi fi
done done
else
echo "old version: $version, new version: $verNumber"
#if ( ! is_valid_version $verNumber ) || [[ "$(vercomp $version $verNumber)" == '2' ]]; then
# echo "please enter correct version"
# exit 0
#else
version=${verNumber}
#fi
fi
echo "=======================new version number: ${version}======================================"
# output the version info to the buildinfo file. # output the version info to the buildinfo file.
build_time=$(date +"%F %R") build_time=$(date +"%F %R")
......
...@@ -196,8 +196,10 @@ function install_lib() { ...@@ -196,8 +196,10 @@ function install_lib() {
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.so.1 ${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.so.1
${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so ${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib64_link_dir}/libtaos.so.1 || : if [ -d ${lib64_link_dir} ]; then
${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || : ${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib64_link_dir}/libtaos.so.1 || :
${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || :
fi
#if [ "$verMode" == "cluster" ]; then #if [ "$verMode" == "cluster" ]; then
# # Compatible with version 1.5 # # Compatible with version 1.5
......
...@@ -91,7 +91,7 @@ function install_bin() { ...@@ -91,7 +91,7 @@ function install_bin() {
${csudo} cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo} chmod 0555 ${install_main_dir}/bin/* ${csudo} cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo} chmod 0555 ${install_main_dir}/bin/*
#Make link #Make link
[ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || : [ -x ${install_main_dir}/bin/taos ] && ${csudo} ln -s ${install_main_dir}/bin/taos ${bin_link_dir}/taos || :
if [ "$osType" == "Darwin" ]; then if [ "$osType" == "Darwin" ]; then
[ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || : [ -x ${install_main_dir}/bin/taosdump ] && ${csudo} ln -s ${install_main_dir}/bin/taosdump ${bin_link_dir}/taosdump || :
...@@ -115,8 +115,11 @@ function install_lib() { ...@@ -115,8 +115,11 @@ function install_lib() {
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.so.1 ${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.so.1
${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so ${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib64_link_dir}/libtaos.so.1 || :
${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || : if [ -d "${lib64_link_dir}" ]; then
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib64_link_dir}/libtaos.so.1 || :
${csudo} ln -s ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so || :
fi
else else
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.1.dylib ${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.1.dylib
${csudo} ln -s ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib ${csudo} ln -s ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib
......
...@@ -34,6 +34,7 @@ cfg_install_dir="/etc/taos" ...@@ -34,6 +34,7 @@ cfg_install_dir="/etc/taos"
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
bin_link_dir="/usr/bin" bin_link_dir="/usr/bin"
lib_link_dir="/usr/lib" lib_link_dir="/usr/lib"
lib64_link_dir="/usr/lib64"
inc_link_dir="/usr/include" inc_link_dir="/usr/include"
else else
bin_link_dir="/usr/local/bin" bin_link_dir="/usr/local/bin"
...@@ -173,12 +174,18 @@ function install_bin() { ...@@ -173,12 +174,18 @@ function install_bin() {
function install_lib() { function install_lib() {
# Remove links # Remove links
${csudo} rm -f ${lib_link_dir}/libtaos.* || : ${csudo} rm -f ${lib_link_dir}/libtaos.* || :
${csudo} rm -f ${lib64_link_dir}/libtaos.* || :
versioninfo=$(${script_dir}/get_version.sh ${source_dir}/src/util/src/version.c) versioninfo=$(${script_dir}/get_version.sh ${source_dir}/src/util/src/version.c)
if [ "$osType" != "Darwin" ]; then if [ "$osType" != "Darwin" ]; then
${csudo} cp ${binary_dir}/build/lib/libtaos.so.${versioninfo} ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/* ${csudo} cp ${binary_dir}/build/lib/libtaos.so.${versioninfo} ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/*
${csudo} ln -sf ${install_main_dir}/driver/libtaos.so.${versioninfo} ${lib_link_dir}/libtaos.so.1 ${csudo} ln -sf ${install_main_dir}/driver/libtaos.so.${versioninfo} ${lib_link_dir}/libtaos.so.1
${csudo} ln -sf ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so ${csudo} ln -sf ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so
if [ -d "${lib64_link_dir}" ]; then
${csudo} ln -sf ${install_main_dir}/driver/libtaos.so.${versioninfo} ${lib64_link_dir}/libtaos.so.1
${csudo} ln -sf ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so
fi
else else
${csudo} cp ${binary_dir}/build/lib/libtaos.${versioninfo}.dylib ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/* ${csudo} cp ${binary_dir}/build/lib/libtaos.${versioninfo}.dylib ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/*
${csudo} ln -sf ${install_main_dir}/driver/libtaos.${versioninfo}.dylib ${lib_link_dir}/libtaos.1.dylib ${csudo} ln -sf ${install_main_dir}/driver/libtaos.${versioninfo}.dylib ${lib_link_dir}/libtaos.1.dylib
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册