1 # Copyright © 2015 Nick Bowler
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY of FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>
16 from portage.sync.config_checks import CheckSyncConfig
18 class CheckSquashConfig(CheckSyncConfig):
19 def __init__(self, repo, logger):
20 CheckSyncConfig.__init__(self, repo, logger)
21 self.checks.append('set_defaults')
23 def set_defaults(self):
24 opts = self.repo.module_specific_options
25 if not 'squash-cache-location' in opts:
26 opts['squash-cache-location'] = "/var/cache/portage"
27 if not 'squash-compression' in opts:
28 opts['squash-compression'] = "gzip"
29 if not 'squash-extra-opts' in opts:
30 opts['squash-extra-opts'] = "-e distfiles -e packages -e local"
33 'name': 'squashmirror',
34 'description': __doc__,
36 'squashmirror-module': {
37 'name': 'squashmirror',
38 'description': __doc__,
39 'class': 'SquashMirror',
40 'validate_config': CheckSquashConfig,
41 'module_specific_options': (
42 'squash-cache-location',