summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-05-04 00:10:58 +0200
committerDave Reisner <dreisner@archlinux.org>2012-05-12 15:30:32 +0200
commit9340f901fec092fde44c8322bb500c4d18f0f222 (patch)
tree2f0e9d75f535a6febbbaa2b78f78b7c6d084dda4
parenta4e770eb3c648f36c33bb8edc54fc7d356d87eff (diff)
downloadmkinitcpio-9340f901fec092fde44c8322bb500c4d18f0f222.tar.gz
mkinitcpio-9340f901fec092fde44c8322bb500c4d18f0f222.tar.xz
remove unnecessary quoting/bracing
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--functions8
-rwxr-xr-xmkinitcpio10
2 files changed, 9 insertions, 9 deletions
diff --git a/functions b/functions
index 9d572fc..5956dc3 100644
--- a/functions
+++ b/functions
@@ -229,7 +229,7 @@ checked_modules() {
# modules.
# $@: arguments to all_modules
- if [[ -s "$MODULE_FILE" ]]; then
+ if [[ -s $MODULE_FILE ]]; then
grep -xFf "$MODULE_FILE" <(all_modules "$@")
return 1
else
@@ -360,7 +360,7 @@ add_file() {
[[ -f $src ]] || { error "file not found: \`%s'" "$src"; return 1; }
mode=${3:-$(stat -c %a "$src")}
- if [[ -z "$mode" ]]; then
+ if [[ -z $mode ]]; then
error "failed to stat file: \`%s'." "$src"
return 1
fi
@@ -390,7 +390,7 @@ add_binary() {
binary=$1
fi
- [[ -f "$binary" ]] || { error "file not found: \`%s'" "$1"; return 1; }
+ [[ -f $binary ]] || { error "file not found: \`%s'" "$1"; return 1; }
dest=${2:-$binary}
mode=$(stat -c %a "$binary")
@@ -403,7 +403,7 @@ add_binary() {
# resolve sodeps
regex='(/.+) \(0x[a-fA-F0-9]+\)'
while read line; do
- [[ "$line" =~ $regex ]] && sodep=${BASH_REMATCH[1]} || continue
+ [[ $line =~ $regex ]] && sodep=${BASH_REMATCH[1]} || continue
if [[ -f $sodep && ! -e $BUILDROOT$sodep ]]; then
if [[ ! -L $sodep ]]; then
diff --git a/mkinitcpio b/mkinitcpio
index 1c92a27..9a74a8b 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -240,10 +240,10 @@ mkdir -p "$BUILDROOT/usr/lib/modules/$KERNELVERSION/kernel"
# use preset $PRESET
if [[ $PRESET ]]; then
# allow absolute path to preset file, else resolve it
- if [[ "${PRESET:0:1}" != '/' ]]; then
+ if [[ ${PRESET:0:1} != '/' ]]; then
printf -v PRESET '%s/%s.preset' "$PRESETDIR" "$PRESET"
fi
- if [[ -f "$PRESET" ]]; then
+ if [[ -f $PRESET ]]; then
# Use -b, -m and -v options specified earlier
declare -a preset_mkopts preset_cmd
(( QUIET )) || preset_mkopts+=(-v)
@@ -298,7 +298,7 @@ if [[ $GENIMG ]]; then
fi
fi
-if [[ ! -f "$CONFIG" ]]; then
+if [[ ! -f $CONFIG ]]; then
die "Config file does not exist: \`%s'" "$CONFIG"
fi
. "$CONFIG"
@@ -416,9 +416,9 @@ trap ERR
declare -i status=0
declare -a pipesave
-if [[ "${GENIMG}" ]]; then
+if [[ $GENIMG ]]; then
msg "Creating $COMPRESSION initcpio image: %s" "$GENIMG"
- [[ "$COMPRESSION" = xz ]] && COMPRESSION_OPTIONS+=" --check=crc32"
+ [[ $COMPRESSION = xz ]] && COMPRESSION_OPTIONS+=" --check=crc32"
# write version stamp
printf '%s' "$version" > "$BUILDROOT/VERSION"