Ignore generated files and dirs.
[rsync/rsync.git] / generator.c
index 530c274..dbcd80e 100644 (file)
@@ -84,6 +84,7 @@ extern int list_only;
 extern int read_batch;
 extern int safe_symlinks;
 extern long block_size; /* "long" because popt can't set an int32. */
+extern int unsort_ndx;
 extern int max_delete;
 extern int force_delete;
 extern int one_file_system;
@@ -95,9 +96,6 @@ extern char *backup_suffix;
 extern int backup_suffix_len;
 extern struct file_list *cur_flist, *first_flist, *dir_flist;
 extern struct filter_list_struct server_filter_list;
-#ifdef ICONV_OPTION
-extern int ic_ndx;
-#endif
 
 int ignore_perishable = 0;
 int non_perishable_cnt = 0;
@@ -517,6 +515,14 @@ static void do_delete_pass(void)
 
 int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp)
 {
+#ifndef HAVE_LUTIMES
+       if (S_ISLNK(file->mode)) {
+               ;
+       } else
+#endif
+       if (preserve_times && cmp_time(sxp->st.st_mtime, file->modtime) != 0)
+               return 0;
+
        if (preserve_perms && !BITS_EQUAL(sxp->st.st_mode, file->mode, CHMOD_BITS))
                return 0;
 
@@ -895,9 +901,6 @@ static int try_dests_reg(struct file_struct *file, char *fname, int ndx,
                case 2:
                        if (!unchanged_attrs(cmpbuf, file, sxp))
                                continue;
-                       if (always_checksum > 0 && preserve_times
-                        && cmp_time(sxp->st.st_mtime, file->modtime))
-                               continue;
                        best_match = j;
                        match_level = 3;
                        break;
@@ -1957,7 +1960,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
 
                if (delete_during == 2 || !dir_tweaking) {
                        /* Skip directory touch-up. */
-               } else if (first_flist->ndx_start != 0)
+               } else if (first_flist->parent_ndx >= 0)
                        touch_up_dirs(dir_flist, first_flist->parent_ndx);
 
                flist_free(first_flist); /* updates first_flist */
@@ -2032,7 +2035,7 @@ void generate_files(int f_out, const char *local_name)
                }
 #endif
 
-               if (inc_recurse && cur_flist->ndx_start) {
+               if (inc_recurse && cur_flist->parent_ndx >= 0) {
                        struct file_struct *fp = dir_flist->files[cur_flist->parent_ndx];
                        f_name(fp, fbuf);
                        ndx = cur_flist->ndx_start - 1;
@@ -2055,11 +2058,9 @@ void generate_files(int f_out, const char *local_name)
                        if (!F_IS_ACTIVE(file))
                                continue;
 
-#ifdef ICONV_OPTION
-                       if (ic_ndx)
+                       if (unsort_ndx)
                                ndx = F_NDX(file);
                        else
-#endif
                                ndx = i + cur_flist->ndx_start;
 
                        if (solo_file)