From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 140B2138350 for ; Wed, 22 Apr 2020 05:52:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4E24FE0B73; Wed, 22 Apr 2020 05:52:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 32D10E0B73 for ; Wed, 22 Apr 2020 05:52:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2E49F34F123 for ; Wed, 22 Apr 2020 05:52:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5D5DC1F2 for ; Wed, 22 Apr 2020 05:52:40 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1587534682.ddc1b50d47ffde9b9bbceb83ce0b5a6cb7045e1b.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py X-VCS-Directories: catalyst/base/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: ddc1b50d47ffde9b9bbceb83ce0b5a6cb7045e1b X-VCS-Branch: master Date: Wed, 22 Apr 2020 05:52:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9278d6b6-a753-4241-a49c-feafd84c99d1 X-Archives-Hash: 85aec13121cb6e94f6b95b93ffe89775 commit: ddc1b50d47ffde9b9bbceb83ce0b5a6cb7045e1b Author: Matt Turner gentoo org> AuthorDate: Sat Apr 18 23:32:08 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Wed Apr 22 05:51:22 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ddc1b50d 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 gentoo.org> catalyst/base/stagebase.py | 31 +++++++++++++------------------ 1 file 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"] \