From cae4dcc74df336d0e14e3ef8de740ab7d3d0c275 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 11 Sep 2006 06:35:02 +0000 Subject: Minor fixes from bug #5245 git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@166 880c04e9-e011-0410-abf7-b926e227c9cd --- functions | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/functions b/functions index 086e707..58ee03d 100644 --- a/functions +++ b/functions @@ -52,7 +52,8 @@ add_full_dir () add_dir () { - if [ "x${1}" != "x" -a "${1}" != "/" ]; then + #skip root directory and "." for relative directories... i.e. /foo/bar/./blah + if [ "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}" @@ -82,13 +83,13 @@ add_symlink () { local fil dest dir if [ -L ${1} ]; then - fil="${1}" + fil="${1##$BASEDIR}" dest="${2##$BASEDIR}" add_dir $(dirname "${dest}") add_dir $(dirname "${fil}") if ! grep "slink ${dest} " "${FILELIST}" 2>&1 > /dev/null; then msg " adding link ${fil} -> ${dest}" - echo "slink ${fil} ${dest} $(stat -c '%a' ${fil}) 0 0" >> "${FILELIST}" + echo "slink ${fil} ${dest} $(stat -c '%a' ${1}) 0 0" >> "${FILELIST}" fi fi #fail quietly -- cgit v1.2.3-24-g4f1b