Commit b0371fcc authored by Guillaume Hervier's avatar Guillaume Hervier Committed by Rafael Monnerat

Add option to ignore UID/GID when comparing file changes

/reviewed-on !2
parent b80dbbd5
......@@ -251,6 +251,10 @@ symlink_perms = None
# tempfile.tempdir value on remote connections
remote_tempdir = None
# If set, don't compare uid/gid or uname/gname when comparing
# two RORPath
ignore_numerical_ids = None
def get(name):
"""Return the value of something in this module"""
return globals()[name]
......
......@@ -71,6 +71,7 @@ def parse_cmdlineoptions(arglist):
"exclude-globbing-filelist-stdin", "exclude-mirror=",
"exclude-other-filesystems", "exclude-regexp=", "exclude-if-present=",
"exclude-special-files", "force", "group-mapping-file=",
"ignore-numerical-ids",
"include=", "include-filelist=", "include-filelist-stdin",
"include-globbing-filelist=",
"include-globbing-filelist-stdin", "include-regexp=",
......@@ -136,6 +137,7 @@ def parse_cmdlineoptions(arglist):
elif opt == "--always-snapshot-fromfile":
with open(arg, 'rb') as fin:
Globals.always_snapshot.extend(tuple(line.strip('\n').split('/')) for line in fin.xreadlines())
elif opt == "--ignore-numerical-ids": Globals.set("ignore_numerical_ids", 1)
elif (opt == "--include" or
opt == "--include-special-files" or
opt == "--include-symbolic-links"):
......
......@@ -436,6 +436,7 @@ class RORPath:
for key in self.data.keys(): # compare dicts key by key
if self.issym() and key in ('uid', 'gid', 'uname', 'gname'):
pass # Don't compare gid/uid for symlinks
elif key in ('uid', 'gid', 'uname', 'gname') and Globals.ignore_numerical_ids: pass
elif key == 'atime' and not Globals.preserve_atime: pass
elif key == 'ctime': pass
elif key == 'nlink': pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment