A small tweak to the new code in itemize().
authorWayne Davison <wayned@samba.org>
Mon, 12 Mar 2007 06:15:46 +0000 (06:15 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 12 Mar 2007 06:15:46 +0000 (06:15 +0000)
omit-dir-changes.diff

index 13ed70d..ee9f2e9 100644 (file)
@@ -17,22 +17,30 @@ To use this patch, run these commands for a successful build:
  extern int delete_mode;
  extern int delete_before;
  extern int delete_during;
-@@ -554,10 +555,11 @@ void itemize(const char *fname, struct f
+@@ -544,6 +545,7 @@ void itemize(const char *fname, struct f
+               int keep_time = !preserve_times ? 0
+                   : S_ISDIR(file->mode) ? !omit_dir_times
+                   : !S_ISLNK(file->mode);
++              int omit_changes = omit_dir_changes && S_ISDIR(sxp->st.st_mode);
+               if (S_ISREG(file->mode) && F_LENGTH(file) != sxp->st.st_size)
+                       iflags |= ITEM_REPORT_SIZE;
+@@ -554,10 +556,11 @@ void itemize(const char *fname, struct f
                        iflags |= ITEM_REPORT_TIME;
                if (!BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
                        iflags |= ITEM_REPORT_PERMS;
 -              if (preserve_uid && am_root && F_UID(file) != sxp->st.st_uid)
-+              if (preserve_uid && am_root && F_UID(file) != sxp->st.st_uid
-+               && !(omit_dir_changes && S_ISDIR(sxp->st.st_mode)))
++              if (preserve_uid && am_root && !omit_changes
++               && F_UID(file) != sxp->st.st_uid)
                        iflags |= ITEM_REPORT_OWNER;
 -              if (preserve_gid && F_GID(file) != GID_NONE
 -                  && sxp->st.st_gid != F_GID(file))
-+              if (preserve_gid && F_GID(file) != GID_NONE && sxp->st.st_gid != F_GID(file)
-+               && !(omit_dir_changes && S_ISDIR(sxp->st.st_mode)))
++              if (preserve_gid && !omit_changes
++               && F_GID(file) != GID_NONE && sxp->st.st_gid != F_GID(file))
                        iflags |= ITEM_REPORT_GROUP;
  #ifdef SUPPORT_ACLS
                if (preserve_acls && !S_ISLNK(file->mode)) {
-@@ -1193,7 +1195,7 @@ static void recv_generator(char *fname, 
+@@ -1193,7 +1196,7 @@ static void recv_generator(char *fname, 
                                statret = -1;
                        new_root_dir = 0;
                }