home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / rsync246.zip / diff_rsync-2.4.6a next >
Text File  |  2000-11-17  |  9KB  |  320 lines

  1. BUILD on OS/2:
  2.  
  3. Apply the patches below, then
  4.  
  5.  convert_configure.pl configure > configure.cmd
  6.  configure.cmd
  7.  make
  8.  
  9. I think it would look for options in /etc/rsync.conf, but I did not check it.
  10.  
  11. Ilya Zakharevich ilya@math.ohio-state.edu
  12.  
  13.  
  14.  
  15. --- ./backup.c~    Sat Aug 19 08:10:38 2000
  16. +++ ./backup.c    Fri Nov 17 22:54:36 2000
  17. @@ -103,6 +103,7 @@ static int make_bak_dir(char *fname,char
  18.          /* Make the directories */
  19.          while ((p=strchr(p,'/'))) {
  20.                  *p = 0;
  21. +#if SUPPORT_LINKS
  22.                  if(do_lstat(fullpath,&st)!=0) {
  23.                          do_mkdir(fullpath,0777 & ~orig_umask);
  24.                          if(p>q) {
  25. @@ -120,6 +121,27 @@ static int make_bak_dir(char *fname,char
  26.                                  };
  27.                          }
  28.                  };
  29. +#else    /* !( SUPPORT_LINKS ) */ 
  30. +                if(do_stat(fullpath,&st)!=0) {
  31. +                        do_mkdir(fullpath,0777 & ~orig_umask);
  32. +                        if(p>q) {
  33. +                                if(do_stat(q,&st)!=0) {
  34. +                                        rprintf(FERROR,"make_bak_dir stat %s : %s\n",fullpath,strerror(errno));
  35. +                                } else {
  36. +                                        st2=&st;
  37. +                                        set_modtime(fullpath,st2->st_mtime);
  38. +#if HAVE_LCHOWN || HAVE_CHOWN
  39. +                                        if(do_lchown(fullpath,st2->st_uid,st2->st_gid)!=0) {
  40. +                                                rprintf(FERROR,"make_bak_dir chown %s : %s\n",fullpath,strerror(errno));
  41. +                                        };
  42. +#endif
  43. +                                        if(do_chmod(fullpath,st2->st_mode)!=0) {
  44. +                                                rprintf(FERROR,"make_bak_dir failed to set permissions on %s : %s\n",fullpath,strerror(errno));
  45. +                                        };
  46. +                                };
  47. +                        }
  48. +                };
  49. +#endif    /* SUPPORT_LINKS */ 
  50.                  *p = '/';
  51.                  p++;
  52.          }
  53. --- ./clientserver.c~    Tue Sep  5 21:46:42 2000
  54. +++ ./clientserver.c    Fri Nov 17 23:09:12 2000
  55. @@ -209,7 +209,10 @@ static int rsync_module(int fd, int i)
  56.      log_open();
  57.  
  58.      if (use_chroot) {
  59. -        if (chroot(lp_path(i))) {
  60. +#if HAVE_CHROOT
  61. +        if (chroot(lp_path(i)))
  62. +#endif
  63. +        {
  64.              rprintf(FERROR,"chroot %s failed\n", lp_path(i));
  65.              io_printf(fd,"@ERROR: chroot failed\n");
  66.              return -1;
  67. --- ./log.c~    Sat Jan 29 06:35:02 2000
  68. +++ ./log.c    Fri Nov 17 23:17:04 2000
  69. @@ -33,7 +33,9 @@ static void logit(int priority, char *bu
  70.              timestring(time(NULL)), (int)getpid(), buf);
  71.          fflush(logfile);
  72.      } else {
  73. +#if HAVE_SYSLOG_H
  74.          syslog(priority, "%s", buf);
  75. +#endif
  76.      }
  77.  }
  78.  
  79. @@ -62,7 +64,7 @@ void log_open(void)
  80.          umask(old_umask);
  81.          return;
  82.      }
  83. -
  84. +#if HAVE_SYSLOG_H
  85.  #ifdef LOG_NDELAY
  86.      options |= LOG_NDELAY;
  87.  #endif
  88. @@ -75,6 +77,9 @@ void log_open(void)
  89.  
  90.  #ifndef LOG_NDELAY
  91.      logit(LOG_INFO,"rsyncd started\n");
  92. +#endif
  93. +#else    /* !( HAVE_SYSLOG_H ) */
  94. +    logfile = stderr;
  95.  #endif
  96.  }
  97.  
  98. --- ./rsync.c~    Tue Sep  5 21:46:42 2000
  99. +++ ./rsync.c    Fri Nov 17 22:56:30 2000
  100. @@ -183,6 +183,7 @@ int set_perms(char *fname,struct file_st
  101.              change to groups that the user is a member of */
  102.          change_gid = is_in_group(file->gid);
  103.      }
  104. +#if HAVE_LCHOWN || HAVE_CHOWN
  105.      if (change_uid || change_gid) {
  106.          if (do_lchown(fname,
  107.                    change_uid?file->uid:st->st_uid,
  108. @@ -200,6 +201,7 @@ int set_perms(char *fname,struct file_st
  109.          }
  110.          updated = 1;
  111.      }
  112. +#endif    /* HAVE_LCHOWN || HAVE_CHOWN */
  113.  
  114.  #ifdef HAVE_CHMOD
  115.      if (!S_ISLNK(st->st_mode)) {
  116. --- ./rsync.h~    Sat Aug 19 08:10:38 2000
  117. +++ ./rsync.h    Fri Nov 17 23:20:26 2000
  118. @@ -183,9 +183,16 @@ enum logcode {FNONE=0, FERROR=1, FINFO=2
  119.  #include <netinet/in.h>
  120.  #include <arpa/inet.h>
  121.  #include <netdb.h>
  122. -#include <syslog.h>
  123.  #include <sys/file.h>
  124.  
  125. +#if HAVE_SYSLOG_H
  126. +# include <syslog.h>
  127. +#else    /* !( HAVE_SYSLOG_H ) */
  128. +# define LOG_PID    0
  129. +# define LOG_INFO    0
  130. +# define LOG_WARNING    0
  131. +#endif
  132. +
  133.  #if HAVE_DIRENT_H
  134.  # include <dirent.h>
  135.  #else
  136. @@ -439,6 +446,14 @@ extern int errno;
  137.  #define S_ISBLK(mode) (((mode) & (_S_IFMT)) == (_S_IFBLK))
  138.  #endif
  139.  
  140. +#ifndef _S_IFBLK
  141. +#define _S_IFBLK    -1        /* For DOSISH systems */
  142. +#endif
  143. +
  144. +#ifndef S_IFLNK
  145. +#define S_IFLNK        -1        /* For DOSISH systems */
  146. +#endif
  147. +
  148.  #ifndef S_ISCHR
  149.  #define S_ISCHR(mode) (((mode) & (_S_IFMT)) == (_S_IFCHR))
  150.  #endif
  151. @@ -515,3 +530,8 @@ size_t strlcat(char *d, const char *s, s
  152.  #endif
  153.  
  154.  #define exit_cleanup(code) _exit_cleanup(code, __FILE__, __LINE__)
  155. +
  156. +#ifndef HAVE_STRCASECMP
  157. +#define strcasecmp    stricmp
  158. +#define strncasecmp    strnicmp
  159. +#endif
  160. --- ./syscall.c~    Sat Jan 29 06:35:02 2000
  161. +++ ./syscall.c    Fri Nov 17 22:57:18 2000
  162. @@ -35,12 +35,14 @@ int do_unlink(char *fname)
  163.      return unlink(fname);
  164.  }
  165.  
  166. +#if HAVE_SYMLINK
  167.  int do_symlink(char *fname1, char *fname2)
  168.  {
  169.      if (dry_run) return 0;
  170.      CHECK_RO
  171.      return symlink(fname1, fname2);
  172.  }
  173. +#endif
  174.  
  175.  #if HAVE_LINK
  176.  int do_link(char *fname1, char *fname2)
  177. @@ -51,12 +53,14 @@ int do_link(char *fname1, char *fname2)
  178.  }
  179.  #endif
  180.  
  181. +#if HAVE_LCHOWN || HAVE_CHOWN
  182.  int do_lchown(const char *path, uid_t owner, gid_t group)
  183.  {
  184.      if (dry_run) return 0;
  185.      CHECK_RO
  186.      return lchown(path, owner, group);
  187.  }
  188. +#endif
  189.  
  190.  #if HAVE_MKNOD
  191.  int do_mknod(char *pathname, mode_t mode, dev_t dev)
  192. --- ./util.c~    Tue Sep  5 21:46:42 2000
  193. +++ ./util.c    Fri Nov 17 04:02:40 2000
  194. @@ -494,6 +494,7 @@ int name_to_gid(char *name, gid_t *gid)
  195.  /* lock a byte range in a open file */
  196.  int lock_range(int fd, int offset, int len)
  197.  {
  198. +#ifdef F_SETLK
  199.      struct flock lock;
  200.  
  201.      lock.l_type = F_WRLCK;
  202. @@ -503,6 +504,9 @@ int lock_range(int fd, int offset, int l
  203.      lock.l_pid = 0;
  204.      
  205.      return fcntl(fd,F_SETLK,&lock) == 0;
  206. +#else
  207. +    return 0;
  208. +#endif
  209.  }
  210.  
  211.  
  212. --- ./lib/getopt.c~    Sat Jun 22 00:04:22 1996
  213. +++ ./lib/getopt.c    Fri Nov 17 04:47:10 2000
  214. @@ -650,6 +650,8 @@ _getopt_internal (argc, argv, optstring,
  215.    }
  216.  }
  217.  
  218. +#ifndef __EMX__                /* prototype conflict */
  219. +
  220.  int
  221.  getopt (argc, argv, optstring)
  222.       int argc;
  223. @@ -661,6 +663,8 @@ getopt (argc, argv, optstring)
  224.                 (int *) 0,
  225.                 0);
  226.  }
  227. +
  228. +#endif
  229.  
  230.  int
  231.  getopt_long (argc, argv, options, long_options, opt_index)
  232. --- ./Makefile.in-ini    Tue Sep  5 21:46:42 2000
  233. +++ ./Makefile.in    Fri Nov 17 04:41:34 2000
  234. @@ -15,7 +15,7 @@ INSTALLCMD=@INSTALL@
  235.  
  236.  srcdir=@srcdir@
  237.  VPATH=$(srcdir)
  238. -SHELL=/bin/sh
  239. +SHELL=@SHELL@
  240.  
  241.  
  242.  .SUFFIXES:
  243. --- ./config.h.in-ini    Sat Jul 29 00:05:08 2000
  244. +++ ./config.h.in    Fri Nov 17 23:07:26 2000
  245. @@ -81,6 +81,9 @@
  246.  /* Define if you have the chown function.  */
  247.  #undef HAVE_CHOWN
  248.  
  249. +/* Define if you have the chown function.  */
  250. +#undef HAVE_CHROOT
  251. +
  252.  /* Define if you have the connect function.  */
  253.  #undef HAVE_CONNECT
  254.  
  255. @@ -141,6 +144,9 @@
  256.  /* Define if you have the strpbrk function.  */
  257.  #undef HAVE_STRPBRK
  258.  
  259. +/* Define if you have the symlink function.  */
  260. +#undef HAVE_SYMLINK
  261. +
  262.  /* Define if you have the utime function.  */
  263.  #undef HAVE_UTIME
  264.  
  265. @@ -182,6 +188,9 @@
  266.  
  267.  /* Define if you have the <string.h> header file.  */
  268.  #undef HAVE_STRING_H
  269. +
  270. +/* Define if you have the <syslog.h> header file.  */
  271. +#undef HAVE_SYSLOG_H
  272.  
  273.  /* Define if you have the <sys/dir.h> header file.  */
  274.  #undef HAVE_SYS_DIR_H
  275. --- ./configure.cmd-ini    Fri Nov 17 03:33:52 2000
  276. +++ ./configure.cmd    Fri Nov 17 23:06:54 2000
  277. @@ -1492,7 +1493,7 @@ else
  278.  fi
  279.  done
  280.  
  281. -for ac_hdr in sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h
  282. +for ac_hdr in sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h syslog.h
  283.  do
  284.  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  285.  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  286. @@ -1503,6 +1504,7 @@ else
  287.    cat > conftest.$ac_ext <<EOF
  288.  #line 1480 "configure"
  289.  #include "confdefs.h"
  290. +#include <sys/types.h>
  291.  #include <$ac_hdr>
  292.  EOF
  293.  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  294. @@ -2735,7 +2737,7 @@ else
  295.  fi
  296.  done
  297.  
  298. -for ac_func in fchmod fstat strchr readlink link utime utimes strftime
  299. +for ac_func in fchmod fstat strchr readlink link utime utimes strftime symlink
  300.  do
  301.  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  302.  echo "configure:2717: checking for $ac_func" >&5
  303. @@ -2790,7 +2792,7 @@ else
  304.  fi
  305.  done
  306.  
  307. -for ac_func in memmove lchown vsnprintf snprintf setsid glob strpbrk
  308. +for ac_func in memmove lchown chown vsnprintf snprintf setsid glob strpbrk chroot
  309.  do
  310.  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  311.  echo "configure:2772: checking for $ac_func" >&5
  312. @@ -3075,6 +3077,7 @@ else
  313.  #line 3051 "configure"
  314.  #include "confdefs.h"
  315.  #include <stdio.h>
  316. +#include <sys/types.h>
  317.  #include <sys/stat.h>
  318.  main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }
  319.  EOF
  320.