From 5ab30f709ab426f42ff1aa33de7a45c807714eb4 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 12 Aug 2007 08:25:27 +0000 Subject: [PATCH] (symlink_to_gnulib): Make sure the target directory exists and create it if it does not. --- bootstrap | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bootstrap b/bootstrap index 6d9ac67..4c7d9e6 100755 --- a/bootstrap +++ b/bootstrap @@ -372,6 +372,12 @@ esac gnulib_tool=$GNULIB_SRCDIR/gnulib-tool <$gnulib_tool || exit +ensure_dir_exists() +{ + d=`dirname $dst` + test -d "$d" || mkdir -p -- "$d" +} + symlink_to_gnulib() { src=$GNULIB_SRCDIR/$1 @@ -388,6 +394,7 @@ symlink_to_gnulib() test -f "$dst" && cmp -s "$src" "$dst" || { echo "$0: cp -fp $src $dst" && + ensure_dir_exists $dst && cp -fp "$src" "$dst" } else @@ -410,6 +417,7 @@ symlink_to_gnulib() esac echo "$0: ln -fs $dot_dots$src $dst" && + ensure_dir_exists $dst && ln -fs "$dot_dots$src" "$dst" } fi -- 2.45.2