commit: 51dd930ec597ac438ef9fc3c4e7dc80ecd738903 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Wed Apr 13 03:58:41 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Apr 13 04:02:40 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=51dd930e
bin/*.sh: cosmetic cleanups to comments, whitespace Signed-off-by: Sam James <sam <AT> gentoo.org> Closes: https://github.com/gentoo/portage/pull/814 Signed-off-by: Sam James <sam <AT> gentoo.org> bin/ebuild.sh | 33 +++++++++++++++++---------------- bin/isolated-functions.sh | 4 ++-- bin/misc-functions.sh | 10 +++++----- bin/phase-helpers.sh | 14 +++++++------- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 628d7eb80..811f1f8a2 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -96,7 +96,7 @@ unset BASH_ENV # earlier portage versions do not detect a version change in this case # (9999 to 9999) and therefore they try execute an incompatible version of # ebuild.sh during the upgrade. -export PORTAGE_BZIP2_COMMAND=${PORTAGE_BZIP2_COMMAND:-bzip2} +export PORTAGE_BZIP2_COMMAND=${PORTAGE_BZIP2_COMMAND:-bzip2} # These two functions wrap sourcing and calling respectively. At present they # perform a qa check to make sure eclasses and ebuilds and profiles don't mess @@ -144,7 +144,7 @@ fi [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET -# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex) +# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (e.g. /usr/lib64/conftest) __sb_append_var() { local _v=$1 ; shift local var="SANDBOX_${_v}" @@ -175,7 +175,7 @@ elif [[ $SANDBOX_ON = 1 ]] ; then unset x fi -# the sandbox is disabled by default except when overridden in the relevant stages +# The sandbox is disabled by default except when overridden in the relevant stages export SANDBOX_ON=0 # Ensure that $PWD is sane whenever possible, to protect against @@ -189,8 +189,8 @@ else die "PORTAGE_PYM_PATH does not exist: '${PORTAGE_PYM_PATH}'" fi -#if no perms are specified, dirs/files will have decent defaults -#(not secretive, but not stupid) +# If no perms are specified, dirs/files will have decent defaults +# (not secretive, but not stupid) umask 022 # Sources all eclasses in parameters @@ -258,12 +258,12 @@ inherit() { debug-print "inherit: $1 -> $location" [[ -z ${location} ]] && die "${1}.eclass could not be found by inherit()" - # inherits in QA checks can't handle metadata assignments + # Inherits in QA checks can't handle metadata assignments if [[ -z ${_IN_INSTALL_QA_CHECK} ]]; then - #We need to back up the values of *DEPEND to B_*DEPEND - #(if set).. and then restore them after the inherit call. + # We need to back up the values of *DEPEND to B_*DEPEND + # (if set).. and then restore them after the inherit call. - #turn off glob expansion + # Turn off glob expansion set -f # Retain the old data and restore it later. @@ -291,9 +291,9 @@ inherit() { fi __qa_source "$location" || die "died sourcing $location in inherit()" - + if [[ -z ${_IN_INSTALL_QA_CHECK} ]]; then - #turn off glob expansion + # Turn off glob expansion set -f # If each var has a value, append it to the global variable E_* to @@ -308,7 +308,7 @@ inherit() { [ "${B_IUSE+set}" = set ] && IUSE="${B_IUSE}" [ "${B_IUSE+set}" = set ] || unset IUSE - + [ "${B_REQUIRED_USE+set}" = set ] && REQUIRED_USE="${B_REQUIRED_USE}" [ "${B_REQUIRED_USE+set}" = set ] || unset REQUIRED_USE @@ -344,7 +344,7 @@ inherit() { unset RESTRICT fi - #turn on glob expansion + # Turn on glob expansion set +f if [[ -n ${!__export_funcs_var} ]] ; then @@ -472,7 +472,7 @@ __try_source() { export SANDBOX_ON="1" export S=${WORKDIR}/${P} -# Turn of extended glob matching so that g++ doesn't get incorrectly matched. +# Turn off extended glob matching so that g++ doesn't get incorrectly matched. shopt -u extglob if [[ ${EBUILD_PHASE} == depend ]] ; then @@ -484,7 +484,8 @@ elif [[ ${EBUILD_PHASE} == clean* ]] ; then else QA_INTERCEPTORS="autoconf automake aclocal libtoolize" fi -# level the QA interceptors if we're in depend + +# Level the QA interceptors if we're in depend if [[ -n ${QA_INTERCEPTORS} ]] ; then for BIN in ${QA_INTERCEPTORS}; do BIN_PATH=$(type -Pf ${BIN}) @@ -627,7 +628,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then debug-print "RDEPEND: not set... Setting to: ${DEPEND}" fi - # add in dependency info from eclasses + # Add in dependency info from eclasses IUSE+="${IUSE:+ }${E_IUSE}" DEPEND+="${DEPEND:+ }${E_DEPEND}" RDEPEND+="${RDEPEND:+ }${E_RDEPEND}" diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 539fea952..41ca106a4 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -624,8 +624,8 @@ fi # emerge output. # You can override the setting by exporting a new one from the console, or you can # set a new default in make.*. Here the default is "" or unset. - -# in the future might use e* from /etc/init.d/functions.sh if i feel like it +# +# (TODO: in the future, might use e* from /lib/gentoo/functions.sh?) debug-print() { # if $T isn't defined, we're in dep calculation mode and # shouldn't do anything diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 0e1791937..de7ebf4a2 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -21,7 +21,7 @@ install_symlink_html_docs() { local ED=${D} fi cd "${ED}" || die "cd failed" - #symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf) + # Symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf) if [ -n "${DOC_SYMLINKS_DIR}" ] ; then local mydocdir docdir for docdir in "${HTMLDOC_DIR:-does/not/exist}" "${PF}/html" "${PF}/HTML" "${P}/html" "${P}/HTML" ; do @@ -433,7 +433,7 @@ preinst_suid_scan() { local ED=${D} fi - # total suid control. + # Total suid control if has suidctl $FEATURES; then local i sfconf x sfconf=${PORTAGE_CONFIGROOT}etc/portage/suidctl.conf @@ -487,8 +487,8 @@ preinst_selinux_labels() { /usr/sbin/setfiles -F -r "${D}" "${file_contexts_path}" "${D}" ) || die "Failed to set SELinux security labels." else - # nonfatal, since merging can happen outside a SE kernel - # like during a recovery situation + # nonfatal, since merging can happen outside a SELinux kernel + # (like during a recovery situation) __vecho "!!! Unable to set SELinux security labels" fi fi @@ -538,7 +538,7 @@ __dyn_package() { [[ -n "${md5_hash}" ]] && \ echo ${md5_hash} > "${PORTAGE_BUILDDIR}"/build-info/BINPKGMD5 __vecho ">>> Done." - + elif [[ "${BINPKG_FORMAT}" == "gpkg" ]]; then PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \ "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH"/gpkg-helper.py compress \ diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 0a3bc5cb7..cbe0b825d 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -223,7 +223,7 @@ use() { local u=$1 local found=0 - # if we got something like '!flag', then invert the return value + # If we got something like '!flag', then invert the return value if [[ ${u:0:1} == "!" ]] ; then u=${u:1} found=1 @@ -602,7 +602,7 @@ econf() { -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \ "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" \ || die "Substition of shebang in '${ECONF_SOURCE}/configure' failed" - # preserve timestamp, see bug #440304 + # Preserve timestamp, see bug #440304 touch -r "${ECONF_SOURCE}/configure" "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" || die mv -f "${ECONF_SOURCE}/configure._portage_tmp_.${pid}" "${ECONF_SOURCE}/configure" || die fi @@ -663,8 +663,8 @@ econf() { fi fi - # if the profile defines a location to install libs to aside from default, pass it on. - # if the ebuild passes in --libdir, they're responsible for the conf_libdir fun. + # If the profile defines a location to install libs to aside from default, pass it on. + # If the ebuild passes in --libdir, they're responsible for the conf_libdir fun. local CONF_LIBDIR LIBDIR_VAR="LIBDIR_${ABI}" if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then CONF_LIBDIR=${!LIBDIR_VAR} @@ -906,7 +906,7 @@ ___best_version_and_has_version_common() { fi if ___eapi_has_prefix_variables; then # Since portageq requires the root argument be consistent - # with EPREFIX, ensure consistency here (bug 655414). + # with EPREFIX, ensure consistency here (bug #655414). root=/${PORTAGE_OVERRIDE_EPREFIX#/} cmd+=(env EPREFIX="${PORTAGE_OVERRIDE_EPREFIX}") else @@ -1040,7 +1040,7 @@ if ___eapi_has_eapply; then -p1 -f -g0 --no-backup-if-mismatch "${patch_options[@]}" ) - # try applying with -F0 first, output a verbose warning + # Try applying with -F0 first, output a verbose warning # if fuzz factor is necessary if ${patch_cmd} "${all_opts[@]}" --dry-run -s -F0 \ < "${f}" &>/dev/null; then @@ -1132,7 +1132,7 @@ if ___eapi_has_eapply_user; then eapply_user() { [[ ${EBUILD_PHASE} == prepare ]] || \ die "eapply_user() called during invalid phase: ${EBUILD_PHASE}" - # keep path in __dyn_prepare in sync! + # Keep path in __dyn_prepare in sync! local tagfile=${T}/.portage_user_patches_applied [[ -f ${tagfile} ]] && return >> "${tagfile}"
