summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-07 00:36:31 +0200
committerDave Reisner <d@falconindy.com>2011-06-16 22:16:47 +0200
commitb9904b535a4ead62a125bacde38e55c570aacb32 (patch)
treeb0cb4976967d3180f8f24a7b22b8e1c4270e2d90
parent8ac91b12cebd54a7eb133cbad4592d497442bd73 (diff)
downloadmkinitcpio-b9904b535a4ead62a125bacde38e55c570aacb32.tar.gz
mkinitcpio-b9904b535a4ead62a125bacde38e55c570aacb32.tar.xz
declare all variables in mkinitcpio
We also consolidate our empty variable declarations in mkinitcpio with a simple declare. Signed-off-by: Dave Reisner <d@falconindy.com>
-rw-r--r--functions1
-rwxr-xr-xmkinitcpio39
2 files changed, 15 insertions, 25 deletions
diff --git a/functions b/functions
index d9abf46..97ffaf3 100644
--- a/functions
+++ b/functions
@@ -158,7 +158,6 @@ add_file() {
fi
}
-declare -a ADDED_MODULES
add_module() {
# Add a kernel module to the initcpio image. Dependencies will be
# discovered and added.
diff --git a/mkinitcpio b/mkinitcpio
index c9a7aa8..95c7923 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -13,33 +13,24 @@
shopt -s extglob
# Settings
-TMPDIR="$(mktemp -d /tmp/mkinitcpio.XXXXXX)"
-BASEDIR=""
-MESSAGEFILE="${TMPDIR}/message"
-KERNELVERSION="$(uname -r)"
-FUNCTIONS="functions"
-CONFIG="mkinitcpio.conf"
-HOOKDIR="hooks"
-INSTDIR="install"
-MODULE_FILE=""
-SAVELIST=""
-GENIMG=""
-PRESET=""
-MESSAGE=""
-SKIPHOOKS=()
-PRESETDIR="mkinitcpio.d"
-QUIET="y"
-SHOW_AUTOMODS="n"
-COMPRESSION="gzip"
-COMPRESSION_OPTIONS=""
-
-if [ ! $UID ]; then
- UID=$(id -u)
-fi
+TMPDIR=$(mktemp -d /tmp/mkinitcpio.XXXXXX)
+MESSAGEFILE=$TMPDIR/message
+KERNELVERSION=$(uname -r)
+FUNCTIONS=functions
+CONFIG=mkinitcpio.conf
+HOOKDIR=hooks
+INSTDIR=install
+PRESETDIR=mkinitcpio.d
+QUIET=y
+SHOW_AUTOMODS=n
+COMPRESSION=gzip
+
+declare BASEDIR MODULE_FILE SAVELIST GENIMG PRESET MESSAGE COMPRESSION_OPTIONS
+declare -a SKIPHOOKS ADDED_MODULES
# Add /{,usr}/sbin to path
# works around undetected problems like in #8448
-PATH="${PATH}:/sbin:/usr/sbin"
+PATH=$PATH:/sbin:/usr/sbin
# Sanitize environment further
# GREP_OPTIONS="--color=always" will break everything
unset GREP_OPTIONS