aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Freed <dwfreed@mtu.edu>2024-07-30 00:00:40 +0000
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-07-30 13:05:56 +0200
commitcde8a57f8c7b40e66cc6fda6f923bd8b2f21297c (patch)
treeb4ca378247c4dd3198cbc4eb066ce46ec479006d
parenttargets: improve path concatenation (diff)
downloadcatalyst-cde8a57f8c7b40e66cc6fda6f923bd8b2f21297c.tar.gz
catalyst-cde8a57f8c7b40e66cc6fda6f923bd8b2f21297c.tar.bz2
catalyst-cde8a57f8c7b40e66cc6fda6f923bd8b2f21297c.zip
stagebase: clean up config_profile_link
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--catalyst/base/stagebase.py17
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):