summaryrefslogtreecommitdiffstats
path: root/mkinitcpio
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-08-11 23:14:53 +0200
committerAaron Griffin <aaron@archlinux.org>2007-08-11 23:14:53 +0200
commit8a47fa9512eb355e8f7cbe4b4e7d28373e706a6c (patch)
tree704564ae3794ae021b112d701bfa24f00577dddd /mkinitcpio
parent2b466a50d4e28f1d30df8eedfcd0bfcd565515d2 (diff)
downloadmkinitcpio-8a47fa9512eb355e8f7cbe4b4e7d28373e706a6c.tar.gz
mkinitcpio-8a47fa9512eb355e8f7cbe4b4e7d28373e706a6c.tar.xz
Coding style change, use -n and -z for variable tests
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@209 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'mkinitcpio')
-rw-r--r--mkinitcpio12
1 files changed, 6 insertions, 6 deletions
diff --git a/mkinitcpio b/mkinitcpio
index db0b773..841659b 100644
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -7,7 +7,7 @@
# following constraints should be enforced:
# variables should be quoted and bracketed "${SOMEVAR}"
# inline execution should be done with $() instead of backticks
-# use "x${var}" = "x" to test for nulls/empty strings
+# use -z "${var}" to test for nulls/empty strings
# incase of embedded spaces, quote all path names and string comarpisons
#
#TODO trap and remove FILELIST
@@ -143,7 +143,7 @@ fi
MODULEDIR="${BASEDIR}/lib/modules/${KERNELVERSION}"
-if [ "x${BASEDIR}" != "x" ]; then
+if [ -n "${BASEDIR}" ]; then
if [ "${BASEDIR:0:1}" != "/" ]; then
BASEDIR="$(pwd)/${BASEDIR}"
elif [ ! -d "${BASEDIR}" ]; then
@@ -158,8 +158,8 @@ if [ ! -f "${CONFIG}" ]; then
fi
source "${CONFIG}"
-if [ -f "${FILELIST}" -a "x${APPEND}" == "x" ]; then
- if [ "x${SAVELIST}" == "x" ]; then
+if [ -f "${FILELIST}" -a -z "${APPEND}" ]; then
+ if [ -z "${SAVELIST}" ]; then
rm ${FILELIST}
touch "${FILELIST}"
else
@@ -230,7 +230,7 @@ if [ "${HAS_MODULES}" == "y" ]; then
fi
status=0
-if [ "x$GENIMG" != "x" ]; then
+if [ -n "$GENIMG" ]; then
echo -n ":: Generating image '${GENIMG}'..."
if ! gen_init_cpio ${FILELIST} | gzip -9 > "${GENIMG}"; then
echo "FAILED"
@@ -240,7 +240,7 @@ if [ "x$GENIMG" != "x" ]; then
status=0
fi
- if [ "x${SAVELIST}" == "x" ]; then
+ if [ -z "${SAVELIST}" ]; then
rm ${FILELIST}
fi
rm ${MESSAGEFILE}