aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-07-03 08:46:41 +0000
committermerakor <cem@ckyln.com>2021-07-03 08:46:41 +0000
commiteecbf33e5c4fcabd9e8b24a1fd442a3d9c3c51f8 (patch)
treead69889dd726c3df2f946b2f6f80fdf42d82cf77
parent01d203d3315cae1d9ee0aa11fe20510cb5b81897 (diff)
downloadcpt-eecbf33e5c4fcabd9e8b24a1fd442a3d9c3c51f8.tar.gz
_multiply_char: add function to generate characters
FossilOrigin-Name: daf41c997422fed2029c7c4d998c2612fa50b6376a37ae030dd177028cfcddbe
-rwxr-xr-xsrc/cpt-install7
-rw-r--r--src/cpt-lib.in8
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