changeset 4108:1cd493d5e113

fix backup action configuration (broke on windows due to backslashes in e.g. cache_dir)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 18 Sep 2008 22:19:44 +0200
parents a1858613ea4f
children e88baf535b48
files MoinMoin/action/backup.py MoinMoin/config/multiconfig.py docs/CHANGES
diffstat 3 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/backup.py	Tue Sep 16 20:48:54 2008 +0200
+++ b/MoinMoin/action/backup.py	Thu Sep 18 22:19:44 2008 +0200
@@ -44,7 +44,7 @@
     tar = tarfile.open(fileobj=request, mode="w|%s" % request.cfg.backup_compression)
     # allow GNU tar's longer file/pathnames
     tar.posix = False
-    for path in request.cfg.cache.backup_include:
+    for path in request.cfg.backup_include:
         addFiles(path, tar, request.cfg.cache.backup_exclude_regex)
     tar.close()
 
--- a/MoinMoin/config/multiconfig.py	Tue Sep 16 20:48:54 2008 +0200
+++ b/MoinMoin/config/multiconfig.py	Thu Sep 18 22:19:44 2008 +0200
@@ -325,10 +325,8 @@
         # e.g u'%(page_front_page)s' % self
         self.navi_bar = [elem % self for elem in self.navi_bar]
 
-        # expand %(...)s placeholders, compile regex and cache it
-        self.cache.backup_exclude_regex = re.compile("|".join(
-                                              [elem % self for elem in self.backup_exclude]))
-        self.cache.backup_include = [elem % self for elem in self.backup_include]
+        # compile regex for backup exclusions and cache it
+        self.cache.backup_exclude_regex = re.compile("|".join(self.backup_exclude))
 
         # check if python-xapian is installed
         if self.xapian_search:
@@ -1205,11 +1203,10 @@
     (
       ('compression', 'gz', 'What compression to use for the backup ("gz" or "bz2").'),
       ('users', [], 'List of trusted user names who are allowed to get a backup.'),
-      ('include', ['%(data_dir)s', ], 'List of pathes to backup.'),
+      ('include', [], 'List of pathes to backup.'),
       ('exclude',
        [
         r"(.+\.py(c|o)$)",
-        r"%(cache_dir)s",
         r"%(/)spages%(/)s.+%(/)scache%(/)s[^%(/)s]+$" % {'/': os.sep},
         r"%(/)s(edit-lock|event-log|\.DS_Store)$" % {'/': os.sep},
        ],
--- a/docs/CHANGES	Tue Sep 16 20:48:54 2008 +0200
+++ b/docs/CHANGES	Thu Sep 18 22:19:44 2008 +0200
@@ -102,8 +102,10 @@
     * user_autocreate setting was removed from wiki configuration and replaced
       by a autocreate=<boolean> parameter of the auth objects that support user
       profile auto creation.
-    * backup action: you can now use placeholders for backup_include setting
-      and this list now defaults to ['%(data_dir)s', ].
+    * backup action: backup_exclude does not do %(placeholder)s expansion any
+      more, because of unfixable problems with regex special characters in
+      pathes (e.g. backslashes in windows pathes). The %(cache_dir)s placeholder
+      was removed because of this.
 
 
 Version 1.7.2: