redmine

Fixed "excluding everything if -X is enabled"

Fixes: https://github.com/xaionaro/clsync/issues/115
Regressed by: 5e6cfe1d
... ... @@ -2413,7 +2413,6 @@ int main(int _argc, char *_argv[]) {
}
debug(5, "rwatchdir == \"%s\"", rwatchdir);
/*
stat64_t stat64={0};
if (lstat64(ctx_p->watchdir, &stat64)) {
error("Cannot lstat64() on \"%s\"", ctx_p->watchdir);
... ... @@ -2422,6 +2421,7 @@ int main(int _argc, char *_argv[]) {
} else {
if (ctx_p->flags[EXCLUDEMOUNTPOINTS])
ctx_p->st_dev = stat64.st_dev;
/*
if ((stat64.st_mode & S_IFMT) == S_IFLNK) {
// The proplems may be due to FTS_PHYSICAL option of ftp_open() in sync_initialsync_rsync_walk(),
// so if the "watch dir" is just a symlink it doesn't walk recursivly. For example, in "-R" case
... ... @@ -2475,8 +2475,8 @@ int main(int _argc, char *_argv[]) {
free(watchdir_resolved_part);
#endif // VERYPARANOID else
}
}
*/
}
if (!ret) {
parse_parameter(ctx_p, WATCHDIR, rwatchdir, PS_CORRECTION);
... ...
... ... @@ -1351,12 +1351,15 @@ int sync_initialsync_walk(ctx_t *ctx_p, const char *dirpath, indexes_t *indexes_
if (ctx_p->flags[EXCLUDEMOUNTPOINTS] && node->fts_info==FTS_D) {
if (rsync_and_prefer_excludes) {
if (node->fts_statp->st_dev != ctx_p->st_dev) {
debug(3, "Excluding \"%s\" due to location on other device: node->fts_statp->st_dev [0x%o] != ctx_p->st_dev [0x%o]", path_rel, node->fts_statp->st_dev, ctx_p->st_dev);
if (queue_id == QUEUE_AUTO) {
int i=0;
while (i<QUEUE_MAX)
indexes_addexclude(indexes_p, strdup(path_rel), EVIF_CONTENTRECURSIVELY, i++);
} else
indexes_addexclude(indexes_p, strdup(path_rel), EVIF_CONTENTRECURSIVELY, queue_id);
fts_set(tree, node, FTS_SKIP);
}
} else
if (!ctx_p->flags[RSYNCPREFERINCLUDE])
... ...