diff options
-rw-r--r-- | catalyst/base/stagebase.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 2dcf6d71..df2da7ef 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -864,18 +864,23 @@ class StageBase(TargetBase, ClearBase, GenBase): def config_profile_link(self): log.info('Configuring profile link...') - make_profile = Path(self.settings['chroot_path'] + self.settings['port_conf'], - 'make.profile') + + chroot_port_conf = Path(self.settings['chroot_path'] + self.settings['port_conf']) + make_profile = chroot_port_conf / 'make.profile' make_profile.unlink(missing_ok=True) + try: repo_name, target_profile = self.settings['target_profile'].split(":", 1) except ValueError: repo_name = self.settings['repo_name'] target_profile = self.settings['target_profile'] - make_profile.symlink_to(Path('../..' + self.settings['repo_basedir'], - repo_name, - 'profiles', - target_profile), + + chroot_profile_path = Path(self.settings['chroot_path'] + self.settings['repo_basedir'], + repo_name, + 'profiles', + target_profile) + + make_profile.symlink_to(os.path.relpath(chroot_profile_path, chroot_port_conf), target_is_directory=True) def setup_confdir(self): |