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 248971382C5 for ; Sat, 16 May 2020 06:53:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 42306E08C8; Sat, 16 May 2020 06:53:26 +0000 (UTC) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) (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 2DBBFE08C8 for ; Sat, 16 May 2020 06:53:25 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id hi11so1954984pjb.3 for ; Fri, 15 May 2020 23:53:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x3rtoNOQJWL0XGtcCZqXs+VbadafzLctJ/mPlyY9yOY=; b=s2bsuRzv5gesxFRvBPSM/kUw3zBylo+NmRP9IUUQSAQK5JsYkjn7AwAI+HREqO7Ibo aSuvIOJ0hI1KBr4HljHgw1OKzxatj9GylI8F/ZtF47e5i0KF1UCVQa7RI8bf4YzKS0dk RXF/r3RFUif3FvzYfYi/sqKeeqfjv08WpHaTWxM0098HB6pLrUioMV16Rm0u+KylhFFY uxZCXW6AM9V2nCha1e1LcXBilg2vqAv6MaltrJpPxlDQ8NRLL1GpaG8QPLC6zMZKwGYX aSQyfawBJIXOMkrW5E9L605f+uO8hMelR6nymdQA/tZZ72t1Prj/AYxbc+RPk5sJAu4B AZHA== X-Gm-Message-State: AOAM5328DW/y48SZvHMYf8clxqLVgbonu83p7xlksF1SYfx0kkPvSGkp 8inbxBO+cdVCvDg/L6aZD95UJ3NI X-Google-Smtp-Source: ABdhPJyLZkbi96w/BoccTvumo4sfWFxEnXjZEpBxNRKKkggd3WzvWJ+Xi9VahoyPDMbLTniHwhqpaA== X-Received: by 2002:a17:902:a586:: with SMTP id az6mr6910757plb.201.1589612004561; Fri, 15 May 2020 23:53:24 -0700 (PDT) Received: from localhost ([108.161.26.224]) by smtp.gmail.com with ESMTPSA id p9sm3168586pgb.19.2020.05.15.23.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 23:53:23 -0700 (PDT) From: Matt Turner To: gentoo-catalyst@lists.gentoo.org Cc: Matt Turner Subject: [gentoo-catalyst] [PATCH 1/9] targets: Remove clst_my* prefix Date: Fri, 15 May 2020 23:53:09 -0700 Message-Id: <20200516065317.2678080-1-mattst88@gentoo.org> X-Mailer: git-send-email 2.26.2 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-Transfer-Encoding: 8bit X-Archives-Salt: 3e9bc81f-86f3-49b0-a0bf-60638ba4e69e X-Archives-Hash: d78c8562d487ce9acdf686341271ca20 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 --- 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 ] -- 2.26.2