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 6BD621382C5 for ; Sat, 16 May 2020 19:01:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 918D0E0A96; Sat, 16 May 2020 19:01:13 +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 25C17E0A96 for ; Sat, 16 May 2020 19:01:12 +0000 (UTC) Date: Sat, 16 May 2020 12:01:07 -0700 From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Subject: Re: [gentoo-catalyst] [PATCH 1/9] targets: Remove clst_my* prefix Message-ID: <20200516120107.47bbf15c@storm> In-Reply-To: <20200516065317.2678080-1-mattst88@gentoo.org> References: <20200516065317.2678080-1-mattst88@gentoo.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) 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 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 9c8f77b4-12df-42f5-8ee3-940bbe4ca465 X-Archives-Hash: d4737d169f6fdfe06eddb62159f6b7e7 On Fri, 15 May 2020 23:53:09 -0700 Matt Turner wrote: > clst_* prefixed variables are created by setup_environment(), which > these variables are not. Also, prefixing variable names with 'my' is > an anti-pattern. > > Rename the functions that create these variables at the same time. > > Signed-off-by: Matt Turner > --- Hmmmmm, I added the clst_ prefix to try and get a handle on the variables exported by the python as part of the cleanup. So, I can only surmize that myfeatures was originally exported by the python code at one point. If that is the case this one is no longer exported, then go for it... I also don't like the my prefix tagged variables. > targets/netboot/pkg.sh | 2 +- > targets/stage1/chroot.sh | 4 ++-- > targets/stage2/chroot.sh | 2 +- > targets/support/chroot-functions.sh | 34 > ++++++++++++++--------------- targets/support/kmerge.sh | > 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) > > diff --git a/targets/netboot/pkg.sh b/targets/netboot/pkg.sh > index 29da7134..2ec27062 100755 > --- a/targets/netboot/pkg.sh > +++ b/targets/netboot/pkg.sh > @@ -4,7 +4,7 @@ source /tmp/chroot-functions.sh > > update_env_settings > > -setup_myfeatures > +setup_features > > show_debug > > diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh > index 9c7ef6ca..a42afd19 100755 > --- a/targets/stage1/chroot.sh > +++ b/targets/stage1/chroot.sh > @@ -9,7 +9,7 @@ export clst_buildpkgs="$(/tmp/build.py)" > [ -n "${clst_BINDIST}" ] && BINDIST="bindist" > BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)" > > -FEATURES="${clst_myfeatures} nodoc noman noinfo -news" > +FEATURES="${features} nodoc noman noinfo -news" > > ## Sanity check profile > if [ -z "${clst_buildpkgs}" ] > @@ -39,7 +39,7 @@ if [ -n "${clst_update_seed}" ]; then > fi > > # reset emerge options for the target > - clst_update_seed=no setup_myemergeopts > + clst_update_seed=no setup_emerge_opts > else > echo "Skipping seed stage update..." > fi > diff --git a/targets/stage2/chroot.sh b/targets/stage2/chroot.sh > index bf98d328..e472fe16 100755 > --- a/targets/stage2/chroot.sh > +++ b/targets/stage2/chroot.sh > @@ -3,7 +3,7 @@ > source /tmp/chroot-functions.sh > > # Setup the environment > -export FEATURES="${clst_myfeatures} nodoc noman noinfo -news" > +export FEATURES="${features} nodoc noman noinfo -news" > export CONFIG_PROTECT="-* /etc/locale.gen" > > echo "$locales" > /etc/locale.gen > diff --git a/targets/support/chroot-functions.sh > b/targets/support/chroot-functions.sh index 993dc209..2eb90117 100755 > --- a/targets/support/chroot-functions.sh > +++ b/targets/support/chroot-functions.sh > @@ -76,19 +76,19 @@ get_libdir() { > echo ${var} > } > > -setup_myfeatures(){ > - setup_myemergeopts > - export clst_myfeatures="-news binpkg-multi-instance > clean-logs parallel-install" > - export FEATURES="${clst_myfeatures}" > +setup_features() { > + setup_emerge_opts > + export features="-news binpkg-multi-instance clean-logs > parallel-install" > + export FEATURES="${features}" > if [ -n "${clst_CCACHE}" ] > then > - export clst_myfeatures="${clst_myfeatures} ccache" > + export features="${features} ccache" > clst_root_path=/ run_merge --oneshot --noreplace > dev-util/ccache || exit 1 fi > > if [ -n "${clst_DISTCC}" ] > then > - export clst_myfeatures="${clst_myfeatures} distcc" > + export features="${features} distcc" > export DISTCC_HOSTS="${clst_distcc_hosts}" > [ -e ${clst_make_conf} ] && \ > echo 'USE="${USE} -avahi -gtk -gnome"' >> > ${clst_make_conf} @@ -133,26 +133,26 @@ setup_myfeatures(){ > export PATH="/usr/lib/icecc/bin:${PATH}" > export PREROOTPATH="/usr/lib/icecc/bin" > fi > - export FEATURES="${clst_myfeatures}" > + export FEATURES="${features}" > } > > -setup_myemergeopts(){ > +setup_emerge_opts() { > if [[ "${clst_VERBOSE}" == "true" ]] > then > - clst_myemergeopts="--verbose" > + emerge_opts="--verbose" > bootstrap_opts="${bootstrap_opts} -v" > else > - clst_myemergeopts="--quiet" > + emerge_opts="--quiet" > bootstrap_opts="${bootstrap_opts} -q" > fi > if [ -n "${clst_FETCH}" ] > then > export bootstrap_opts="${bootstrap_opts} -f" > - export clst_myemergeopts="${clst_myemergeopts} -f" > + export emerge_opts="${emerge_opts} -f" > # if we have PKGCACHE, and either update_seed is empty or > 'no', make and use binpkgs elif [ -n "${clst_PKGCACHE}" ] && [ -z > "${clst_update_seed}" -o "${clst_update_seed}" = "no" ] then > - export clst_myemergeopts="${clst_myemergeopts} > --usepkg --buildpkg --binpkg-respect-use=y --newuse" > + export emerge_opts="${emerge_opts} --usepkg > --buildpkg --binpkg-respect-use=y --newuse" export > bootstrap_opts="${bootstrap_opts} -r" fi > } > @@ -274,13 +274,13 @@ run_merge() { > > if [[ "${clst_VERBOSE}" == "true" ]] > then > - echo "ROOT=${ROOT} emerge ${clst_myemergeopts} -pt > $@" || exit 1 > - emerge ${clst_myemergeopts} -pt $@ || exit 3 > + echo "ROOT=${ROOT} emerge ${emerge_opts} -pt $@" || > exit 1 > + emerge ${emerge_opts} -pt $@ || exit 3 > fi > > - echo "emerge ${clst_myemergeopts} $@" || exit 1 > + echo "emerge ${emerge_opts} $@" || exit 1 > > - emerge ${clst_myemergeopts} $@ || exit 1 > + emerge ${emerge_opts} $@ || exit 1 > } > > show_debug() { > @@ -323,7 +323,7 @@ run_default_funcs() { > if [ "${RUN_DEFAULT_FUNCS}" != "no" ] > then > update_env_settings > - setup_myfeatures > + setup_features > show_debug > fi > } > diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh > index 7a00059a..8a15fc04 100755 > --- a/targets/support/kmerge.sh > +++ b/targets/support/kmerge.sh > @@ -212,7 +212,7 @@ then > > # install dependencies of kernel sources ahead of time in > case # package.provided generated below causes them not to be > (re)installed > - PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --usepkg > --buildpkg --binpkg-respect-use=y --update --newuse --onlydeps" > run_merge "${clst_ksource}" || exit 1 > + PKGDIR=${PKGDIR} emerge_opts="--quiet --usepkg --buildpkg > --binpkg-respect-use=y --update --newuse --onlydeps" run_merge > "${clst_ksource}" || exit 1 # Create the kerncache directory if it > doesn't exists mkdir -p /tmp/kerncache/${clst_kname} > @@ -236,7 +236,7 @@ then > > [ -L /usr/src/linux ] && rm -f /usr/src/linux > > - PKGDIR=${PKGDIR} clst_myemergeopts="--quiet --update > --newuse" run_merge "${clst_ksource}" || exit 1 > + PKGDIR=${PKGDIR} emerge_opts="--quiet --update --newuse" > run_merge "${clst_ksource}" || exit 1 > SOURCESDIR="/tmp/kerncache/${clst_kname}/sources" > if [ -L /usr/src/linux ]