summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-05-26 21:41:58 +0200
committerDave Reisner <dreisner@archlinux.org>2012-06-08 23:38:57 +0200
commit7965557b65883a6b91de61374764dab1fac778d4 (patch)
treeca095c35b37b24a1001e182ac9c3129651666242
parentdc1b198b0cce1d2da3acd47a442ad64ed92bcad9 (diff)
downloadmkinitcpio-7965557b65883a6b91de61374764dab1fac778d4.tar.gz
mkinitcpio-7965557b65883a6b91de61374764dab1fac778d4.tar.xz
functions: style nits
Avoid using compound commands where one side runs a command group. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--functions14
1 files changed, 11 insertions, 3 deletions
diff --git a/functions b/functions
index 64de5b2..262a08a 100644
--- a/functions
+++ b/functions
@@ -386,7 +386,9 @@ add_dir() {
# $1: pathname on initcpio
# $2: mode (optional)
- { (( ! $# )) || [[ $1 != /?* ]]; } && return 1
+ if [[ -z $1 || $1 != /?* ]]; then
+ return 1
+ fi
local path=$1 mode=${2:-755}
@@ -430,7 +432,10 @@ add_file() {
# determine source and destination
local src=$1 dest=${2:-$1} mode=
- [[ -f $src ]] || { error "file not found: \`%s'" "$src"; return 1; }
+ if [[ ! -f $src ]]; then
+ error "file not found: \`%s'" "$src"
+ return 1
+ fi
mode=${3:-$(stat -c %a "$src")}
if [[ -z $mode ]]; then
@@ -499,7 +504,10 @@ add_binary() {
binary=$1
fi
- [[ -f $binary ]] || { error "file not found: \`%s'" "$1"; return 1; }
+ if [[ ! -f $binary ]]; then
+ error "file not found: \`%s'" "$1"
+ return 1
+ fi
dest=${2:-$binary}
mode=$(stat -c %a "$binary")