commit:     35f28ac4b092dac66588081d97c1f64404be2f87
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Jun 17 02:39:17 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 17 03:00:44 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=35f28ac4

emerge-webrsync: import gentoo-functions.sh after isolated-functions.sh

Source "gentoo-functions.sh" after sourcing "isolated-functions.sh".
Otherwise, the implementations of various functions by the latter
library - including einfo(), ewarn() and error() - shall prevail.

Furthermore, since these functions are implemented by both libraries,
jettison their namesakes from the emerge-webrsync utility.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/emerge-webrsync | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index f49763ba36..76d98a9c20 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -621,24 +621,6 @@ do_latest_snapshot() {
        done
 }
 
-# Opportunistically use gentoo-functions for nicer output
-functions_script="${EPREFIX}/lib/gentoo/functions.sh"
-source "${functions_script}" || {
-       echo "$0: Could not source ${functions_script}!" 1>&2
-
-       einfo() {
-               echo "${0##*/}: $*"
-       }
-
-       ewarn() {
-               echo "${0##*/}: warning: $*" 1>&2
-       }
-
-       eerror() {
-               echo "${0##*/}: error: $*" 1>&2
-       }
-}
-
 # Only echo if in normal mode
 vvecho() { (( opt[quiet] )) || echo "$@"; }
 # Only echo if in quiet mode
@@ -668,6 +650,13 @@ export http_proxy https_proxy ftp_proxy
 
 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
 
+# Opportunistically use gentoo-functions for its implementations of einfo(),
+# ewarn() and eerror(). As of late, these are better maintained.
+functions_script="${EPREFIX}/lib/gentoo/functions.sh"
+if [[ -f ${functions_script} ]]; then
+       source "${functions_script}" || exit
+fi
+
 repo_name=gentoo
 repo_location=$(__repo_attr "${repo_name}" location)
 if [[ -z ${repo_location} ]]; then

Reply via email to