From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5E78A13829C for ; Sun, 5 Jun 2016 20:00:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5FA57254024; Sun, 5 Jun 2016 20:00:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CDF7C254024 for ; Sun, 5 Jun 2016 20:00:38 +0000 (UTC) Received: by smtp.gentoo.org (Postfix, from userid 2127) id 5DEE5340AA1; Sun, 5 Jun 2016 20:00:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 5B005340940 for ; Sun, 5 Jun 2016 20:00:37 +0000 (UTC) Date: Sun, 5 Jun 2016 20:00:37 +0000 (UTC) From: "Jorge Manuel B. S. Vicetto" To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH] Fix USE not "sticking" between stage runs and allow set USE flags just for building - CATALYST_USE. This should fix bug 473332 and avoid the current issue of catalyst-3 stages being built with (fwd) Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Archives-Salt: 3efe1c0f-e77d-407c-9715-a796c516bf02 X-Archives-Hash: 1c0c44385edec1578f380b1796cbcca4 Hi. Apologies but I "mixed" my mailing lists when I sent this message earlier today. Regards, Jorge Manuel B. S. Vicetto Gentoo Developer ---------- Forwarded message ---------- Date: Sun, 5 Jun 2016 11:29:13 +0000 From: "Jorge Manuel B. S. Vicetto (jmbsvicetto)" To: gentoo-releng@lists.gentoo.org, releng@gentoo.org Cc: "Jorge Manuel B. S. Vicetto (jmbsvicetto)" Subject: [PATCH] Fix USE not "sticking" between stage runs and allow set USE flags just for building - CATALYST_USE. This should fix bug 473332 and avoid the current issue of catalyst-3 stages being built without BINDIST. These changes don't allow setting USE flags for stage 1, 2 and 3 and don't touch other stages (TODO). Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) --- catalyst/base/stagebase.py | 13 ++++++++++++- catalyst/targets/grp.py | 7 ------- catalyst/targets/livecd_stage1.py | 14 +++++--------- targets/stage1/stage1-chroot.sh | 9 +++++++-- targets/stage2/stage2-chroot.sh | 19 ++++++------------- targets/stage3/stage3-chroot.sh | 10 ++++++++++ 6 files changed, 40 insertions(+), 32 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 6695ac4..de0fce4 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -173,6 +173,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.set_controller_file() self.set_default_action_sequence() self.set_use() + self.set_catalyst_use() self.set_cleanables() self.set_iso_volume_id() self.set_build_kernel_vars() @@ -547,9 +548,19 @@ class StageBase(TargetBase, ClearBase, GenBase): if isinstance(self.settings['use'], str): self.settings["use"]=self.settings["use"].split() + def set_catalyst_use(self): + if self.settings["spec_prefix"]+"/catalyst_use" in self.settings: + self.settings["catalyst_use"]=\ + self.settings[self.settings["spec_prefix"]+"/catalyst_use"] + del self.settings[self.settings["spec_prefix"]+"/catalyst_use"] + if "catalyst_use" not in self.settings: + self.settings["catalyst_use"]="" + if isinstance(self.settings['catalyst_use'], str): + self.settings["catalyst_use"]=self.settings["catalyst_use"].split() + # Force bindist when options ask for it if "BINDIST" in self.settings: - self.settings["use"].append("bindist") + self.settings["catalyst_use"].append("bindist") def set_stage_path(self): self.settings["stage_path"]=normpath(self.settings["chroot_path"]) diff --git a/catalyst/targets/grp.py b/catalyst/targets/grp.py index 049bc55..d47654d 100644 --- a/catalyst/targets/grp.py +++ b/catalyst/targets/grp.py @@ -52,13 +52,6 @@ class grp(StageBase): raise CatalystError("GRP build aborting due to error.", print_traceback=True) - def set_use(self): - StageBase.set_use(self) - if "use" in self.settings: - self.settings["use"].append("bindist") - else: - self.settings["use"]=["bindist"] - def set_mounts(self): self.mounts.append("/tmp/grp") self.mountmap["/tmp/grp"]=self.settings["target_path"] diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py index eea4312..659eb43 100644 --- a/catalyst/targets/livecd_stage1.py +++ b/catalyst/targets/livecd_stage1.py @@ -29,16 +29,12 @@ class livecd_stage1(StageBase): def set_spec_prefix(self): self.settings["spec_prefix"]="livecd" - def set_use(self): - StageBase.set_use(self) - if "use" in self.settings: - self.settings["use"].append("livecd") - if "BINDIST" in self.settings: - self.settings["use"].append("bindist") + def set_catalyst_use(self): + StageBase.set_catalyst_use(self) + if "catalyst_use" in self.settings: + self.settings["catalyst_use"].append("livecd") else: - self.settings["use"]=["livecd"] - if "BINDIST" in self.settings: - self.settings["use"].append("bindist") + self.settings["catalyst_use"]=["livecd"] def set_packages(self): StageBase.set_packages(self) diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh index fbda84b..291614b 100755 --- a/targets/stage1/stage1-chroot.sh +++ b/targets/stage1/stage1-chroot.sh @@ -53,7 +53,8 @@ sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf} # Now, we install our packages if [ -e ${clst_make_conf} ]; then - echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf} + echo "CATALYST_USE=\"-* build ${clst_CATALYST_USE}\"" >> ${clst_make_conf} + echo "USE=\"${CATALYST_USE} ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf} for useexpand in ${clst_HOSTUSEEXPAND}; do x="clst_${useexpand}" echo "${useexpand}=\"${!x}\"" \ @@ -62,8 +63,12 @@ if [ -e ${clst_make_conf} ]; then fi run_merge "--oneshot ${clst_buildpkgs}" -sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \ +sed -i "/USE=\"/s/\${CATALYST_USE} //" \ ${clst_make_conf} +sed -i "/CATALYST_USE/d" \ + ${clist_make_conf} + +# Why are we removing these? Don't we need them for final make.conf? for useexpand in ${clst_HOSTUSEEXPAND}; do x="clst_${useexpand}" sed -i "/${useexpand}=\"${!x}\"/d" \ diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh index 38dfea3..1667ffd 100755 --- a/targets/stage2/stage2-chroot.sh +++ b/targets/stage2/stage2-chroot.sh @@ -5,21 +5,14 @@ source /tmp/chroot-functions.sh # Setup the environment export FEATURES="${clst_myfeatures} nodoc noman noinfo -news" -# Set bindist USE flag if clst_BINDIST is set -# The bindist functions have been taken from support/chroot-functions.sh -if [ -e "${clst_make_conf}" ] && [ -n "${clst_BINDIST}" ]; then - if grep -q ^USE "${clst_make_conf}"; then - echo "USE=\"\${USE} bindist\"" >> "${clst_make_conf}" - else - echo "USE=\"bindist\"" >> "${clst_make_conf}" - fi -fi - - +echo "CATALYST_USE=\"${clst_CATALYST_USE}\"" >> ${clst_make_conf} +sed -i -e "/USE=\"/s/\${CATALYST_USE} " ${clst_make_conf} ## START BUILD ${clst_repo_basedir}/${clst_repo_name}/scripts/bootstrap.sh ${bootstrap_opts} || exit 1 # Clean-up USE again -sed -i "/USE=\"\${USE} bindist\"/d" "${clst_make_conf}" -sed -i "/USE=\"bindist\"/d" "${clst_make_conf}" +sed -i "/USE=\"/s/\${CATALYST_USE} //" \ + ${clst_make_conf} +sed -i "/CATALYST_USE/d" \ + ${clist_make_conf} diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh index 6cf9106..d010d5e 100755 --- a/targets/stage3/stage3-chroot.sh +++ b/targets/stage3/stage3-chroot.sh @@ -2,7 +2,17 @@ source /tmp/chroot-functions.sh +echo "CATALYST_USE=\"${clst_CATALYST_USE}\"" >> ${clst_make_conf} +sed -i -e "/USE=\"/s/\${CATALYST_USE} " ${clst_make_conf} + ## START BUILD setup_pkgmgr run_merge "-e @system" + +# Clean-up USE again +sed -i "/USE=\"/s/\${CATALYST_USE} //" \ + ${clst_make_conf} +sed -i "/CATALYST_USE/d" \ + ${clist_make_conf} + -- 2.8.2