Skip to content

Commit 0e5bb2b

Browse files
committed
catalyst/defaults.py: use EPREFIX where apropriate
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
1 parent be84b39 commit 0e5bb2b

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

catalyst/defaults.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
else:
1212
TAR = 'bsd'
1313

14+
# establish the eprefix, initially set so eprefixify can
15+
# set it on install
16+
EPREFIX = "@GENTOO_PORTAGE_EPREFIX@".lstrip(os.sep)
17+
# check and set it if it wasn't
18+
if "GENTOO_PORTAGE_EPREFIX" in EPREFIX:
19+
EPREFIX = ''
1420

1521
# these should never be touched
1622
required_build_targets = ["targetbase", "generic_stage_target"]
@@ -33,7 +39,7 @@
3339

3440
# set our base defaults here to keep
3541
# them in one location.
36-
BASE_GENTOO_DIR = "/var/gentoo"
42+
BASE_GENTOO_DIR = os.path.join(os.sep, EPREFIX, "var/gentoo")
3743
REPODIR = BASE_GENTOO_DIR + "/repos"
3844
DISTDIR = BASE_GENTOO_DIR + "/distfiles"
3945
PKGDIR = BASE_GENTOO_DIR + "/packages"
@@ -50,30 +56,30 @@
5056
"decompressor_search_order": DECOMPRESSOR_SEARCH_ORDER,
5157
"distdir": DISTDIR[:],
5258
"hash_function": "crc32",
53-
"icecream": "/var/cache/icecream",
59+
"icecream": os.path.join(os.sep, EPREFIX, "var/cache/icecream"),
5460
'list_xattrs_opt': LIST_XATTRS_OPTIONS[TAR],
5561
"local_overlay": REPODIR[:] + "/local",
5662
"port_conf": "/etc/portage",
5763
"make_conf": "%(port_conf)s/make.conf",
5864
"options": set(),
5965
"packagedir": PKGDIR[:],
6066
"portdir": PORTDIR[:],
61-
"port_tmpdir": "/var/tmp/portage",
67+
"port_tmpdir": os.path.join(os.sep, EPREFIX, "var/tmp/portage"),
6268
"PythonDir": "./catalyst",
6369
"repo_basedir": REPODIR[:],
6470
"repo_name": MAINREPO[:],
6571
"sed": "sed",
66-
"sharedir": "/usr/share/catalyst",
67-
"shdir": "/usr/share/catalyst/targets/",
68-
"snapshot_cache": "/var/tmp/catalyst/snapshot_cache",
72+
"sharedir": os.path.join(os.sep, EPREFIX, "usr/share/catalyst"),
73+
"shdir": os.path.join(os.sep, EPREFIX, "usr/share/catalyst/targets/"),
74+
"snapshot_cache": os.path.join(os.sep, EPREFIX, "var/tmp/catalyst/snapshot_cache"),
6975
"snapshot_name": "%(repo_name)s-",
7076
"source_matching": "strict",
71-
"storedir": "/var/tmp/catalyst",
77+
"storedir": os.path.join(os.sep, EPREFIX, "var/tmp/catalyst"),
7278
"target_distdir": DISTDIR[:],
7379
"target_pkgdir": PKGDIR[:],
7480
}
7581

76-
DEFAULT_CONFIG_FILE = '/etc/catalyst/catalyst.conf'
82+
DEFAULT_CONFIG_FILE = os.path.join(os.sep, EPREFIX, 'etc/catalyst/catalyst.conf')
7783

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

0 commit comments

Comments
 (0)