From edd497035779d919ebc27c7a319a53affc96a52b Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 26 Apr 2006 07:37:40 +0000 Subject: git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@20 880c04e9-e011-0410-abf7-b926e227c9cd --- functions | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'functions') diff --git a/functions b/functions index 6b35d77..6cb6227 100644 --- a/functions +++ b/functions @@ -17,15 +17,12 @@ err() { echo "ERROR: ${@}" >&2; } add_dir() { - local dir if [ "x${1}" != "x" -a "${1}" != "/" ]; then - dir="$(dirname ${1})" - [ "${dir}" = "/" ] && dir="${1}" - if ! grep "dir ${dir} " "${FILELIST}" 2>&1 > /dev/null; then - add_dir $(dirname "${dir}") - msg " adding dir ${dir}" - echo "dir ${dir} 755 0 0" >> "${FILELIST}" + if ! grep "dir ${1} " "${FILELIST}" 2>&1 > /dev/null; then + add_dir $(dirname "${1}") + msg " adding dir ${1}" + echo "dir ${1} 755 0 0" >> "${FILELIST}" fi fi } @@ -36,9 +33,9 @@ add_device() if [ $# -ge 4 ]; then local perms perms="${5:-644}" - add_dir "${1}" if ! grep "nod ${1}" "${FILELIST}" 2>&1 > /dev/null; then - msg " adding device node ${1}" + add_dir $(dirname "${1}") + msg " adding node ${1}" echo "nod ${1} ${perms} 0 0 ${2} ${3} ${4}" >> "${FILELIST}" fi else -- cgit v1.2.3-24-g4f1b