Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 702624 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-11 / +63 lines)
Line  Link Here
0
-- eclass/acct-group.eclass
0
++ eclass/acct-group.eclass
Lines 41-46 Link Here
41
41
42
inherit user
42
inherit user
43
43
44
IUSE="sysusers"
45
BDEPEND="sysusers? ( sys-apps/systemd )"
46
44
[[ ${CATEGORY} == acct-group ]] ||
47
[[ ${CATEGORY} == acct-group ]] ||
45
	die "Ebuild error: this eclass can be used only in acct-group category!"
48
	die "Ebuild error: this eclass can be used only in acct-group category!"
46
49
Lines 80-86 Link Here
80
83
81
84
82
# << Phase functions >>
85
# << Phase functions >>
83
EXPORT_FUNCTIONS pkg_pretend pkg_preinst
86
EXPORT_FUNCTIONS pkg_pretend src_install pkg_preinst
84
87
85
# @FUNCTION: acct-group_pkg_pretend
88
# @FUNCTION: acct-group_pkg_pretend
86
# @DESCRIPTION:
89
# @DESCRIPTION:
Lines 116-129 Link Here
116
	fi
119
	fi
117
}
120
}
118
121
122
# @FUNCTION: acct-group_src_install
123
# @DESCRIPTION:
124
# Writes the group configuration file when using sysusers.
125
acct-group_src_install() {
126
	debug-print-function ${FUNCNAME} "${@}"
127
128
	if use sysusers; then
129
		echo > "${T}/acct-group-${PN}.conf" g \
130
			"${ACCT_USER_NAME}" \
131
			"${ACCT_USER_ID/#-*/-}"
132
		insinto /usr/lib/sysusers.d
133
		doins "${T}/acct-group-${PN}.conf"
134
	fi
135
}
136
119
# @FUNCTION: acct-group_pkg_preinst
137
# @FUNCTION: acct-group_pkg_preinst
120
# @DESCRIPTION:
138
# @DESCRIPTION:
121
# Creates the group if it does not exist yet.
139
# Creates the group if it does not exist yet.
122
acct-group_pkg_preinst() {
140
acct-group_pkg_preinst() {
123
	debug-print-function ${FUNCNAME} "${@}"
141
	debug-print-function ${FUNCNAME} "${@}"
124
142
125
	enewgroup ${ACCT_GROUP_ENFORCE_ID:+-F} "${ACCT_GROUP_NAME}" \
143
	if use sysusers; then
126
		"${ACCT_GROUP_ID}"
144
		# create the group on the build system so chgrp works
145
		systemd-sysusers \
146
			"${ED}/usr/lib/sysusers.d/acct-group-${PN}.conf"
147
	else
148
		enewgroup ${ACCT_GROUP_ENFORCE_ID:+-F} "${ACCT_GROUP_NAME}" \
149
			"${ACCT_GROUP_ID}"
150
	fi
127
}
151
}
128
152
129
fi
153
fi
130
-- eclass/acct-user.eclass
154
++ eclass/acct-user.eclass
Lines 49-54 Link Here
49
49
50
inherit user
50
inherit user
51
51
52
IUSE="sysusers"
53
BDEPEND="sysusers? ( sys-apps/systemd )"
54
52
[[ ${CATEGORY} == acct-user ]] ||
55
[[ ${CATEGORY} == acct-user ]] ||
53
	die "Ebuild error: this eclass can be used only in acct-user category!"
56
	die "Ebuild error: this eclass can be used only in acct-user category!"
