add version mode into version.cfg

This commit is contained in:
gentle_hu
2024-07-18 15:53:40 +08:00
parent 16864a20d0
commit da517259e9
5 changed files with 36 additions and 10 deletions

View File

@ -529,6 +529,10 @@ function install_gaussdb()
commitid=$(LD_PRELOAD='' ${BUILD_DIR}/bin/gaussdb -V | cut -d ")" -f 1 | awk '{print $NF}')
echo "${commitid}" >>${SCRIPT_DIR}/version.cfg
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
#insert the version mode to version.cfg
echo "$version_mode" >> ${SCRIPT_DIR}/version.cfg
echo "End insert version mode into version cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
@ -811,4 +815,4 @@ mkdir ${ROOT_DIR}/output
mv ${ROOT_DIR}/build/script/*.tar.gz ${ROOT_DIR}/output/
test -e ${ROOT_DIR}/build/script/gaussdb.map && mv ${ROOT_DIR}/build/script/gaussdb.map ${ROOT_DIR}/output/
echo "now, all packages has finished!"
exit 0
exit 0

View File

@ -63,6 +63,15 @@ function get_kernel_commitid()
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
##insert the version mode to version.cfg
#######################################################################
function get_version_mode()
{
echo "$version_mode" >> ${SCRIPT_DIR}/version.cfg
echo "End insert version mode into version cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
## generate the version file.
#######################################################################
@ -157,6 +166,9 @@ function install_gaussdb()
#insert the commitid to version.cfg as the upgrade app path specification
get_kernel_commitid
#insert the version mode to version.cfg
get_version_mode
}
#######################################################################
@ -177,4 +189,4 @@ function gaussdb_build()
echo "please input right paramenter values server or libpq "
exit 1
esac
}
}

View File

@ -70,6 +70,15 @@ function get_kernel_commitid()
echo "End insert commitid into version.cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
##insert the version mode to version.cfg
#######################################################################
function get_version_mode()
{
echo "$version_mode" >> ${SCRIPT_DIR}/version.cfg
echo "End insert version mode into version cfg" >> "$LOG_FILE" 2>&1
}
#######################################################################
## generate the version file.
#######################################################################
@ -320,6 +329,7 @@ function install_gaussdb()
chmod 444 ${BUILD_DIR}/bin/cluster_guc.conf
dos2unix ${BUILD_DIR}/bin/cluster_guc.conf > /dev/null 2>&1
get_kernel_commitid
get_version_mode
}
#######################################################################

View File

@ -298,14 +298,14 @@ function check_version() {
if [[ ! -f ${GAUSSHOME}/version.cfg ]]; then
die "Cannot find current version.cfg!" ${err_upgrade_pre}
fi
old_version=$(tail -n 1 $GAUSSHOME/version.cfg)
old_version=$(sed -n 3p $GAUSSHOME/version.cfg)
old_cfg=$(sed -n 2p "$GAUSSHOME"/version.cfg | sed 's/\.//g')
# get new version
if [[ ! -f $UPGRADE_NEW_PKG_PATH/version.cfg ]]; then
die "Cannot find new version.cfg!" ${err_upgrade_pre}
fi
new_version=$(tail -n 1 $UPGRADE_NEW_PKG_PATH/version.cfg)
new_version=$(sed -n 3p $UPGRADE_NEW_PKG_PATH/version.cfg)
new_cfg=$(sed -n 2p $UPGRADE_NEW_PKG_PATH/version.cfg | sed 's/\.//g')
if [[ X"$old_version" == X || X"$old_cfg" == X || X"$new_version" == X || X"$new_cfg" == X ]]; then
@ -510,7 +510,7 @@ function cp_pkg() {
new_bin_path="$GAUSS_TMP_PATH"/install_bin_"$new_version"
fi
#check pkg's version.cfg is equal to version_flag
temppkg_version=$(tail -n 1 "$new_bin_path"/version.cfg)
temppkg_version=$(sed -n 3p "$new_bin_path"/version.cfg)
if [[ "$new_version" != "$temppkg_version" ]]; then
die "pkg's version.cfg is not correct!" ${err_upgrade_bin}
fi
@ -1076,7 +1076,7 @@ function check_real_gaussdb_version() {
die "Get real gaussdb version failed" ${err_upgrade_bin}
fi
local new_version=""
new_version=`tail -n 1 $UPGRADE_NEW_PKG_PATH/version.cfg`
new_version=`sed -n 3p $UPGRADE_NEW_PKG_PATH/version.cfg`
debug "new_version: $new_version"
debug "real_gaussdb_version: $real_gaussdb_version"
if ! echo "$real_gaussdb_version" | grep "$new_version" > /dev/null; then

View File

@ -275,7 +275,7 @@ function check_version() {
if [[ ! -f "${GAUSSHOME}/version.cfg" ]]; then
die "Cannot find current version.cfg!" ${err_upgrade_pre}
else
old_version=$(tail -n 1 "$GAUSSHOME"/version.cfg)
old_version=$(sed -n 3p "$GAUSSHOME"/version.cfg)
old_cfg=$(sed -n 2p "$GAUSSHOME"/version.cfg | sed 's/\.//g')
fi
if [[ -f "$GAUSS_UPGRADE_BIN_PATH"/version.cfg ]]; then
@ -286,7 +286,7 @@ function check_version() {
die "Cannot find new version.cfg!" ${err_upgrade_pre}
fi
new_version=$(tail -n 1 "$new_version_cfg_path")
new_version=$(sed -n 3p "$new_version_cfg_path")
new_cfg=$(sed -n 2p "$new_version_cfg_path" | sed 's/\.//g')
if [[ X"$old_version" == X || X"$old_cfg" == X || X"$new_version" == X || X"$new_cfg" == X ]]; then
@ -503,7 +503,7 @@ function cp_pkg() {
die "chmod files or dirs failed" ${err_upgrade_bin}
fi
#check pkg's version.cfg is equal to version_flag
temppkg_version=$(tail -n 1 "$new_bin_path"/version.cfg)
temppkg_version=$(sed -n 3p "$new_bin_path"/version.cfg)
if [[ "$new_version" != "$temppkg_version" ]]; then
die "pkg's version.cfg is not correct!" ${err_upgrade_bin}
fi
@ -1253,4 +1253,4 @@ function delete_tmp_files() {
fi
rm -f "$GAUSS_TMP_PATH"/version_flag
rm -f "$GAUSS_TMP_PATH"/record_step.txt
}
}