Skip to content

Commit ed41632

Browse files
authored
real: promote 22.6.4 (#105)
1 parent f2f0aaa commit ed41632

File tree

10 files changed

+50
-48
lines changed

10 files changed

+50
-48
lines changed

.dev.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ DEV_TEST_TESTMANSH_CONTAINER_BASH_NON_OS+=' bash-test/sles-15-bash-test:latest'
8181
DEV_TEST_TESTMANSH_CONTAINER_BASH_NON_OS+=' bash-test/debian-11-bash-test:latest'
8282
DEV_TEST_TESTMANSH_CONTAINER_BASH_NON_OS+=' bash-test/rhel-9-bash-test:latest'
8383
export DEV_TEST_TESTMANSH_CONTAINER_BASH_OPT=''
84-
DEV_TEST_TESTMANSH_CONTAINER_BASH_OPT+=' bash-test/alpine-3.19-bash-test:latest'
84+
DEV_TEST_TESTMANSH_CONTAINER_BASH_OPT+=' bash-test/alpine-3-bash-test:latest'
8585
DEV_TEST_TESTMANSH_CONTAINER_BASH_OPT+=' bash-test/sles-15-bash-test:latest'
8686
DEV_TEST_TESTMANSH_CONTAINER_BASH_OPT+=' bash-test/debian-11-bash-test:latest'
8787
DEV_TEST_TESTMANSH_CONTAINER_BASH_OPT+=' bash-test/rhel-9-bash-test:latest'

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [22.6.3]
8+
## [22.6.4]
99

1010
### Added
1111

bashlib64.bash

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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
296297
function _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

310316
function _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

src/bl64-lib-env.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# shellcheck disable=SC2034
66
{
7-
declare BL64_VERSION='22.6.3'
7+
declare BL64_VERSION='22.6.4'
88

99
#
1010
# Imported generic shell standard variables

src/bl64-lib.bash

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,36 @@ function bl64_lib_var_is_default {
2525
# Private functions
2626
#
2727

28+
# shellcheck disable=SC2164
2829
function _bl64_lib_script_get_path() {
2930
local -i main=${#BASH_SOURCE[*]}
3031
local caller=''
32+
local current_path="$PWD"
33+
local current_cdpath=''
3134

3235
((main > 0)) && main=$((main - 1))
3336
caller="${BASH_SOURCE[${main}]}"
3437

35-
unset CDPATH &&
36-
[[ -n "$caller" ]] &&
37-
cd -- "${caller%/*}" >/dev/null &&
38-
pwd -P ||
39-
return $?
38+
caller="${caller%/*}"
39+
if [[ -n "$caller" ]]; then
40+
[[ -n "${CDPATH:-}" ]] && current_cdpath="$CDPATH"
41+
cd -- "$caller" >/dev/null 2>&1 &&
42+
pwd -P
43+
[[ -n "$current_cdpath" ]] && CDPATH="$current_cdpath"
44+
cd "$current_path"
45+
fi
4046
}
4147

4248
function _bl64_lib_script_get_name() {
43-
local -i main=0
44-
local path=''
4549
local base=''
4650

47-
main=${#BASH_SOURCE[*]}
48-
((main > 0)) && main=$((main - 1))
49-
path="${BASH_SOURCE[${main}]}"
50-
51-
if [[ -n "$path" && "$path" != '/' ]]; then
52-
base="${path##*/}"
51+
if [[ -n "$BL64_SCRIPT_PATH" && "$BL64_SCRIPT_PATH" != '/' ]]; then
52+
base="${BL64_SCRIPT_PATH##*/}"
5353
fi
5454
if [[ -z "$base" || "$base" == */* ]]; then
55-
# shellcheck disable=SC2086
56-
return $BL64_LIB_ERROR_PARAMETER_INVALID
57-
else
58-
printf '%s' "$base"
55+
base='noname'
5956
fi
57+
printf '%s' "$base"
6058
}
6159

6260
#######################################

src/bl64-pkg-env.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# shellcheck disable=SC2034
66
{
7-
declare BL64_PKG_VERSION='6.5.0'
7+
declare BL64_PKG_VERSION='6.5.1'
88

99
declare BL64_PKG_MODULE='0'
1010

src/bl64-pkg.bash

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,12 @@ function bl64_pkg_upgrade() {
365365
;;
366366
${BL64_OS_ARC}-*)
367367
bl64_check_privilege_root &&
368-
bl64_pkg_run_pacman --upgrade $BL64_PKG_SET_ASSUME_YES "$@"
368+
bl64_pkg_run_pacman --sync $BL64_PKG_SET_ASSUME_YES "$@"
369369
;;
370370
${BL64_OS_MCOS}-*)
371371
bl64_pkg_brew_upgrade "$@"
372372
;;
373373
*) bl64_check_alert_unsupported ;;
374-
375374
esac
376375
}
377376

@@ -435,7 +434,6 @@ function bl64_pkg_cleanup() {
435434
bl64_pkg_brew_cleanup
436435
;;
437436
*) bl64_check_alert_unsupported ;;
438-
439437
esac
440438
}
441439

test/adhoc/ad-hoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export TESTMANSH_TEST_SAMPLES
2424
# Debugging Control
2525
#
2626

27-
bl64_msg_all_enable_verbose
28-
bl64_dbg_all_enable
27+
#bl64_msg_all_enable_verbose
28+
#bl64_dbg_all_enable
2929
#export BL64_LIB_CICD=YES
3030

3131
#
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@test "_bl64_lib_script_get_name: result" {
2+
. "$TESTMANSH_TEST_BATSCORE_SETUP"
3+
run _bl64_lib_script_get_name
4+
assert_success
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@test "_bl64_lib_script_get_path: result" {
2+
. "$TESTMANSH_TEST_BATSCORE_SETUP"
3+
run _bl64_lib_script_get_path
4+
assert_success
5+
}

0 commit comments

Comments
 (0)