* autopoint.in: Unset all other environment variables which influence
cvs. Pass -d $CVSROOT explicitly.
+ (func_mkdir_for): New function.
+ (func_copy): Call it.
2002-05-01 Bruno Haible <bruno@clisp.org>
fi
fi
+# func_mkdir_for to
+# ensures the directory that would the given file exists.
+# 'to' is a relative pathname, relative to the current directory.
+func_mkdir_for ()
+{
+ base=`echo "$1" | sed -e 's,/[^/]*$,,'`
+ if test "X$base" != "X$1" && test -n "$base"; then
+ func_mkdir_for "$base"
+ # Recompute base. It was clobbered by the recursive call.
+ base=`echo "$1" | sed -e 's,/[^/]*$,,'`
+ test -d "$base" || { echo "Creating directory $base"; mkdir "$base"; }
+ fi
+}
+
# func_copy from to
# copies a file.
# 'from' is a relative pathname, relative to the current directory.
func_copy ()
{
if $doit; then
+ func_mkdir_for "$2"
rm -f "$2"
echo "Copying file $2"
cp "$1" "$2"