mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
upload.sh: Not all leading directories created
Bugfix in mkdir_ssh: Sometimes not all leading directories were created.
This commit is contained in:
parent
74b948cc1f
commit
01b5f9c7c3
1 changed files with 5 additions and 4 deletions
|
|
@ -165,16 +165,17 @@ ssh_mkdir()
|
||||||
{
|
{
|
||||||
set -e
|
set -e
|
||||||
dir=`echo $1 | sed -e 's/\/[^\/]*$//; s/\/*$//'`
|
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"
|
test -n "$dir_mode" && MODE="-m $dir_mode"
|
||||||
cat << EOT |
|
cat << EOT |
|
||||||
|
echo creating $parts
|
||||||
for part in $parts; do
|
for part in $parts; do
|
||||||
path="\$path/\$part"
|
path="\$path/\$part"
|
||||||
if [ ! -d \$path ]; then
|
if [ ! -d \$path ]; then
|
||||||
mkdir \$path || break
|
mkdir \$path || break
|
||||||
test -n "$2" && chown "$2" \$path || break
|
test -n "$2" && chown "$2" \$path || continue
|
||||||
test -n "$3" && chgrp "$3" \$path || break
|
test -n "$3" && chgrp "$3" \$path || continue
|
||||||
test -n "$4" && chmod "$4" \$path || break
|
test -n "$4" && chmod "$4" \$path || continue
|
||||||
fi
|
fi
|
||||||
if [ ! -d \$path ]; then
|
if [ ! -d \$path ]; then
|
||||||
echo "failed to create directory \$path, owner=\$file_owner, group=\$file_group, mode=\$dir_mode"
|
echo "failed to create directory \$path, owner=\$file_owner, group=\$file_group, mode=\$dir_mode"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue