From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] [PATCH 1/9] targets: Remove clst_my* prefix
Date: Sat, 16 May 2020 12:01:07 -0700 [thread overview]
Message-ID: <20200516120107.47bbf15c@storm> (raw)
In-Reply-To: <20200516065317.2678080-1-mattst88@gentoo.org>
On Fri, 15 May 2020 23:53:09 -0700
Matt Turner <mattst88@gentoo.org> 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 <mattst88@gentoo.org>
> ---
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 ]
prev parent reply other threads:[~2020-05-16 19:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-16 6:53 [gentoo-catalyst] [PATCH 1/9] targets: Remove clst_my* prefix Matt Turner
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 2/9] targets: Make features variable local Matt Turner
2020-05-16 19:10 ` Brian Dolbec
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 3/9] targets: Use arrays rather than string concatenation Matt Turner
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 4/9] targets: Drop duplicate FEATURES=-news Matt Turner
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 5/9] targets: Don't unnecessarily override emerge_opts Matt Turner
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 6/9] targets: Remove || exit 1 from run_merge invocations Matt Turner
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 7/9] targets: Decouple distfile fetching from binary packages Matt Turner
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 8/9] catalyst: Remove remnants of options="preserve_libs" Matt Turner
2020-05-16 19:16 ` Brian Dolbec
2020-05-16 6:53 ` [gentoo-catalyst] [PATCH 9/9] catalyst: Remove fbsplash support Matt Turner
2020-05-16 19:20 ` Brian Dolbec
2020-05-16 19:01 ` Brian Dolbec [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200516120107.47bbf15c@storm \
--to=dolsen@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox