Lines 9-14
from portage.const import GLOBAL_CONFIG_PATH
Link Here
|
9 |
|
9 |
|
10 |
COMPAT_DISTDIR = 'usr/portage/distfiles' |
10 |
COMPAT_DISTDIR = 'usr/portage/distfiles' |
11 |
COMPAT_PKGDIR = 'usr/portage/packages' |
11 |
COMPAT_PKGDIR = 'usr/portage/packages' |
|
|
12 |
COMPAT_RPMDIR = 'usr/portage/rpm' |
12 |
COMPAT_MAIN_REPO = 'usr/portage' |
13 |
COMPAT_MAIN_REPO = 'usr/portage' |
13 |
|
14 |
|
14 |
|
15 |
|
Lines 46-58
def main():
Link Here
|
46 |
except OSError: |
47 |
except OSError: |
47 |
do_pkgdir = False |
48 |
do_pkgdir = False |
48 |
|
49 |
|
|
|
50 |
compat_rpmdir = os.path.join(portage.const.EPREFIX or '/', COMPAT_RPMDIR) |
51 |
try: |
52 |
do_rpmdir = os.path.samefile(config['RPMDIR'], compat_rpmdir) |
53 |
except OSError: |
54 |
do_rpmdir = False |
55 |
|
49 |
compat_main_repo = os.path.join(portage.const.EPREFIX or '/', COMPAT_MAIN_REPO) |
56 |
compat_main_repo = os.path.join(portage.const.EPREFIX or '/', COMPAT_MAIN_REPO) |
50 |
try: |
57 |
try: |
51 |
do_main_repo = os.path.samefile(config.repositories.mainRepoLocation(), compat_main_repo) |
58 |
do_main_repo = os.path.samefile(config.repositories.mainRepoLocation(), compat_main_repo) |
52 |
except OSError: |
59 |
except OSError: |
53 |
do_main_repo = False |
60 |
do_main_repo = False |
54 |
|
61 |
|
55 |
if do_distdir or do_pkgdir: |
62 |
if do_distdir or do_pkgdir or do_rpmdir: |
56 |
config_path = os.path.join(os.environ['ED'], GLOBAL_CONFIG_PATH.lstrip(os.sep), 'make.globals') |
63 |
config_path = os.path.join(os.environ['ED'], GLOBAL_CONFIG_PATH.lstrip(os.sep), 'make.globals') |
57 |
with open(config_path) as f: |
64 |
with open(config_path) as f: |
58 |
content = f.read() |
65 |
content = f.read() |
Lines 64-69
def main():
Link Here
|
64 |
compat_setting = 'PKGDIR="{}"'.format(compat_pkgdir) |
71 |
compat_setting = 'PKGDIR="{}"'.format(compat_pkgdir) |
65 |
out.einfo('Setting make.globals default {} for backward compatibility'.format(compat_setting)) |
72 |
out.einfo('Setting make.globals default {} for backward compatibility'.format(compat_setting)) |
66 |
content = re.sub('^PKGDIR=.*$', compat_setting, content, flags=re.MULTILINE) |
73 |
content = re.sub('^PKGDIR=.*$', compat_setting, content, flags=re.MULTILINE) |
|
|
74 |
if do_rpmdir: |
75 |
compat_setting = 'RPMDIR="{}"'.format(compat_rpmdir) |
76 |
out.einfo('Setting make.globals default {} for backward compatibility'.format(compat_setting)) |
77 |
content = re.sub('^RPMDIR=.*$', compat_setting, content, flags=re.MULTILINE) |
67 |
with open(config_path, 'wt') as f: |
78 |
with open(config_path, 'wt') as f: |
68 |
f.write(content) |
79 |
f.write(content) |
69 |
|
80 |
|