Diff for /embedaddon/rsync/testsuite/rsync.fns between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2013/10/14 07:51:15 version 1.1.1.3, 2021/03/17 00:32:36
Line 1 Line 1
#! /bin/sh#!/bin/sh
   
 # Copyright (C) 2001 by Martin Pool <mbp@samba.org>  # Copyright (C) 2001 by Martin Pool <mbp@samba.org>
   
Line 23  todir="$tmpdir/to" Line 23  todir="$tmpdir/to"
 chkdir="$tmpdir/chk"  chkdir="$tmpdir/chk"
   
 # For itemized output:  # For itemized output:
all_plus='+++++++++'all_plus='++++++++++'
allspace='         'allspace='          '
dots='.....' # trailing dots after changesdots='......' # trailing dots after changes
 tab_ch='        ' # a single tab character  tab_ch='        ' # a single tab character
   
 # Berkley's nice.  # Berkley's nice.
Line 62  set_cp_destdir() { Line 62  set_cp_destdir() {
 # Perform a "cp -p", making sure that timestamps are really the same,  # Perform a "cp -p", making sure that timestamps are really the same,
 # even if the copy rounded microsecond times on the destination file.  # even if the copy rounded microsecond times on the destination file.
 cp_touch() {  cp_touch() {
    cp -p "${@}" || test_fail "cp -p failed"    cp_p "${@}"
     if test $# -gt 2 -o -d "$2"; then      if test $# -gt 2 -o -d "$2"; then
         set_cp_destdir "${@}" # sets destdir var          set_cp_destdir "${@}" # sets destdir var
         while test $# -gt 1; do          while test $# -gt 1; do
Line 97  printmsg() { Line 97  printmsg() {
 }  }
   
 rsync_ls_lR() {  rsync_ls_lR() {
    find "$@" -print | sort | sed 's/ /\\ /g' | xargs "$TOOLDIR/tls" $TLS_ARGS    find "$@" -name .git -prune -o -name auto-build-save -prune -o -print | \
         sort | sed 's/ /\\ /g' | xargs "$TOOLDIR/tls" $TLS_ARGS
 }  }
   
 get_testuid() {  get_testuid() {
    id 2>/dev/null | sed 's/^[^0-9]*\([0-9][0-9]*\).*/\1/'    uid=`id -u 2>/dev/null || true`
     case "$uid" in
         [0-9]*) echo "$uid" ;;
         *) id 2>/dev/null | sed 's/^[^0-9]*\([0-9][0-9]*\).*/\1/' ;;
     esac
 }  }
   
   get_rootuid() {
       uid=`id -u root 2>/dev/null || true`
       case "$uid" in
           [0-9]*) echo "$uid" ;;
           *) echo 0 ;;
       esac
   }
   
   get_rootgid() {
       gid=`id -g root 2>/dev/null || true`
       case "$gid" in
           [0-9]*) echo "$gid" ;;
           *) echo 0 ;;
       esac
   }
   
   # When copying via "cp -p", we want to ensure that a non-root user does not
   # preserve ownership (we want our files to be created as the testing user).
   # For instance, a Cygwin CI run might have git files owned by a different
   # user than the (admin) user running the tests.
   cp_cmd="cp -p"
   if test x`get_testuid` != x0; then
       case `cp --help 2>/dev/null` in
           *--no-preserve=*) cp_cmd="cp -p --no-preserve=ownership" ;;
       esac
   fi
   cp_p() {
       $cp_cmd "${@}" || test_fail "$cp_cmd failed"
   }
   
 check_perms() {  check_perms() {
     perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'`      perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'`
     if test $perms = $2; then      if test $perms = $2; then
Line 183  makepath() { Line 218  makepath() {
     for p in "${@}"; do      for p in "${@}"; do
         (echo "        makepath $p"          (echo "        makepath $p"
   
        # Absolut Unix.        # Absolute Unix path.
         if echo $p | grep '^/' >/dev/null          if echo $p | grep '^/' >/dev/null
         then          then
             cd /              cd /
Line 219  checkit() { Line 254  checkit() {
     # We can just write everything to stdout/stderr, because the      # We can just write everything to stdout/stderr, because the
     # wrapper hides it unless there is a problem.      # wrapper hides it unless there is a problem.
   
       case "x$TLS_ARGS" in
       *--atimes*)
           ( cd "$2" && rsync_ls_lR . ) > "$tmpdir/ls-from"
           ;;
       *)
           ;;
       esac
   
     echo "Running: \"$1\""        echo "Running: \"$1\""  
     eval "$1"       eval "$1" 
     status=$?      status=$?
Line 226  checkit() { Line 269  checkit() {
         failed="$failed status=$status"          failed="$failed status=$status"
     fi      fi
   
       case "x$TLS_ARGS" in
       *--atimes*)
           ;;
       *)
           ( cd "$2" && rsync_ls_lR . ) > "$tmpdir/ls-from"
           ;;
       esac
   
     echo "-------------"      echo "-------------"
     echo "check how the directory listings compare with diff:"      echo "check how the directory listings compare with diff:"
     echo ""      echo ""
     ( cd "$2" && rsync_ls_lR . ) > "$tmpdir/ls-from"  
     ( cd "$3" && rsync_ls_lR . ) > "$tmpdir/ls-to"      ( cd "$3" && rsync_ls_lR . ) > "$tmpdir/ls-to"
     diff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed="$failed dir-diff"      diff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed="$failed dir-diff"
   
Line 262  build_rsyncd_conf() { Line 312  build_rsyncd_conf() {
     logfile="$scratchdir/rsyncd.log"      logfile="$scratchdir/rsyncd.log"
     hostname=`uname -n`      hostname=`uname -n`
   
    uid_setting='uid = 0'    my_uid=`get_testuid`
    gid_setting='gid = 0'    root_uid=`get_rootuid`
    case `get_testuid` in    root_gid=`get_rootgid`
    0) ;;
    *)    uid_setting="uid = $root_uid"
     gid_setting="gid = $root_gid"
 
     if test x"$my_uid" != x"$root_uid"; then
         # Non-root cannot specify uid & gid settings          # Non-root cannot specify uid & gid settings
         uid_setting="#$uid_setting"          uid_setting="#$uid_setting"
         gid_setting="#$gid_setting"          gid_setting="#$gid_setting"
        ;;    fi
    esac 
   
     cat >"$conf" <<EOF      cat >"$conf" <<EOF
 # rsyncd configuration file autogenerated by $0  # rsyncd configuration file autogenerated by $0
Line 281  use chroot = no Line 333  use chroot = no
 munge symlinks = no  munge symlinks = no
 hosts allow = localhost 127.0.0.0/24 192.168.0.0/16 10.0.0.0/8 $hostname  hosts allow = localhost 127.0.0.0/24 192.168.0.0/16 10.0.0.0/8 $hostname
 log file = $logfile  log file = $logfile
 log format = %i %h [%a] %m (%u) %l %f%L  
 transfer logging = yes  transfer logging = yes
   # We don't define log format here so that the test-hidden module will default
   # to the internal static string (since we had a crash trying to tweak it).
 exclude = ? foobar.baz  exclude = ? foobar.baz
 max verbosity = 4  max verbosity = 4
 $uid_setting  $uid_setting
Line 290  $gid_setting Line 343  $gid_setting
   
 [test-from]  [test-from]
         path = $fromdir          path = $fromdir
           log format = %i %h [%a] %m (%u) %l %f%L
         read only = yes          read only = yes
         comment = r/o          comment = r/o
   
 [test-to]  [test-to]
         path = $todir          path = $todir
           log format = %i %h [%a] %m (%u) %l %f%L
         read only = no          read only = no
         comment = r/w          comment = r/w
   
 [test-scratch]  [test-scratch]
         path = $scratchdir          path = $scratchdir
           log format = %i %h [%a] %m (%u) %l %f%L
         read only = no          read only = no
   
 [test-hidden]  [test-hidden]

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>