aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2020-11-10 21:30:29 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2020-11-11 21:29:55 +0800
commit7863c33ceaf155783861aa434cc81b5cf37f7a15 (patch)
treefbc749adcdf5d06aa0b017ceb6610e9ecb1e4aba /package/base-files
parent826bb13742727300565b9d5785421813443d4de6 (diff)
downloadupstream-7863c33ceaf155783861aa434cc81b5cf37f7a15.tar.gz
upstream-7863c33ceaf155783861aa434cc81b5cf37f7a15.tar.bz2
upstream-7863c33ceaf155783861aa434cc81b5cf37f7a15.zip
base-files: upgrade: add vn and variants
To be used with in the following pattern vn "Remaining: " for p in $xx; do _vn "$p" done _v Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/upgrade/common.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 2ae83f5bfb..0f25199365 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -63,8 +63,20 @@ ask_bool() {
[ "$answer" -gt 0 ]
}
+_v() {
+ [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2
+}
+
+_vn() {
+ [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2
+}
+
v() {
- [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2
+ _v "$(date) upgrade: $@"
+}
+
+vn() {
+ _vn "$(date) upgrade: $@"
}
json_string() {