aboutsummaryrefslogtreecommitdiff
blob: 0f399b56b66eb9bf3be0c3efc56e5e0ac1eb846b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import portage

from collections import OrderedDict

from DeComp.definitions import DECOMPRESSOR_SEARCH_ORDER
from DeComp.definitions import COMPRESSOR_PROGRAM_OPTIONS, XATTRS_OPTIONS
from DeComp.definitions import DECOMPRESSOR_PROGRAM_OPTIONS, LIST_XATTRS_OPTIONS


valid_config_file_values = frozenset([
    "compression_mode",
    "digests",
    "distcc_hosts",
    "distdir",
    "envscript",
    "jobs",
    "load-average",
    "options",
    "port_logdir",
    "repo_basedir",
    "repo_name",
    "repos",
    "sharedir",
    "storedir",
    "target_distdir",
    "target_pkgdir",
    "var_tmpfs_portage",
])

confdefaults = {
    "comp_prog": COMPRESSOR_PROGRAM_OPTIONS['linux'],
    "compression_mode": 'lbzip2',
    "compressor_arch": None,
    "compressor_options": XATTRS_OPTIONS['linux'],
    "decomp_opt": DECOMPRESSOR_PROGRAM_OPTIONS['linux'],
    "decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
    "distdir": portage.settings['DISTDIR'],
    "icecream": "/var/cache/icecream",
    'list_xattrs_opt': LIST_XATTRS_OPTIONS['linux'],
    "local_overlay": "/var/db/repos/local",
    "port_conf": "/etc/portage",
    "make_conf": "%(port_conf)s/make.conf",
    "options": set(),
    "pkgdir": "/var/cache/binpkgs",
    "port_tmpdir": "/var/tmp/portage",
    "repo_basedir": "/var/db/repos",
    "repo_name": "gentoo",
    "repos": "%(storedir)s/repos",
    "sharedir": "/usr/share/catalyst",
    "shdir": "%(sharedir)s/targets",
    "storedir": "/var/tmp/catalyst",
    "target_distdir": "/var/cache/distfiles",
    "target_pkgdir": "/var/cache/binpkgs",
}

DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf'

PORT_LOGDIR_CLEAN = \
    'find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete'

MOUNT_DEFAULTS = OrderedDict([
    ('proc', {
        'enable': True,
        'source': '/proc',
        'target': '/proc',
    }),
    ('dev', {
        'enable': True,
        'source': '/dev',
        'target': '/dev',
    }),
    ('devpts', {
        'enable': True,
        'source': '/dev/pts',
        'target': '/dev/pts',
    }),
    ('shm', {
        'enable': True,
        'source': 'shm',
        'target': '/dev/shm',
    }),
    ('run', {
        'enable': True,
        'source': 'tmpfs',
        'target': '/run',
    }),
    ('portdir', {
        'enable': True,
        'source': 'config',
        'target': 'config',
    }),
    ('distdir', {
        'enable': True,
        'source': 'config',
        'target': 'config',
    }),
    ('pkgdir', {
        'enable': False,
        'source': 'config',
        'target': 'config',
    }),
    ('port_tmpdir', {
        'enable': True,
        'source': 'maybe_tmpfs',
        'target': '/var/tmp/portage',
    }),
    ('kerncache', {
        'enable': False,
        'source': 'config',
        'target': '/tmp/kerncache',
    }),
    ('port_logdir', {
        'enable': False,
        'source': 'config',
        'target': '/var/log/portage',
    }),
    ('ccache', {
        'enable': False,
        'source': 'config',
        'target': '/var/tmp/ccache',
    }),
    ('icecream', {
        'enable': False,
        'source': ...,
        'target': '/usr/lib/icecc/bin',
    }),
])

option_messages = {
    "autoresume": "Autoresuming support enabled.",
    "ccache": "Compiler cache support enabled.",
    "clear-autoresume": "Cleaning autoresume flags support enabled.",
    "distcc": "Distcc support enabled.",
    "icecream": "Icecream compiler cluster support enabled.",
    "kerncache": "Kernel cache support enabled.",
    "pkgcache": "Package cache support enabled.",
    "purge": "Purge support enabled.",
    "seedcache": "Seed cache support enabled.",
}