Skip to content

/ Zope / gocept svn checkins / Archive / 2008 / 2008-09 / SVN: r6738 - in gocept.infrastructure/testing: . portage-gocept/app-backup/gocept-backup puppet/manifests/classes util/backup util/backup/doc util/backup/src/gocept/backup util/backup/src/gocept/backup/share

[ << ] [ >> ]

[ SVN: r6734 - gocept.infrastructure/feature/default... ] [ SVN: r6746 - CMFWebmail/trunk/products/CMFWebmail ... ]

SVN: r6738 - in gocept.infrastructure/testing: . portage-gocept/app-backup/gocept-backup puppet/manifests/classes util/backup util/backup/doc util/backup/src/gocept/backup util/backup/src/gocept/backup/share
Christian Kauhaus <kc(at)gocept.com>
2008-09-29 17:43:38 [ FULL ]
Author: ckauhaus
Date: Mon Sep 29 17:43:36 2008
New Revision: 6738

Log:
merged feature branch


Added:
  
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/gocept-backup-0.8.ebuild
      - copied unchanged from r6737,
gocept.infrastructure/feature/default-excludes-66083/portage-gocept/app-backup/gocept-backup/gocept-backup-0.8.ebuild
Removed:
  
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/gocept-backup-0.6.ebuild
Modified:
   gocept.infrastructure/testing/   (props changed)
  
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/Manifest
  
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/gocept-backup-0.7.ebuild
  (props changed)
   gocept.infrastructure/testing/puppet/manifests/classes/location.pp   (props
changed)
   gocept.infrastructure/testing/puppet/manifests/classes/node_types.pp  
(props changed)
   gocept.infrastructure/testing/util/backup/doc/server.cfg.in
   gocept.infrastructure/testing/util/backup/setup.py
   gocept.infrastructure/testing/util/backup/src/gocept/backup/config.py
   gocept.infrastructure/testing/util/backup/src/gocept/backup/metadata.py
   gocept.infrastructure/testing/util/backup/src/gocept/backup/run.py
   gocept.infrastructure/testing/util/backup/src/gocept/backup/share/client.sh
   gocept.infrastructure/testing/util/backup/src/gocept/backup/test_config.py
   gocept.infrastructure/testing/util/backup/src/gocept/backup/test_run.py
   gocept.infrastructure/testing/util/backup/src/gocept/backup/version.py

Modified:
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/Manifest
==============================================================================
---
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/Manifest	(original)
+++
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/Manifest	Mon
Sep 29 17:43:36 2008
(at)(at) -1,7 +1,7 (at)(at)
 AUX gocept-backup.cron 128 RMD160 2218457b50eb57219077fa83b33a4cd54fbfbf9e
SHA1 92c33dc4a95d308daf59a38d3061e839c9e76f59 SHA256
c400d029910530f19fb2e84ee7a520c482d8dc9d7734cee8ed3052ac9642d429
-DIST gocept.backup-0.6.tar.gz 25114 RMD160
e96489bd6bec8bf7e09f6b1ffab5e65fe347216c SHA1
e87a5a3219abe5dc2fe34bf721898bf51a218425 SHA256
0119cc3140d3b2bbe9e069b94e6b43376acb9f8728c96701c9e3c7e9edd4eb24
-DIST gocept.backup-0.7.tar.gz 25783 RMD160
d75555417223fa8c4430e341bf34609b16dfd885 SHA1
1f0761462295dbb77d9c0ede2eb30018e59264fd SHA256
c84d296464e5b027886b3707c852ac9f1ea74d057870dda8ee602f93ea883bd0
-EBUILD gocept-backup-0.6.ebuild 1343 RMD160
1f1d6d7d6025b0bc9e9e09bc582c013cc51c035c SHA1
5f5b9723190954a9993e3cd53aad13c6a6d7cd5d SHA256
ecc8dbd58017380c5308c8c4782fd29f30d361feffe366abfa53332ffba95e58
+DIST gocept.backup-0.7.tar.gz 26679 RMD160
9a03fc12af8cad768babe0ce708d43417f2ac4b2 SHA1
d51ddd27cae2d2a7685060e698570551395d30ed SHA256
9dd558eb9bc77637063da80ba0fcabf45d3807af17458ecb3e60d0a87d151089
+DIST gocept.backup-0.8.tar.gz 26768 RMD160
e78079982ce57509687259c05083f8db7afcf316 SHA1
6b1608ebea79b3e5b7f372cd2359ddf5451c9900 SHA256
df9ce8babe03c78ecb748a8455fe862c454d9dbb7339d0b35520492df14ce28e
 EBUILD gocept-backup-0.7.ebuild 1343 RMD160
