upload.sh: Fix some bugs with chmod/chown

This commit is contained in:
Jan Lindemann 2002-07-10 12:20:30 +00:00 committed by Jan Lindemann
commit 845dca91be

View file

@ -146,9 +146,9 @@ parse_target()
test -n "$FILE_GROUP" && echo file_group="\"$FILE_GROUP\";"
if is_dir "$target_file" ; then
echo target_path=\"$TARGET_FILE\"
echo target_path=\"$TARGET_FILE\" # TODO: this is bullshit
else
echo target_path=\"$TARGET_FILE/`basename $source`\"
echo target_path=\"$TARGET_FILE/`basename $source`\" # TODO: this is bullshit
fi
echo "PARSE_TARGET=\"OK\";"
@ -188,7 +188,8 @@ ssh_chown()
set -e
dir=`echo $1 | sed -e 's/\/[^\/]*$//; s/\/*$//'`
cat << EOT |
if [ -f "$1" -a -n "$file_owner" ]; then chown $file_owner $1; chgrp $file_group $1; fi
if [ -f "$1" -a -n "$file_owner" ]; then chown $file_owner $1; fi
if [ -f "$1" -a -n "$file_group" ]; then chgrp $file_group $1; fi
#cd $1
#if [ -n "$2" ]; then chown -R $2 . ; fi
#if [ -n "$3" ]; then chown -R $3 . ; fi
@ -286,8 +287,8 @@ for t in $*; do
rsync_ssh)
ssh_mkdir $target_file $file_owner $file_group $dir_mode || break
/usr/bin/rsync -az --links -e "/usr/bin/ssh -l $login $IDENTITY" $source $login@$host:$target_file
ssh_chown $target_path $file_owner $file_group
ssh_chmod $target_path $file_mode $dir_mode
ssh_chown $target_file $file_owner $file_group
ssh_chmod $target_file $file_mode $dir_mode
;;
*)
echo "Internal error: \"$method\" is not implemented." >&2