Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 16 May 2022 23:29:51
Message-Id: 1652743769.949f1967cfbe394838ddaa39678b908f3e50bccf.sam@gentoo
1 commit: 949f1967cfbe394838ddaa39678b908f3e50bccf
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 15 13:19:55 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon May 16 23:29:29 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=949f1967
7
8 user.eclass: Avoid reserved function name
9
10 Names that contain "ebuild" are reserved for package manager use.
11
12 Closes: https://bugs.gentoo.org/843707
13 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 eclass/user.eclass | 16 ++++++++--------
17 1 file changed, 8 insertions(+), 8 deletions(-)
18
19 diff --git a/eclass/user.eclass b/eclass/user.eclass
20 index aab549d0c473..906e84e83c69 100644
21 --- a/eclass/user.eclass
22 +++ b/eclass/user.eclass
23 @@ -31,12 +31,12 @@ _USER_ECLASS=1
24
25 inherit user-info
26
27 -# @FUNCTION: _assert_pkg_ebuild_phase
28 +# @FUNCTION: _user_assert_pkg_phase
29 # @INTERNAL
30 # @USAGE: <calling func name>
31 # @DESCRIPTION:
32 # Raises an alert if the phase is not suitable for user.eclass usage.
33 -_assert_pkg_ebuild_phase() {
34 +_user_assert_pkg_phase() {
35 case ${EBUILD_PHASE} in
36 setup|preinst|postinst|prerm|postrm) ;;
37 *)
38 @@ -89,7 +89,7 @@ enewuser() {
39 ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
40 return 0
41 fi
42 - _assert_pkg_ebuild_phase ${FUNCNAME}
43 + _user_assert_pkg_phase ${FUNCNAME}
44
45 local create_home=1 force_uid=
46 while [[ ${1} == -* ]]; do
47 @@ -262,7 +262,7 @@ enewgroup() {
48 ewarn "Insufficient privileges to execute ${FUNCNAME[0]}"
49 return 0
50 fi
51 - _assert_pkg_ebuild_phase ${FUNCNAME}
52 + _user_assert_pkg_phase ${FUNCNAME}
53
54 local force_gid=
55 while [[ ${1} == -* ]]; do
56 @@ -365,7 +365,7 @@ enewgroup() {
57 # If the new home directory does not exist, it is created.
58 # Any previously existing home directory is NOT moved.
59 esethome() {
60 - _assert_pkg_ebuild_phase ${FUNCNAME}
61 + _user_assert_pkg_phase ${FUNCNAME}
62
63 # get the username
64 local euser=${1}; shift
65 @@ -451,7 +451,7 @@ esethome() {
66 # Required parameters is the username and the new shell.
67 # Specify -1 if you want to set shell to platform-specific nologin.
68 esetshell() {
69 - _assert_pkg_ebuild_phase ${FUNCNAME}
70 + _user_assert_pkg_phase ${FUNCNAME}
71
72 # get the username
73 local euser=${1}; shift
74 @@ -528,7 +528,7 @@ esetshell() {
75 # Update the comment field in a platform-agnostic way.
76 # Required parameters is the username and the new comment.
77 esetcomment() {
78 - _assert_pkg_ebuild_phase ${FUNCNAME}
79 + _user_assert_pkg_phase ${FUNCNAME}
80
81 # get the username
82 local euser=${1}; shift
83 @@ -602,7 +602,7 @@ esetcomment() {
84 # Required parameters is the username and the new list of groups,
85 # primary group first.
86 esetgroups() {
87 - _assert_pkg_ebuild_phase ${FUNCNAME}
88 + _user_assert_pkg_phase ${FUNCNAME}
89
90 [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <user> <groups>"