1f1d6d7d6025b0bc9e9e09bc582c013cc51c035c SHA1
5f5b9723190954a9993e3cd53aad13c6a6d7cd5d SHA256
ecc8dbd58017380c5308c8c4782fd29f30d361feffe366abfa53332ffba95e58
+EBUILD gocept-backup-0.8.ebuild 1343 RMD160
46902af3e59271d481e19424e4d88276c95334a5 SHA1
bcad9caa411e0deb8876dfa06c49963568b08afe SHA256
ea5861d391b9acd47bc5562e8dbd5ed2face15a4c172bfd6dcdedf69d468a4f4
 MISC ChangeLog 1181 RMD160 9ae32d859312f20a36e1eac94c1d2c8db7d9b781 SHA1
6a084d3a75a95cc8ba7e37d8f2cf88d9e5920533 SHA256
72ceba21526fb5ba8a59dc6bec473e4d03292acabc71637b8f4c52f1f5e588a0
 MISC metadata.xml 218 RMD160 958e011374ddfa7f75e36e1dac7d05b664288a40 SHA1
a88a4994979e6591d092a03249c1f27286cd6e1a SHA256
c7cf3413d937c023b0de4a026ba8f9f13614d8196b71bd53b3d636494c108773

Modified: gocept.infrastructure/testing/util/backup/doc/server.cfg.in
==============================================================================
--- gocept.infrastructure/testing/util/backup/doc/server.cfg.in	(original)
+++ gocept.infrastructure/testing/util/backup/doc/server.cfg.in	Mon Sep 29
17:43:36 2008
(at)(at) -5,4 +5,4 (at)(at)
 backupdir = %(backup-directory)s
 #expire = 90
 #timeout = 28800
-#exclude = **/lost+found **/core **/*~
+#exclude = **/lost+found **/core **/*~ /tmp/*

Modified: gocept.infrastructure/testing/util/backup/setup.py
==============================================================================
--- gocept.infrastructure/testing/util/backup/setup.py	(original)
+++ gocept.infrastructure/testing/util/backup/setup.py	Mon Sep 29 17:43:36 2008
(at)(at) -1,7 +1,7 (at)(at)
 from setuptools import setup, find_packages
 import sys
 
