From 01b5f9c7c344b4f57f895a2f3a06a2b0c38a4513 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 7 Feb 2004 22:53:31 +0000 Subject: [PATCH] upload.sh: Not all leading directories created Bugfix in mkdir_ssh: Sometimes not all leading directories were created. --- scripts/upload.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/upload.sh b/scripts/upload.sh index 84240acf..0268c3df 100644 --- a/scripts/upload.sh +++ b/scripts/upload.sh @@ -165,16 +165,17 @@ ssh_mkdir() { set -e dir=`echo $1 | sed -e 's/\/[^\/]*$//; s/\/*$//'` - parts="/ `echo $dir | sed -e 's/\// /g'`" + parts="/ `echo $dir | sed -e 's%/% %g'`" test -n "$dir_mode" && MODE="-m $dir_mode" cat << EOT | + echo creating $parts for part in $parts; do path="\$path/\$part" if [ ! -d \$path ]; then mkdir \$path || break - test -n "$2" && chown "$2" \$path || break - test -n "$3" && chgrp "$3" \$path || break - test -n "$4" && chmod "$4" \$path || break + test -n "$2" && chown "$2" \$path || continue + test -n "$3" && chgrp "$3" \$path || continue + test -n "$4" && chmod "$4" \$path || continue fi if [ ! -d \$path ]; then echo "failed to create directory \$path, owner=\$file_owner, group=\$file_group, mode=\$dir_mode"