summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-09-06 05:52:40 +0000
committerMartin Pool <mbp@samba.org>2001-09-06 05:52:40 +0000
commit99cdaff70da08dffb209ba58cd5cae4b1a4fb736 (patch)
treec717a9a176231faf5c408678a85d4b7fbfe109fe /testsuite
parentc36b5017b8ecfd4ec05d60278558bda785b0659a (diff)
downloadrsync-99cdaff70da08dffb209ba58cd5cae4b1a4fb736.tar.gz
Add a makepath() function to cope with machines that do not have
'mkdir -p'. (Stone knives and bearskins...)
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/rsync.fns24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
index 369d38c8..8dd91a1b 100644
--- a/testsuite/rsync.fns
+++ b/testsuite/rsync.fns
@@ -77,6 +77,30 @@ hands_setup() {
+
+####################
+# Many machines do not have "mkdir -p", so we have to build up long paths.
+# How boring.
+makepath () {
+ p="$1"
+ (
+ # Absolut Unix.
+ if echo $p | grep '^/' >/dev/null
+ then
+ cd /
+ fi
+
+ # This will break if $1 contains a space.
+ for c in `echo $p | tr '/' ' '`
+ do
+ [ -d "$c" ] || mkdir "$c" || return $?
+ cd "$c" || return $?
+ done
+ )
+}
+
+
+
###########################
# Run a test (in '$1') then compare directories $2 and $3 to see if
# there are any difference. If there are, explain them.