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 6A703138359 for ; Thu, 17 Sep 2020 21:13:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8E47DE0826; Thu, 17 Sep 2020 21:13:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 6A99DE0823 for ; Thu, 17 Sep 2020 21:13:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 36B2D33BF21 for ; Thu, 17 Sep 2020 21:13:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AB89C32C for ; Thu, 17 Sep 2020 21:13:33 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1599250697.52b7235e399444247adf3d9c24a20dd57db50f20.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:dilfridge/image commit in: catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py X-VCS-Directories: catalyst/base/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: 52b7235e399444247adf3d9c24a20dd57db50f20 X-VCS-Branch: dilfridge/image Date: Thu, 17 Sep 2020 21:13:33 +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: addcf9b7-0609-480c-b78b-03db98433edf X-Archives-Hash: 7ca4d3bdbeb308db91ea2d3ecb5a45bf commit: 52b7235e399444247adf3d9c24a20dd57db50f20 Author: Andreas K. Hüttel gentoo org> AuthorDate: Fri Sep 4 16:34:54 2020 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Fri Sep 4 20:18:17 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=52b7235e Allow "interpreter" parameter as space-separated list of files Signed-off-by: Andreas K. Hüttel gentoo.org> catalyst/base/stagebase.py | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index afeda722..0cf3495a 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1061,21 +1061,28 @@ class StageBase(TargetBase, ClearBase, GenBase): shutil.copy('/etc/resolv.conf', self.settings['chroot_path'] + '/etc/') - # Copy over the binary interpreter (qemu), if applicable; note that it's given - # as full path and goes to the same place in the chroot + # Copy over the binary interpreter(s) (qemu), if applicable; note that they are given + # as space-separated list of full paths and go to the same place in the chroot if "interpreter" in self.settings: - if not os.path.exists(self.settings["interpreter"]): - raise CatalystError( - "Can't find interpreter " + self.settings["interpreter"], - print_traceback=True) - log.notice('Copying binary interpreter %s into chroot', self.settings['interpreter']) + if isinstance(self.settings["interpreter"], str): + myints = [self.settings["interpreter"]] + else: + myints = self.settings["interpreter"] + + for myi in myints: + if not os.path.exists(myi): + raise CatalystError( + "Can't find interpreter " + myi, + print_traceback=True) - if os.path.exists(self.settings['chroot_path'] + '/' + self.settings['interpreter']): - os.rename(self.settings['chroot_path'] + '/' + self.settings['interpreter'], self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst') + log.notice('Copying binary interpreter %s into chroot', myi) - shutil.copy(self.settings['interpreter'], - self.settings['chroot_path'] + '/' + self.settings['interpreter']) + if os.path.exists(self.settings['chroot_path'] + '/' + myi): + os.rename(self.settings['chroot_path'] + '/' + myi, self.settings['chroot_path'] + '/' + myi + '.catalyst') + + shutil.copy(myi, + self.settings['chroot_path'] + '/' + myi) # Copy over the envscript, if applicable if "envscript" in self.settings: @@ -1242,12 +1249,19 @@ class StageBase(TargetBase, ClearBase, GenBase): if os.path.exists(hosts_file + '.catalyst'): os.rename(hosts_file + '.catalyst', hosts_file) - # optionally clean up binary interpreter + # optionally clean up binary interpreter(s) if "interpreter" in self.settings: - if os.path.exists(self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst'): - os.rename(self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst', self.settings['chroot_path'] + '/' + self.settings['interpreter']) + + if isinstance(self.settings["interpreter"], str): + myints = [self.settings["interpreter"]] else: - os.remove(self.settings['chroot_path'] + '/' + self.settings['interpreter']) + myints = self.settings["interpreter"] + + for myi in myints: + if os.path.exists(self.settings['chroot_path'] + '/' + myi + '.catalyst'): + os.rename(self.settings['chroot_path'] + '/' + myi + '.catalyst', self.settings['chroot_path'] + '/' + myi) + else: + os.remove(self.settings['chroot_path'] + '/' + myi) # optionally clean up portage configs if ("portage_prefix" in self.settings and 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 8C00E138359 for ; Sat, 5 Sep 2020 18:33:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1BC1E083B; Sat, 5 Sep 2020 18:33:27 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 7DFDAE083B for ; Sat, 5 Sep 2020 18:33:27 +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 3F7C0340A85 for ; Sat, 5 Sep 2020 18:33:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AD669335 for ; Sat, 5 Sep 2020 18:33:24 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1599250697.52b7235e399444247adf3d9c24a20dd57db50f20.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:catalyst-3.0-stable commit in: catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py X-VCS-Directories: catalyst/base/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: 52b7235e399444247adf3d9c24a20dd57db50f20 X-VCS-Branch: catalyst-3.0-stable Date: Sat, 5 Sep 2020 18:33:24 +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: c46af176-c463-45b5-988b-a397738aa402 X-Archives-Hash: 91f8af117b3a6516a756b57d58035ef1 Message-ID: <20200905183324.iTO45llIvvqgL2Xy8sc50CrsvBD0Tc2-K2kgFP312GY@z> commit: 52b7235e399444247adf3d9c24a20dd57db50f20 Author: Andreas K. Hüttel gentoo org> AuthorDate: Fri Sep 4 16:34:54 2020 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Fri Sep 4 20:18:17 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=52b7235e Allow "interpreter" parameter as space-separated list of files Signed-off-by: Andreas K. Hüttel gentoo.org> catalyst/base/stagebase.py | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index afeda722..0cf3495a 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -1061,21 +1061,28 @@ class StageBase(TargetBase, ClearBase, GenBase): shutil.copy('/etc/resolv.conf', self.settings['chroot_path'] + '/etc/') - # Copy over the binary interpreter (qemu), if applicable; note that it's given - # as full path and goes to the same place in the chroot + # Copy over the binary interpreter(s) (qemu), if applicable; note that they are given + # as space-separated list of full paths and go to the same place in the chroot if "interpreter" in self.settings: - if not os.path.exists(self.settings["interpreter"]): - raise CatalystError( - "Can't find interpreter " + self.settings["interpreter"], - print_traceback=True) - log.notice('Copying binary interpreter %s into chroot', self.settings['interpreter']) + if isinstance(self.settings["interpreter"], str): + myints = [self.settings["interpreter"]] + else: + myints = self.settings["interpreter"] + + for myi in myints: + if not os.path.exists(myi): + raise CatalystError( + "Can't find interpreter " + myi, + print_traceback=True) - if os.path.exists(self.settings['chroot_path'] + '/' + self.settings['interpreter']): - os.rename(self.settings['chroot_path'] + '/' + self.settings['interpreter'], self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst') + log.notice('Copying binary interpreter %s into chroot', myi) - shutil.copy(self.settings['interpreter'], - self.settings['chroot_path'] + '/' + self.settings['interpreter']) + if os.path.exists(self.settings['chroot_path'] + '/' + myi): + os.rename(self.settings['chroot_path'] + '/' + myi, self.settings['chroot_path'] + '/' + myi + '.catalyst') + + shutil.copy(myi, + self.settings['chroot_path'] + '/' + myi) # Copy over the envscript, if applicable if "envscript" in self.settings: @@ -1242,12 +1249,19 @@ class StageBase(TargetBase, ClearBase, GenBase): if os.path.exists(hosts_file + '.catalyst'): os.rename(hosts_file + '.catalyst', hosts_file) - # optionally clean up binary interpreter + # optionally clean up binary interpreter(s) if "interpreter" in self.settings: - if os.path.exists(self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst'): - os.rename(self.settings['chroot_path'] + '/' + self.settings['interpreter'] + '.catalyst', self.settings['chroot_path'] + '/' + self.settings['interpreter']) + + if isinstance(self.settings["interpreter"], str): + myints = [self.settings["interpreter"]] else: - os.remove(self.settings['chroot_path'] + '/' + self.settings['interpreter']) + myints = self.settings["interpreter"] + + for myi in myints: + if os.path.exists(self.settings['chroot_path'] + '/' + myi + '.catalyst'): + os.rename(self.settings['chroot_path'] + '/' + myi + '.catalyst', self.settings['chroot_path'] + '/' + myi) + else: + os.remove(self.settings['chroot_path'] + '/' + myi) # optionally clean up portage configs if ("portage_prefix" in self.settings and