-sys.path.append(u'src')
+sys.path.insert(0, u'src')
 import gocept.backup.version
 
 setup(
(at)(at) -14,15 +14,16 (at)(at)
 Control scripts for rdiff-backup
     """,
     long_description=file('doc/README.txt').read(),
-	zip_safe=False,
+        zip_safe=False,
     packages=find_packages('src'),
     package_dir={'': 'src'},
     package_data={'gocept.backup': ['share/*']},
     license='gocept proprietary',
+    install_requires=['setuptools'],
     extras_require={
         'test': ['mocker']},
     entry_points={
-    	'console_scripts': [
-	    'gocept-backup-server = gocept.backup.server:main',
+        'console_scripts': [
+            'gocept-backup-server = gocept.backup.server:main',
             'gocept-backup-restore = gocept.backup.restore:main']},
 )

Modified: gocept.infrastructure/testing/util/backup/src/gocept/backup/config.py
==============================================================================
---
gocept.infrastructure/testing/util/backup/src/gocept/backup/config.py	(original)
+++ gocept.infrastructure/testing/util/backup/src/gocept/backup/config.py	Mon
Sep 29 17:43:36 2008
(at)(at) -19,7 +19,7 (at)(at)
         u'backupdir': u'backup',
         u'expire': 90,
         u'timeout': 28800,
-        u'exclude': u'**/lost+found **/core **/*~'}
+        u'exclude': u'**/lost+found **/core **/*~ /tmp/*'}
 
     def __init__(self, input=None):
         self.settings = dict(self.DEFAULTS)

Modified:
gocept.infrastructure/testing/util/backup/src/gocept/backup/metadata.py
==============================================================================
---
gocept.infrastructure/testing/util/backup/src/gocept/backup/metadata.py	(original)
+++ gocept.infrastructure/testing/util/backup/src/gocept/backup/metadata.py	Mon
Sep 29 17:43:36 2008
(at)(at) -65,13 +65,18 (at)(at)
         except KeyError:
             pass
 
-    def exclude(self, partition):
-        return [excl for excl in self.excludes
-                if excl.find(partition) == 0 or not excl.startswith(u'/')]
+    def filter(self, backuppartition, list):
+        return [part for part in list
+                if part.find(backuppartition) == 0 or not
part.startswith(u'/')]
 
     def include(self, partition):
-        return [incl for incl in self.includes
-                if incl.find(partition) == 0 or not incl.startswith(u'/')]
+        return self.filter(partition, self.includes)
+
+    def exclude(self, partition):
+        return self.filter(partition, self.excludes)
+
+    def defaultexclude(self, partition):
+        return self.filter(partition, self.conf.exclude)
 
     def partitions(self):
         """Parse the ``partitons`` file and return it as list."""

Modified: gocept.infrastructure/testing/util/backup/src/gocept/backup/run.py
==============================================================================
---
gocept.infrastructure/testing/util/backup/src/gocept/backup/run.py	(original)
+++ gocept.infrastructure/testing/util/backup/src/gocept/backup/run.py	Mon Sep
29 17:43:36 2008
(at)(at) -47,7 +47,7 (at)(at)
         if excl:
             for e in excl:
                 args.extend([u'--exclude', e])
-        for excl in self.meta.conf.exclude:
+        for excl in self.meta.defaultexclude(self.partition):
             args.extend([u'--exclude', excl])
         args.extend([u'--exclude-other-filesystems',
                      u'%s::%s' % (self.meta.host, self.partition),
self.target])

Modified:
gocept.infrastructure/testing/util/backup/src/gocept/backup/share/client.sh
==============================================================================
---
gocept.infrastructure/testing/util/backup/src/gocept/backup/share/client.sh	(original)
+++
gocept.infrastructure/testing/util/backup/src/gocept/backup/share/client.sh	Mon
Sep 29 17:43:36 2008
(at)(at) -4,7 +4,7 (at)(at)
 # further actions.
 set -e
 
-VERSION="0.7"
+VERSION="0.8"
 ETCDIR="${ROOTDIR}/etc"
 CONFDIR="${ETCDIR}/gocept-backup"
 

Modified:
gocept.infrastructure/testing/util/backup/src/gocept/backup/test_config.py
==============================================================================
---
gocept.infrastructure/testing/util/backup/src/gocept/backup/test_config.py	(original)
+++
gocept.infrastructure/testing/util/backup/src/gocept/backup/test_config.py	Mon
Sep 29 17:43:36 2008
(at)(at) -18,7 +18,8 (at)(at)
         self.assertEqual(u'backup', c.backupdir)
         self.assertEqual(90, c.expire)
         self.assertEqual(28800, c.timeout)
-        self.assertEqual([u'**/lost+found', u'**/core', u'**/*~'], c.exclude)
+        self.assertEqual([u'**/lost+found', u'**/core', u'**/*~', u'/tmp/*'],
+                         c.exclude)
 
     def test_parse(self):
         io = StringIO.StringIO("""

Modified:
gocept.infrastructure/testing/util/backup/src/gocept/backup/test_run.py
==============================================================================
---
gocept.infrastructure/testing/util/backup/src/gocept/backup/test_run.py	(original)
+++ gocept.infrastructure/testing/util/backup/src/gocept/backup/test_run.py	Mon
Sep 29 17:43:36 2008
(at)(at) -30,6 +30,13 (at)(at)
             message = u'%r is not in %r' % (expected, actual)
         self.assert_(act.find(exp) != -1, message)
 
+    def assertNotSublist(self, expected, actual, message=None):
+        exp = u'%%'.join(expected)
+        act = u'%%'.join(actual)
+        if not message:
+            message = u"%r is in %r but shouldn't" % (expected, actual)
+        self.assert_(act.find(exp) == -1, message)
+
 
 class RunEtcTest(RunTestBase):
 
(at)(at) -64,6 +71,10 (at)(at)
         self.assertSublist([u'--exclude', u'**/lost+found'],
                            self.runner.prepare())
 
+    def test_prepare_should_filter_default_excludes(self):
+        self.assertNotSublist([u'--exclude', u'/tmp/*'],
+                           self.runner.prepare())
+
     def test_prepare_should_consider_exclude_include(self):
         self.meta.excludes = [u'/etc/mtab', u'*~', u'/var/tmp']
         self.meta.includes = [u'/etc/mtab-']

Modified:
gocept.infrastructure/testing/util/backup/src/gocept/backup/version.py
==============================================================================
---
gocept.infrastructure/testing/util/backup/src/gocept/backup/version.py	(original)
+++ gocept.infrastructure/testing/util/backup/src/gocept/backup/version.py	Mon
Sep 29 17:43:36 2008
(at)(at) -1,4 +1,4 (at)(at)
 # Copyright (c) 2008 gocept gmbh & co. kg
 # See also LICENSE.txt
 
-VERSION = u'0.7'
+VERSION = u'0.8'

MailBoxer