54
57
Lines 312-318 Link Here
312
# @FUNCTION: acct-user_src_install
315
# @FUNCTION: acct-user_src_install
313
# @DESCRIPTION:
316
# @DESCRIPTION:
314
# Installs a keep-file into the user's home directory to ensure it is
317
# Installs a keep-file into the user's home directory to ensure it is
315
# owned by the package.
318
# owned by the package.  Writes the user configuration file when using
319
# sysusers.
316
acct-user_src_install() {
320
acct-user_src_install() {
317
	debug-print-function ${FUNCNAME} "${@}"
321
	debug-print-function ${FUNCNAME} "${@}"
318
322
Lines 321-326 Link Here
321
		# created yet
325
		# created yet
322
		keepdir "${ACCT_USER_HOME}"
326
		keepdir "${ACCT_USER_HOME}"
323
	fi
327
	fi
328
329
	if use sysusers; then
330
		echo > "${T}/acct-user-${PN}.conf" u \
331
			"${ACCT_USER_NAME}" \
332
			"${ACCT_USER_ID/#-*/-}" \
333
			"\"${DESCRIPTION//[:,=\"]/;}\"" \
334
			"${ACCT_USER_HOME}" \
335
			"${ACCT_USER_SHELL/#-*/-}"
336
		local group
337
		for group in "${ACCT_USER_GROUPS[@]}"; do
338
			echo m "${ACCT_USER_NAME}" "$group"
339
		done >> "${T}/acct-user-${PN}.conf"
340
		insinto /usr/lib/sysusers.d
341
		doins "${T}/acct-user-${PN}.conf"
342
	fi
324
}
343
}
325
344
326
# @FUNCTION: acct-user_pkg_preinst
345
# @FUNCTION: acct-user_pkg_preinst
Lines 330-339 Link Here
330
acct-user_pkg_preinst() {
349
acct-user_pkg_preinst() {
331
	debug-print-function ${FUNCNAME} "${@}"
350
	debug-print-function ${FUNCNAME} "${@}"
332
351
333
	local groups=${ACCT_USER_GROUPS[*]}
352
	if use sysusers; then
334
	enewuser ${ACCT_USER_ENFORCE_ID:+-F} -M "${ACCT_USER_NAME}" \
353
		# create the user on the build system so chown works
335
		"${ACCT_USER_ID}" "${ACCT_USER_SHELL}" "${ACCT_USER_HOME}" \
354
		systemd-sysusers \
336
		"${groups// /,}"
355
			"${ED}/usr/lib/sysusers.d/acct-user-${PN}.conf"
356
	else
357
		local groups=${ACCT_USER_GROUPS[*]}
358
		enewuser ${ACCT_USER_ENFORCE_ID:+-F} -M "${ACCT_USER_NAME}" \
359
			"${ACCT_USER_ID}" "${ACCT_USER_SHELL}" \
360
			"${ACCT_USER_HOME}" "${groups// /,}"
361
	fi
337
362
338
	if [[ ${ACCT_USER_HOME} != /dev/null ]]; then
363
	if [[ ${ACCT_USER_HOME} != /dev/null ]]; then
339
		# default ownership to user:group
364
		# default ownership to user:group
Lines 360-365 Link Here
360
acct-user_pkg_postinst() {
385
acct-user_pkg_postinst() {
361
	debug-print-function ${FUNCNAME} "${@}"
386
	debug-print-function ${FUNCNAME} "${@}"
362
387
388
	use sysusers && return
389
363
	# NB: eset* functions check current value
390
	# NB: eset* functions check current value
364
	esethome "${ACCT_USER_NAME}" "${ACCT_USER_HOME}"
391
	esethome "${ACCT_USER_NAME}" "${ACCT_USER_HOME}"
365
	esetshell "${ACCT_USER_NAME}" "${ACCT_USER_SHELL}"
392
	esetshell "${ACCT_USER_NAME}" "${ACCT_USER_SHELL}"
366
-- profiles/use.desc
393
++ profiles/use.desc
Lines 304-309 Link Here
304
symlink - Force kernel ebuilds to automatically update the /usr/src/linux symlink
304
symlink - Force kernel ebuilds to automatically update the /usr/src/linux symlink
305
syslog - Enable support for syslog
305
syslog - Enable support for syslog
306
systemd - Enable use of systemd-specific libraries and features like socket activation or session tracking
306
systemd - Enable use of systemd-specific libraries and features like socket activation or session tracking
307
sysusers - Install systemd-sysusers configuration files instead of creating users and groups directly
307
szip - Use the szip compression library
308
szip - Use the szip compression library
308
taglib - Enable tagging support with taglib
309
taglib - Enable tagging support with taglib
309
tcl - Add support the Tcl language
310
tcl - Add support the Tcl language

Return to bug 702624