From e9ab013442130b5c59fd8636f4ac33246bfe250f Mon Sep 17 00:00:00 2001 From: merakor Date: Sun, 4 Oct 2020 20:18:20 +0000 Subject: cpt-lib: readability changes FossilOrigin-Name: 22de97074943e7b5a08e937799c14423892a95033dc33bc0e8ca165ea6ad4cbd --- src/cpt-lib | 12 ++++++++---- 1 file 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). -- cgit v1.2.3