From eecbf33e5c4fcabd9e8b24a1fd442a3d9c3c51f8 Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 3 Jul 2021 08:46:41 +0000 Subject: _multiply_char: add function to generate characters FossilOrigin-Name: daf41c997422fed2029c7c4d998c2612fa50b6376a37ae030dd177028cfcddbe --- src/cpt-install | 7 +++---- src/cpt-lib.in | 8 ++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cpt-install b/src/cpt-install index aab70ea..44842a3 100755 --- a/src/cpt-install +++ b/src/cpt-install @@ -18,7 +18,6 @@ if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi } pkg_order "$@" - create_cache # shellcheck disable=2154 @@ -30,10 +29,10 @@ unset msg for pkg in $order; do [ -f "$sys_db/$pkg/message" ] && { - printf '%s\n%s\n%s\n\n' \ - "=======================================" \ + printf '\033[1m%s\n%s\n%s\033[m\n\n' \ + "$(_multiply_char '=' 60)" \ "$pkg" \ - "=======================================" + "$(_multiply_char '=' 60)" cat "$sys_db/$pkg/message" >&2 msg=1 } diff --git a/src/cpt-lib.in b/src/cpt-lib.in index e7dfe4c..6b95ee7 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -81,6 +81,14 @@ _seq() ( printf '%s' "$buf" ) +_multiply_char() ( + buf= + for i in $(_seq "$2"); do + buf="$buf$1" + done + out "$buf" +) + _stat() ( _user=; eval set -- "$(ls -ld "$1")" id -u "${_user:=$3}" >/dev/null 2>&1 || _user=root -- cgit v1.2.3