Implement --tweak, --no-tweak, --no-tweak-hlinked options.
[rsync/rsync.git] / testsuite / rsync.fns
index 926a42e..441fbb4 100644 (file)
@@ -23,6 +23,11 @@ fromdir="$tmpdir/from"
 todir="$tmpdir/to"
 chkdir="$tmpdir/chk"
 
+# For itemized output:
+all_plus='+++++++++'
+allspace='         '
+dots='.....' # trailing dots after changes
+
 # Berkley's nice.
 PATH="$PATH:/usr/ucb"
 
@@ -73,7 +78,7 @@ rsync_ls_lR() {
 }
 
 check_perms() {
-    perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'`
+    perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-dlp]\(.........\).*/\1/'`
     if test $perms = $2; then
        return 0
     fi
@@ -86,6 +91,10 @@ rsync_getgroups() {
     "$TOOLDIR/getgroups"
 }
 
+confile=`echo "$scratchdir" | sed 's;/testtmp/[^/]*$;/config.h;'`
+config_test() {
+    egrep "^#define $1 1" "$confile" >/dev/null
+}
 
 ####################
 # Build test directories $todir and $fromdir, with $fromdir full of files.
@@ -256,6 +265,25 @@ gid = 0
        path = $scratchdir
        read only = no
 EOF
+
+    # Build a helper script to ignore exit code 23
+    ignore23="$scratchdir/ignore23"
+    echo "building help script $ignore23"
+
+    cat >"$ignore23" <<'EOT'
+if "${@}"; then
+    exit
+fi
+
+ret=$?
+
+if test $ret = 23; then
+    exit
+fi
+
+exit $ret
+EOT
+chmod +x "$ignore23"
 }