|
19 | 19 | _package_name = 'catalyst' |
20 | 20 | _maintainer_name, _maintainer_email = _parseaddr(__maintainer__) |
21 | 21 |
|
| 22 | +# Load EPREFIX from Portage, fall back to the empty string if it fails |
| 23 | +try: |
| 24 | + from portage.const import EPREFIX |
| 25 | +except ImportError: |
| 26 | + EPREFIX='' |
22 | 27 |
|
23 | 28 | def _posix_path(path): |
24 | 29 | """Convert a native path to a POSIX path |
@@ -48,12 +53,17 @@ def _files(prefix, root): |
48 | 53 | yield (install_directory, file_source_paths) |
49 | 54 |
|
50 | 55 |
|
51 | | -_data_files = [('/etc/catalyst', ['etc/catalyst.conf','etc/catalystrc']), |
52 | | - ('/usr/share/man/man1', ['files/catalyst.1']), |
53 | | - ('/usr/share/man/man5', ['files/catalyst-config.5', 'files/catalyst-spec.5']) |
| 56 | +_data_files = [(_os.path.join(_os.sep, EPREFIX.lstrip(_os.sep), 'etc/catalyst'), |
| 57 | + ['etc/catalyst.conf','etc/catalystrc']), |
| 58 | + (_os.path.join(_os.sep, EPREFIX.lstrip(_os.sep), 'usr/share/man/man1'), |
| 59 | + ['files/catalyst.1']), |
| 60 | + (_os.path.join(_os.sep, EPREFIX.lstrip(_os.sep), 'usr/share/man/man5'), |
| 61 | + ['files/catalyst-config.5', 'files/catalyst-spec.5']) |
54 | 62 | ] |
55 | | -_data_files.extend(_files('share/catalyst/livecd', 'livecd')) |
56 | | -_data_files.extend(_files('share/catalyst/targets', 'targets')) |
| 63 | +_data_files.extend(_files(_os.path.join(_os.sep, EPREFIX.lstrip(_os.sep), |
| 64 | + 'usr/share/catalyst/livecd'), 'livecd')) |
| 65 | +_data_files.extend(_files(_os.path.join(_os.sep, EPREFIX.lstrip(_os.sep), |
| 66 | + 'usr/share/catalyst/targets'), 'targets')) |
57 | 67 |
|
58 | 68 |
|
59 | 69 | class set_version(_Command): |
|
0 commit comments