summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-12 10:12:19 +0100
committerAaron Griffin <aaron@archlinux.org>2007-02-12 10:12:19 +0100
commitca7642cd01994b002a12b7c719e83d339d382a36 (patch)
tree2daa0df34ab60dba9c7bfaa0590adf3587348f15 /functions
parent010c053f592b83fa8b8cf2e0d25c20a2be0cf33e (diff)
downloadmkinitcpio-ca7642cd01994b002a12b7c719e83d339d382a36.tar.gz
mkinitcpio-ca7642cd01994b002a12b7c719e83d339d382a36.tar.xz
Test existance before adding directories, as per bug #5245
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@195 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'functions')
-rw-r--r--functions6
1 files changed, 3 insertions, 3 deletions
diff --git a/functions b/functions
index 88e2ddd..d7ec918 100644
--- a/functions
+++ b/functions
@@ -39,7 +39,7 @@ die () { echo "FATAL: ${@}" >&2; exit 1; }
add_full_dir ()
{
- if [ "x${1}" != "x" ]; then
+ if [ -d "${1}" -a "x${1}" != "x" ]; 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 [ -d "${1}" -a "x${1}" != "x" -a "${1}" != "/" -a "${1}" != "." ]; then
if ! grep "dir ${1} " "${FILELIST}" 2>&1 > /dev/null; then
add_dir $(dirname "${1}")
msg " adding dir ${1}"
@@ -98,7 +98,7 @@ add_symlink ()
add_file ()
{
local fil lnk dir dest
- if [ -e "${1}" ]; then
+ if [ -f "${1}" ]; then
fil="${1}"
lnk=$(readlink -f "${fil}")
if [ -n "${lnk}" ]; then