From 7d75e73ffa5310b7ed74b81807ca32c652f0b866 Mon Sep 17 00:00:00 2001 From: bescoto Date: Fri, 18 Jul 2003 08:55:33 +0000 Subject: Added --no-change-dir-inc-perms switch, and fix for windows mode CheckDest git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@342 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff-backup.1 | 4 ++++ rdiff-backup/rdiff_backup/Globals.py | 5 +++++ rdiff-backup/rdiff_backup/Main.py | 9 +++++++-- rdiff-backup/rdiff_backup/increment.py | 7 ++++--- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/rdiff-backup/rdiff-backup.1 b/rdiff-backup/rdiff-backup.1 index c079032..9705cac 100644 --- a/rdiff-backup/rdiff-backup.1 +++ b/rdiff-backup/rdiff-backup.1 @@ -199,6 +199,10 @@ Do not create an rdiff-backup-data directory or make any increments. In this mode rdiff-backup is similar to rsync (but usually slower). .TP +.B --no-change-dir-inc-perms +Do not change the permissions of the directory increments to match the +directories they represent. +.TP .B --no-compare-inode This relatively esoteric option prevents rdiff-backup from flagging a file as changed when its inode changes. This option may be useful if diff --git a/rdiff-backup/rdiff_backup/Globals.py b/rdiff-backup/rdiff_backup/Globals.py index 8b63e8b..78176f2 100644 --- a/rdiff-backup/rdiff_backup/Globals.py +++ b/rdiff-backup/rdiff_backup/Globals.py @@ -200,6 +200,11 @@ compare_inode = 1 # guarantee that any changes have been committed to disk. fsync_directories = 1 +# If set, directory increments are given the same permissions as the +# directories they represent. Otherwise they have the default +# permissions. +change_dir_inc_perms = 1 + def get(name): """Return the value of something in this module""" diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index 2656712..40fca1c 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -56,8 +56,9 @@ def parse_cmdlineoptions(arglist): "include-globbing-filelist=", "include-regexp=", "list-at-time=", "list-changed-since=", "list-increments", "list-increment-sizes", "no-compare-inode", - "no-compression", "no-compression-regexp=", - "no-file-statistics", "no-hard-links", "null-separator", + "no-change-dir-inc-perms", "no-compression", + "no-compression-regexp=", "no-file-statistics", + "no-hard-links", "null-separator", "override-chars-to-quote=", "parsable-output", "print-statistics", "remote-cmd=", "remote-schema=", "remove-older-than=", "restore-as-of=", "restrict=", @@ -106,6 +107,8 @@ def parse_cmdlineoptions(arglist): elif opt == "-l" or opt == "--list-increments": action = "list-increments" elif opt == '--list-increment-sizes': action = 'list-increment-sizes' + elif opt == '--no-change-dir-inc-perms': + Globals.set('change_dir_inc_perms', 0) elif opt == "--no-compare-inode": Globals.set("compare_inode", 0) elif opt == "--no-compression": Globals.set("compression", None) elif opt == "--no-compression-regexp": @@ -617,6 +620,8 @@ def ListAtTime(rp): def CheckDest(dest_rp): """Check the destination directory, """ + if Globals.quoting_enabled: + dest_rp = FilenameMapping.get_quotedrpath(dest_rp) if Globals.rbdir is None: SetConnections.UpdateGlobal('rbdir', dest_rp.append_path("rdiff-backup-data")) diff --git a/rdiff-backup/rdiff_backup/increment.py b/rdiff-backup/rdiff_backup/increment.py index f7fe5e7..8d829e2 100644 --- a/rdiff-backup/rdiff_backup/increment.py +++ b/rdiff-backup/rdiff_backup/increment.py @@ -87,9 +87,10 @@ def makedir(mirrordir, incpref): """Make file indicating directory mirrordir has changed""" dirsign = get_inc(incpref, "dir") dirsign.touch() - # Below, don't copy acls because directories can have more of them - # than ordinary files (they have default acls also). - rpath.copy_attribs(mirrordir, dirsign, acls = 0) + if Globals.change_dir_inc_perms: + # Below, don't copy acls because directories can have more of + # them than ordinary files (they have default acls also). + rpath.copy_attribs(mirrordir, dirsign, acls = 0) return dirsign def get_inc(rp, typestr, time = None): -- cgit v1.2.1