Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 599312 Details for
Bug 702624
acct-user.eclass: support systemd-sysusers
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Support using systemd-sysusers in GLEP 81 packages
sysusers.patch (text/plain), 3.95 KB, created by
David Michael
on 2019-12-12 21:30:01 UTC
(
hide
)
Description:
Support using systemd-sysusers in GLEP 81 packages
Filename:
MIME Type:
Creator:
David Michael
Created:
2019-12-12 21:30:01 UTC
Size:
3.95 KB
patch
obsolete
>--- eclass/acct-group.eclass >+++ eclass/acct-group.eclass >@@ -41,6 +41,9 @@ > > inherit user > >+IUSE="sysusers" >+BDEPEND="sysusers? ( sys-apps/systemd )" >+ > [[ ${CATEGORY} == acct-group ]] || > die "Ebuild error: this eclass can be used only in acct-group category!" > >@@ -80,7 +83,7 @@ > > > # << Phase functions >> >-EXPORT_FUNCTIONS pkg_pretend pkg_preinst >+EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst > > # @FUNCTION: acct-group_pkg_pretend > # @DESCRIPTION: >@@ -116,14 +119,35 @@ > fi > } > >+# @FUNCTION: acct-group_src_install >+# @DESCRIPTION: >+# Writes the group configuration file when using sysusers. >+acct-group_src_install() { >+ debug-print-function ${FUNCNAME} "${@}" >+ >+ if use sysusers; then >+ echo > "${T}/acct-group-${PN}.conf" g \ >+ "${ACCT_USER_NAME}" \ >+ "${ACCT_USER_ID/#-*/-}" >+ insinto /usr/lib/sysusers.d >+ doins "${T}/acct-group-${PN}.conf" >+ fi >+} >+ > # @FUNCTION: acct-group_pkg_preinst > # @DESCRIPTION: > # Creates the group if it does not exist yet. > acct-group_pkg_preinst() { > debug-print-function ${FUNCNAME} "${@}" > >- enewgroup ${ACCT_GROUP_ENFORCE_ID:+-F} "${ACCT_GROUP_NAME}" \ >- "${ACCT_GROUP_ID}" >+ if use sysusers; then >+ # create the group on the build system so chgrp works >+ systemd-sysusers \ >+ "${ED}/usr/lib/sysusers.d/acct-group-${PN}.conf" >+ else >+ enewgroup ${ACCT_GROUP_ENFORCE_ID:+-F} "${ACCT_GROUP_NAME}" \ >+ "${ACCT_GROUP_ID}" >+ fi > } > > fi >--- eclass/acct-user.eclass >+++ eclass/acct-user.eclass >@@ -49,6 +49,9 @@ > > inherit user > >+IUSE="sysusers" >+BDEPEND="sysusers? ( sys-apps/systemd )" >+ > [[ ${CATEGORY} == acct-user ]] || > die "Ebuild error: this eclass can be used only in acct-user category!" > >@@ -312,7 +315,8 @@ > # @FUNCTION: acct-user_src_install > # @DESCRIPTION: > # Installs a keep-file into the user's home directory to ensure it is >-# owned by the package. >+# owned by the package. Writes the user configuration file when using >+# sysusers. > acct-user_src_install() { > debug-print-function ${FUNCNAME} "${@}" > >@@ -321,6 +325,21 @@ > # created yet > keepdir "${ACCT_USER_HOME}" > fi >+ >+ if use sysusers; then >+ echo > "${T}/acct-user-${PN}.conf" u \ >+ "${ACCT_USER_NAME}" \ >+ "${ACCT_USER_ID/#-*/-}" \ >+ "\"${DESCRIPTION//[:,=\"]/;}\"" \ >+ "${ACCT_USER_HOME}" \ >+ "${ACCT_USER_SHELL/#-*/-}" >+ local group >+ for group in "${ACCT_USER_GROUPS[@]}"; do >+ echo m "${ACCT_USER_NAME}" "$group" >+ done >> "${T}/acct-user-${PN}.conf" >+ insinto /usr/lib/sysusers.d >+ doins "${T}/acct-user-${PN}.conf" >+ fi > } > > # @FUNCTION: acct-user_pkg_preinst >@@ -330,10 +349,16 @@ > acct-user_pkg_preinst() { > debug-print-function ${FUNCNAME} "${@}" > >- local groups=${ACCT_USER_GROUPS[*]} >- enewuser ${ACCT_USER_ENFORCE_ID:+-F} -M "${ACCT_USER_NAME}" \ >- "${ACCT_USER_ID}" "${ACCT_USER_SHELL}" "${ACCT_USER_HOME}" \ >- "${groups// /,}" >+ if use sysusers; then >+ # create the user on the build system so chown works >+ systemd-sysusers \ >+ "${ED}/usr/lib/sysusers.d/acct-user-${PN}.conf" >+ else >+ local groups=${ACCT_USER_GROUPS[*]} >+ enewuser ${ACCT_USER_ENFORCE_ID:+-F} -M "${ACCT_USER_NAME}" \ >+ "${ACCT_USER_ID}" "${ACCT_USER_SHELL}" \ >+ "${ACCT_USER_HOME}" "${groups// /,}" >+ fi > > if [[ ${ACCT_USER_HOME} != /dev/null ]]; then > # default ownership to user:group >@@ -360,6 +385,8 @@ > acct-user_pkg_postinst() { > debug-print-function ${FUNCNAME} "${@}" > >+ use sysusers && return >+ > # NB: eset* functions check current value > esethome "${ACCT_USER_NAME}" "${ACCT_USER_HOME}" > esetshell "${ACCT_USER_NAME}" "${ACCT_USER_SHELL}" >--- profiles/use.desc >+++ profiles/use.desc >@@ -304,6 +304,7 @@ > symlink - Force kernel ebuilds to automatically update the /usr/src/linux symlink > syslog - Enable support for syslog > systemd - Enable use of systemd-specific libraries and features like socket activation or session tracking >+sysusers - Install systemd-sysusers configuration files instead of creating users and groups directly > szip - Use the szip compression library > taglib - Enable tagging support with taglib > tcl - Add support the Tcl language
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 702624
:
599312
|
599352
|
657352
|
657394