This repository was archived by the owner on May 27, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -474,7 +474,7 @@ chimage_out_validate () {
474474 FATAL " exists in ch-image storage, not deleting per --no-clobber: ${1} "
475475 fi
476476 if [ -n " $xattrs " ]; then
477- WARNING " --xattrs unsupported for out format \" ch-image\" "
477+ WARNING -- " --xattrs unsupported for out format \" ch-image\" "
478478 fi
479479}
480480
Original file line number Diff line number Diff line change @@ -13,6 +13,17 @@ ch_lib=${ch_bin}/../lib
1313# Python code.
1414log_level=0
1515
16+ # Logging functions. Note that we disable SC2059 because we want these functions
17+ # to behave exactly like printf(1), e.g. we want
18+ #
19+ # >>> VERBOSE "foo %s" "bar"
20+ # foo bar
21+ #
22+ # Implementing the suggestion in SC2059 would instead result in something like
23+ #
24+ # >>> VERBOSE "foo %s" "bar"
25+ # foo %sbar
26+
1627DEBUG () {
1728 if [ " $log_level " -ge 2 ]; then
1829 # shellcheck disable=SC2059
@@ -45,6 +56,15 @@ VERBOSE () {
4556 fi
4657}
4758
59+ WARNING () {
60+ if [ " $log_level " -ge -1 ]; then
61+ printf ' warning: ' 1>&2
62+ # shellcheck disable=SC2059
63+ printf " $@ " 1>&2
64+ printf ' \n' 1>&2
65+ fi
66+ }
67+
4868# Return success if path $1 exists, without dereferencing links, failure
4969# otherwise. (“test -e” dereferences.)
5070exist_p () {
You can’t perform that action at this time.
0 commit comments