diff options
author | Dave Reisner <d@falconindy.com> | 2011-06-07 00:36:31 +0200 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2011-06-16 22:16:47 +0200 |
commit | b9904b535a4ead62a125bacde38e55c570aacb32 (patch) | |
tree | b0cb4976967d3180f8f24a7b22b8e1c4270e2d90 | |
parent | 8ac91b12cebd54a7eb133cbad4592d497442bd73 (diff) | |
download | mkinitcpio-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-- | functions | 1 | ||||
-rwxr-xr-x | mkinitcpio | 39 |
2 files changed, 15 insertions, 25 deletions
@@ -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. @@ -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 |