1 |
As this doesn't depend on architecture, why /lib and not /share? |
2 |
|
3 |
сб, 29 авг. 2020 г. в 20:53, Michał Górny <mgorny@g.o>: |
4 |
> |
5 |
> Thanks to David Michael for the initial patch and upstream fixes. |
6 |
> |
7 |
> Signed-off-by: Michał Górny <mgorny@g.o> |
8 |
> --- |
9 |
> eclass/acct-group.eclass | 16 +++++++++++++++- |
10 |
> eclass/acct-user.eclass | 16 +++++++++++++++- |
11 |
> 2 files changed, 30 insertions(+), 2 deletions(-) |
12 |
> |
13 |
> diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass |
14 |
> index 5550e4a2fb10..dc1562974870 100644 |
15 |
> --- a/eclass/acct-group.eclass |
16 |
> +++ b/eclass/acct-group.eclass |
17 |
> @@ -80,7 +80,7 @@ S=${WORKDIR} |
18 |
> |
19 |
> |
20 |
> # << Phase functions >> |
21 |
> -EXPORT_FUNCTIONS pkg_pretend pkg_preinst |
22 |
> +EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst |
23 |
> |
24 |
> # @FUNCTION: acct-group_pkg_pretend |
25 |
> # @DESCRIPTION: |
26 |
> @@ -116,6 +116,20 @@ acct-group_pkg_pretend() { |
27 |
> fi |
28 |
> } |
29 |
> |
30 |
> +# @FUNCTION: acct-group_src_install |
31 |
> +# @DESCRIPTION: |
32 |
> +# Installs sysusers.d file for the group. |
33 |
> +acct-group_src_install() { |
34 |
> + debug-print-function ${FUNCNAME} "${@}" |
35 |
> + |
36 |
> + insinto /usr/lib/sysusers.d |
37 |
> + newins - ${CATEGORY}-${ACCT_GROUP_NAME}.conf < <( |
38 |
> + printf "g\t%q\t%q\n" \ |
39 |
> + "${ACCT_GROUP_NAME}" \ |
40 |
> + "${ACCT_GROUP_ID/#-*/-}" |
41 |
> + ) |
42 |
> +} |
43 |
> + |
44 |
> # @FUNCTION: acct-group_pkg_preinst |
45 |
> # @DESCRIPTION: |
46 |
> # Creates the group if it does not exist yet. |
47 |
> diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass |
48 |
> index e82f3c56dbbe..f9772c3cb111 100644 |
49 |
> --- a/eclass/acct-user.eclass |
50 |
> +++ b/eclass/acct-user.eclass |
51 |
> @@ -312,7 +312,7 @@ acct-user_pkg_pretend() { |
52 |
> # @FUNCTION: acct-user_src_install |
53 |
> # @DESCRIPTION: |
54 |
> # Installs a keep-file into the user's home directory to ensure it is |
55 |
> -# owned by the package. |
56 |
> +# owned by the package, and sysusers.d file. |
57 |
> acct-user_src_install() { |
58 |
> debug-print-function ${FUNCNAME} "${@}" |
59 |
> |
60 |
> @@ -321,6 +321,20 @@ acct-user_src_install() { |
61 |
> # created yet |
62 |
> keepdir "${ACCT_USER_HOME}" |
63 |
> fi |
64 |
> + |
65 |
> + insinto /usr/lib/sysusers.d |
66 |
> + newins - ${CATEGORY}-${ACCT_USER_NAME}.conf < <( |
67 |
> + printf "u\t%q\t%q\t%q\t%q\t%q\n" \ |
68 |
> + "${ACCT_USER_NAME}" \ |
69 |
> + "${ACCT_USER_ID/#-*/-}:${ACCT_USER_GROUPS[0]}" \ |
70 |
> + "${DESCRIPTION//[:,=]/;}" \ |
71 |
> + "${ACCT_USER_HOME}" \ |
72 |
> + "${ACCT_USER_SHELL/#-*/-}" |
73 |
> + if [[ ${#ACCT_USER_GROUPS[@]} -gt 1 ]]; then |
74 |
> + printf "m\t${ACCT_USER_NAME}\t%q\n" \ |
75 |
> + "${ACCT_USER_GROUPS[@]:1}" |
76 |
> + fi |
77 |
> + ) |
78 |
> } |
79 |
> |
80 |
> # @FUNCTION: acct-user_pkg_preinst |
81 |
> -- |
82 |
> 2.28.0 |
83 |
> |
84 |
> |