aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-10-04 20:18:20 +0000
committermerakor <cem@ckyln.com>2020-10-04 20:18:20 +0000
commite9ab013442130b5c59fd8636f4ac33246bfe250f (patch)
tree6528b5f5b3a2df1344b874f22f371bcfa0ae87bf
parent10f0543d2e521dcea53839ff87438a774ede44ef (diff)
downloadcpt-e9ab013442130b5c59fd8636f4ac33246bfe250f.tar.gz
cpt-lib: readability changes
FossilOrigin-Name: 22de97074943e7b5a08e937799c14423892a95033dc33bc0e8ca165ea6ad4cbd
-rw-r--r--src/cpt-lib12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cpt-lib b/src/cpt-lib
index 6686a81..8509776 100644
--- a/src/cpt-lib
+++ b/src/cpt-lib
@@ -290,7 +290,8 @@ contains() {
regesc() {
# Escape special regular expression characters as
# defined in POSIX BRE. '$.*[\^'
- printf '%s\n' "$1" | sed 's|\\|\\\\|g;s|\[|\\[|g;s|\$|\\$|g;s|\.|\\.|g;s|\*|\\*|g;s|\^|\\^|g'
+ printf '%s\n' "$1" |
+ sed 's|\\|\\\\|g;s|\[|\\[|g;s|\$|\\$|g;s|\.|\\.|g;s|\*|\\*|g;s|\^|\\^|g'
}
@@ -315,8 +316,8 @@ as_root() {
# 'doas' or 'su'. Hurrah for choice.
[ "$uid" = 0 ] || log "Using '${su:-su}' (to become ${user:=root})"
- # We are exporting package manager variables, so that we still have the same
- # repository paths / access to the same cache directories etc.
+ # We are exporting package manager variables, so that we still have the
+ # same repository paths / access to the same cache directories etc.
set -- HOME="$HOME" \
USER="$user" \
XDG_CACHE_HOME="$XDG_CACHE_HOME" \
@@ -513,7 +514,10 @@ pkg_sources() {
while read -r src dest || [ "$src" ]; do
# Remote git/hg repository or comment.
- if [ -z "${src##\#*}" ] || [ -z "${src##git+*}" ] || [ -z "${src##hg+*}" ]
+ if [ -z "${src##\#*}" ] ||
+ [ -z "${src##git+*}" ] ||
+ [ -z "${src##hg+*}" ]
+
then :
# Remote source (cached).