]> Frank Brehm's Git Trees - my-stuff/py-logrotate.git/commitdiff
Mit Optionen weitergemacht
authorFrank Brehm <frank@brehm-online.com>
Sun, 1 May 2011 21:18:47 +0000 (21:18 +0000)
committerFrank Brehm <frank@brehm-online.com>
Sun, 1 May 2011 21:18:47 +0000 (21:18 +0000)
git-svn-id: http://svn.brehm-online.com/svn/my-stuff/python/PyLogrotate/trunk@221 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa

LogRotateConfig.py

index a1debb0c32adee1d4e400bf1bd3b8f0037de4f40..3e3a5acc735ac3a48614ee4ee4bc4ed930cd0c3b 100755 (executable)
@@ -57,6 +57,14 @@ unsupported_options = (
     'error',
 )
 
+boolean_options = (
+    'compress',
+    'copytruncate',
+    'ifempty',
+    'missingok',
+    'sharedscripts',
+)
+
 #========================================================================
 
 class LogrotateConfigurationError(Exception):
@@ -906,6 +914,20 @@ class LogrotateConfigurationReader(object):
             )
             return True
 
+        # Check for boolean option
+        pattern = r'^(not?)?(' + '|'.join(boolean_options) + r')$'
+        match = re.search(pattern, option, re.IGNORECASE)
+        if match:
+            negated = match.group(1)
+            key     = match.group(2).lower()
+            if self.verbose > 4:
+                pass
+            if negated is None:
+                option_value = True
+            else:
+                option_value = False
+            
+
         return True
 
     #------------------------------------------------------------