diff options
author | Matt Turner <mattst88@gentoo.org> | 2020-04-18 16:32:08 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gentoo.org> | 2020-04-21 22:51:22 -0700 |
commit | ddc1b50d47ffde9b9bbceb83ce0b5a6cb7045e1b (patch) | |
tree | 0b29c3e1c3774b1471d264cec22c035aac88350d | |
parent | catalyst: Make shdir default match config (diff) | |
download | catalyst-ddc1b50d.tar.gz catalyst-ddc1b50d.tar.bz2 catalyst-ddc1b50d.zip |
catalyst: Simplify config_profile_link()
I see no use in making this a resume point since making a symlink is a
cheap operation.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
-rw-r--r-- | catalyst/base/stagebase.py | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index cc997688..0531cf61 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -3,6 +3,9 @@ import os import platform import shutil import sys + +from pathlib import Path + import toml from snakeoil import fileutils @@ -902,24 +905,16 @@ class StageBase(TargetBase, ClearBase, GenBase): self.snapcache_lock.unlock() def config_profile_link(self): - if "autoresume" in self.settings["options"] \ - and self.resume.is_enabled("config_profile_link"): - log.notice( - 'Resume point detected, skipping config_profile_link operation...') - else: - # TODO: zmedico and I discussed making this a directory and pushing - # in a parent file, as well as other user-specified configuration. - log.info('Configuring profile link...') - clear_path(self.settings['chroot_path'] + - self.settings['port_conf'] + '/make.profile') - ensure_dirs(self.settings['chroot_path'] + - self.settings['port_conf']) - cmd(['ln', '-sf', - '../..' + self.settings['portdir'] + - '/profiles/' + self.settings['target_profile'], - self.settings['chroot_path'] + self.settings['port_conf'] + '/make.profile'], - env=self.env) - self.resume.enable("config_profile_link") + log.info('Configuring profile link...') + make_profile = Path(self.settings['chroot_path'], + self.settings['port_conf'], + 'make.profile') + make_profile.unlink() + make_profile.symlink_to(Path('../..', + self.settings['portdir'], + 'profiles', + self.settings['target_profile']), + target_is_directory=True) def setup_confdir(self): if "autoresume" in self.settings["options"] \ |