@@ -99,7 +99,7 @@ builtin unset MAILPATH
9999
100100# shellcheck disable=SC2034
101101{
102- declare BL64_VERSION='22.6.3 '
102+ declare BL64_VERSION='22.6.4 '
103103
104104 #
105105 # Imported generic shell standard variables
@@ -293,38 +293,36 @@ function bl64_lib_var_is_default {
293293# Private functions
294294#
295295
296+ # shellcheck disable=SC2164
296297function _bl64_lib_script_get_path() {
297298 local -i main=${#BASH_SOURCE[*]}
298299 local caller=''
300+ local current_path="$PWD"
301+ local current_cdpath=''
299302
300303 ((main > 0)) && main=$((main - 1))
301304 caller="${BASH_SOURCE[${main}]}"
302305
303- unset CDPATH &&
304- [[ -n "$caller" ]] &&
305- cd -- "${caller%/*}" >/dev/null &&
306- pwd -P ||
307- return $?
306+ caller="${caller%/*}"
307+ if [[ -n "$caller" ]]; then
308+ [[ -n "${CDPATH:-}" ]] && current_cdpath="$CDPATH"
309+ cd -- "$caller" >/dev/null 2>&1 &&
310+ pwd -P
311+ [[ -n "$current_cdpath" ]] && CDPATH="$current_cdpath"
312+ cd "$current_path"
313+ fi
308314}
309315
310316function _bl64_lib_script_get_name() {
311- local -i main=0
312- local path=''
313317 local base=''
314318
315- main=${#BASH_SOURCE[*]}
316- ((main > 0)) && main=$((main - 1))
317- path="${BASH_SOURCE[${main}]}"
318-
319- if [[ -n "$path" && "$path" != '/' ]]; then
320- base="${path##*/}"
319+ if [[ -n "$BL64_SCRIPT_PATH" && "$BL64_SCRIPT_PATH" != '/' ]]; then
320+ base="${BL64_SCRIPT_PATH##*/}"
321321 fi
322322 if [[ -z "$base" || "$base" == */* ]]; then
323- # shellcheck disable=SC2086
324- return $BL64_LIB_ERROR_PARAMETER_INVALID
325- else
326- printf '%s' "$base"
323+ base='noname'
327324 fi
325+ printf '%s' "$base"
328326}
329327
330328#######################################
@@ -1327,7 +1325,7 @@ function bl64_lib_script_minver_check() {
13271325
13281326# shellcheck disable=SC2034
13291327{
1330- declare BL64_PKG_VERSION='6.5.0 '
1328+ declare BL64_PKG_VERSION='6.5.1 '
13311329
13321330 declare BL64_PKG_MODULE='0'
13331331
@@ -15178,13 +15176,12 @@ function bl64_pkg_upgrade() {
1517815176 ;;
1517915177 ${BL64_OS_ARC}-*)
1518015178 bl64_check_privilege_root &&
15181- bl64_pkg_run_pacman --upgrade $BL64_PKG_SET_ASSUME_YES "$@"
15179+ bl64_pkg_run_pacman --sync $BL64_PKG_SET_ASSUME_YES "$@"
1518215180 ;;
1518315181 ${BL64_OS_MCOS}-*)
1518415182 bl64_pkg_brew_upgrade "$@"
1518515183 ;;
1518615184 *) bl64_check_alert_unsupported ;;
15187-
1518815185 esac
1518915186}
1519015187
@@ -15248,7 +15245,6 @@ function bl64_pkg_cleanup() {
1524815245 bl64_pkg_brew_cleanup
1524915246 ;;
1525015247 *) bl64_check_alert_unsupported ;;
15251-
1525215248 esac
1525315249}
1525415250
0 commit comments