From 71ea549d3d0d7b5abfd649182bdbac4f641093a3 Mon Sep 17 00:00:00 2001 From: bescoto Date: Fri, 18 Jul 2003 09:04:11 +0000 Subject: Added --no-change-dir-inc-perms switch, fixed windows mode checkdest bug git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/branches/r0-12@343 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 11 +++++++++++ rdiff-backup/rdiff-backup.1 | 5 +++++ rdiff-backup/rdiff_backup/Globals.py | 5 +++++ rdiff-backup/rdiff_backup/Main.py | 22 +++++++++++++--------- rdiff-backup/rdiff_backup/increment.py | 2 +- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 804c873..3d1a8b6 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,3 +1,14 @@ +New in v0.12.1 (2003/07/??) +--------------------------- + +Added --no-change-dir-inc-perms switch, to avoid some weird errors on +FreeBSD, and possibly on Solaris. Thanks to Troels Arvin for +report. + +Fixed bug when regressing destination directory made with +--windows-mode. Reported by Tucker Sylvestro. + + New in v0.12.0 (2003/06/26) --------------------------- diff --git a/rdiff-backup/rdiff-backup.1 b/rdiff-backup/rdiff-backup.1 index b6ecbe4..024c68c 100644 --- a/rdiff-backup/rdiff-backup.1 +++ b/rdiff-backup/rdiff-backup.1 @@ -201,6 +201,11 @@ 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. This option may be required on file +systems where regular files cannot have their sticky bit set. +.TP .B --no-compare-inode This relative 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 0d83d4c..726ab8b 100644 --- a/rdiff-backup/rdiff_backup/Globals.py +++ b/rdiff-backup/rdiff_backup/Globals.py @@ -183,6 +183,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 5a03fb5..d65667b 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -52,15 +52,15 @@ def parse_cmdlineoptions(arglist): "include=", "include-filelist=", "include-filelist-stdin", "include-globbing-filelist=", "include-regexp=", "list-at-time=", "list-changed-since=", "list-increments", - "no-compare-inode", "no-compression", - "no-compression-regexp=", "no-file-statistics", - "no-hard-links", "null-separator", "parsable-output", - "print-statistics", "quoting-char=", "remote-cmd=", - "remote-schema=", "remove-older-than=", "restore-as-of=", - "restrict=", "restrict-read-only=", "restrict-update-only=", - "server", "ssh-no-compression", "terminal-verbosity=", - "test-server", "verbosity=", "version", "windows-mode", - "windows-restore"]) + "no-change-dir-inc-perms", "no-compare-inode", + "no-compression", "no-compression-regexp=", + "no-file-statistics", "no-hard-links", "null-separator", + "parsable-output", "print-statistics", "quoting-char=", + "remote-cmd=", "remote-schema=", "remove-older-than=", + "restore-as-of=", "restrict=", "restrict-read-only=", + "restrict-update-only=", "server", "ssh-no-compression", + "terminal-verbosity=", "test-server", "verbosity=", + "version", "windows-mode", "windows-restore"]) except getopt.error, e: commandline_error("Bad commandline options: %s" % str(e)) @@ -105,6 +105,8 @@ def parse_cmdlineoptions(arglist): restore_timestr, action = arg, "list-changed-since" elif opt == "-l" or opt == "--list-increments": action = "list-increments" + 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": @@ -583,6 +585,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 40cb8d8..ce6585c 100644 --- a/rdiff-backup/rdiff_backup/increment.py +++ b/rdiff-backup/rdiff_backup/increment.py @@ -87,7 +87,7 @@ def makedir(mirrordir, incpref): """Make file indicating directory mirrordir has changed""" dirsign = get_inc(incpref, "dir") dirsign.touch() - rpath.copy_attribs(mirrordir, dirsign) + if Globals.change_dir_inc_perms: rpath.copy_attribs(mirrordir, dirsign) return dirsign def get_inc(rp, typestr, time = None): -- cgit v1.2.1