Using portage to bootstrap gentoo install can lead to the following
warning when ROOT is empty:
>> Running pre-merge checks for acct-group/root-0
grep: /tmp/0xff.z2MjAjJXuo/root/etc/group: No such file or directory
grep: /tmp/0xff.z2MjAjJXuo/root/etc/group: No such file or directory
This change prevent egetent() from attempting to lookup key if database
does not exit, removing error from output.
Signed-off-by: Bertrand Jacquin <
[email protected]>
---
eclass/user-info.eclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/eclass/user-info.eclass b/eclass/user-info.eclass
index b18f280c1022..79d33d6881ae 100644
--- a/eclass/user-info.eclass
+++ b/eclass/user-info.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: user-info.eclass
@@ -34,6 +34,9 @@ egetent() {
*) die "sorry, database '${db}' not yet supported; file a bug" ;;
esac
+ # return immediately if db does not exist
+ [[ ! -e "${EROOT}/etc/${db}" ]] && return 1
+
case ${CHOST} in
*-freebsd*|*-dragonfly*)
case ${db} in
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)