summaryrefslogtreecommitdiffstats
path: root/functions
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 /functions
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 'functions')
-rw-r--r--functions20
1 files changed, 10 insertions, 10 deletions
diff --git a/functions b/functions
index abe1cad..69f918b 100644
--- a/functions
+++ b/functions
@@ -6,7 +6,7 @@ auto_modules ()
$aliases 2>/dev/null | sed 's|insmod \(.*\)|\1|' | grep ${@} | sort -u)
echo "${mods}"
- [ "x${mods}" = "x" ] && return 1
+ [ -z "${mods}" ] && return 1
return 0
}
@@ -15,7 +15,7 @@ all_modules ()
mods=$(find ${MODULEDIR} -name *.ko 2>/dev/null | grep ${@} | sort -u)
echo "${mods}"
- [ "x${mods}" = "x" ] && return 1
+ [ -z "${mods}" ] && return 1
return 0
}
@@ -39,7 +39,7 @@ die () { echo "FATAL: ${@}" >&2; exit 1; }
add_full_dir ()
{
- if [ "x${1}" != "x" -a -d "${1}" ]; then
+ if [ -n "${1}" -a -d "${1}" ]; then
for f in ${1}/*; do
if [ -d "${f}" ]; then
add_full_dir "${f}"
@@ -53,7 +53,7 @@ add_full_dir ()
add_dir ()
{
#skip root directory and "." for relative directories... i.e. /foo/bar/./blah
- if [ "x${1}" != "x" -a "${1}" != "/" -a "${1}" != "." ]; then
+ if [ -n "${1}" -a "${1}" != "/" -a "${1}" != "." ]; then
if ! grep "dir ${1} " "${FILELIST}" 2>&1 > /dev/null; then
add_dir $(dirname "${1}")
msg " adding dir ${1}"
@@ -148,7 +148,7 @@ add_module ()
found=0
for path in $(find "${MODULEDIR}" -type f -name "${fil}.ko"); do
for mod in $(/sbin/modinfo -F depends "${path}" | tr ',' ' '); do
- if [ "x${mod}" != "x" ]; then
+ if [ -n "${mod}" ]; then
add_module "${mod}"
HAS_MODULES="y"
fi
@@ -190,7 +190,7 @@ add_binary ()
#note, this will also handle 'not a dynamic executable' spit out by
# static binaries... the deps will produce nothing
for lib in $(ldd ${bin} 2>/dev/null | sed "s|.*=>\(.*\)|\1|"); do
- if [ "x${lib}" != "x" ]; then
+ if [ -n "${lib}" ]; then
#remove TLS libraries
notls=$(echo ${lib} | sed 's|/lib/tls.*/\(lib.*\)|/lib/\1|')
[ -e "${notls}" ] && lib="${notls}"
@@ -210,24 +210,24 @@ parse_hook ()
{
local mod bin fil
for mod in $MODULES; do
- if [ "x${mod}" != "x" ]; then
+ if [ -n "${mod}" ]; then
add_module "${mod}"
fi
done
for bin in $BINARIES; do
- if [ "x${bin}" != "x" ]; then
+ if [ -n "${bin}" ]; then
add_binary "${bin}"
fi
done
for fil in $FILES; do
- if [ "x${fil}" != "x" ]; then
+ if [ -n "${fil}" ]; then
add_file "${fil}"
fi
done
- if [ "x${SCRIPT}" != "x" ]; then
+ if [ -n "${SCRIPT}" ]; then
add_file "${HOOKDIR}/${SCRIPT}" "/hooks/${SCRIPT}"
fi
}