Decided that we don't really want the rule that preserves the
[rsync/rsync.git] / compat.c
index 70c2ee2..62b2ba0 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -3,12 +3,11 @@
  *
  * Copyright (C) Andrew Tridgell 1996
  * Copyright (C) Paul Mackerras 1996
- * Copyright (C) 2004, 2005, 2006 Wayne Davison
+ * Copyright (C) 2004-2007 Wayne Davison
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,6 +28,7 @@ int inc_recurse = 0;
 extern int verbose;
 extern int am_server;
 extern int am_sender;
+extern int local_server;
 extern int inplace;
 extern int recurse;
 extern int fuzzy_basis;
@@ -44,7 +44,12 @@ extern int preserve_gid;
 extern int preserve_hard_links;
 extern int need_messages_from_generator;
 extern int delete_mode, delete_before, delete_during, delete_after;
+extern int delete_excluded;
+extern int make_backups;
+extern char *backup_dir, *backup_suffix;
+extern char *partial_dir;
 extern char *dest_option;
+extern struct filter_list_struct filter_list;
 
 void setup_protocol(int f_out,int f_in)
 {
@@ -151,6 +156,13 @@ void setup_protocol(int f_out,int f_in)
                need_messages_from_generator = 1;
        }
 
+       if (partial_dir && *partial_dir != '/' && (!am_server || local_server)) {
+               int flags = MATCHFLG_NO_PREFIXES | MATCHFLG_DIRECTORY;
+               if (!am_sender || protocol_version >= 30)
+                       flags |= MATCHFLG_PERISHABLE;
+               parse_rule(&filter_list, partial_dir, flags, 0);
+       }
+
        if (am_server) {
                if (!checksum_seed)
                        checksum_seed = time(NULL);