Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/
Date: Tue, 03 Mar 2020 22:22:10
Message-Id: 1583274125.d69d4d3b82d853130b440ceeb59a51e73443bf53.floppym@gentoo
1 commit: d69d4d3b82d853130b440ceeb59a51e73443bf53
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 3 22:21:46 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 3 22:22:05 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d69d4d3b
7
8 sys-apps/systemd: bump to 245-rc2
9
10 Package-Manager: Portage-2.3.91_p5, Repoman-2.3.20_p113
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 sys-apps/systemd/Manifest | 1 +
14 sys-apps/systemd/systemd-245_rc2.ebuild | 510 ++++++++++++++++++++++++++++++++
15 2 files changed, 511 insertions(+)
16
17 diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest
18 index 0001c941864..1128f76364d 100644
19 --- a/sys-apps/systemd/Manifest
20 +++ b/sys-apps/systemd/Manifest
21 @@ -1,4 +1,5 @@
22 DIST systemd-243.tar.gz 8242522 BLAKE2B 89e3ebbea5a99061329f7c78220a66c1e075d5ba90dfdf5ee8d0d9b762ef4600dc82d8ca2054632e5e343b6272cd8046c92f7f99dcfa8287c5ef2b42fb96d4cb SHA512 56b52a297aa5ac04d9667eb3afb1598725b197de73ff72baa1aabbc2844e36fba7b7fccdf6d214ae8b5b926616b2b7e15772763aaa80ec938d74333ff9c8673e
23 DIST systemd-244.tar.gz 8445963 BLAKE2B 19751fb9c058a079694ee1b991259fd3f1fa30ae98ca38bbe8caadfc5628db7848c7f742a1b11781fbd67f911adda917d7a4da1dddb63064907f86f47e5a3256 SHA512 08f260fb15b5eb273faafda826dd9154e9a02841b4c5911cc1c7e1445072ad51389f8cced7b9acf112737c20fd56b2fbf48b3f914733c934c774d38a23b616fb
24 DIST systemd-245-rc1.tar.gz 8961356 BLAKE2B ed04166ead57c2f1cc1a1ca2f0041cae134b503d3448ea9fdd799e12d81f45721ee304d4aabd96d3eab8ea1321b283820e8d2a850b41733e40f07fd419f67b95 SHA512 2ef9a295f3897c6642a2fac2e3c73467ece9bc6fc196cc4f3707b9c23af2581eb9f74def78909d57513b67604bf1cf6dc5dbb31c6d435f7997677d09a73d006b
25 +DIST systemd-245-rc2.tar.gz 8986493 BLAKE2B 7b5fdb3af94cbedf75e3c4d150797fe4a150102519766e5db3275df9d677ff0e4b69aef07f7bcd9e5efb52392be65c93f3fd3ba66c9b9a8de4e18b906545bddb SHA512 71d6a7c8db4845c95abe66aca041bf6df7d868a9f56be94a188c11647f723d33ea8611a8a84d0f2f71ceacafa4d41fa9c26df25c239c60e0121e762570b8a963
26 DIST systemd-stable-244.3.tar.gz 8484735 BLAKE2B 25125ecdae59c852e8ceb45b7ed0b76631b301ab4026c4e389c4bc12090fe41f5918411a75bd20f38b6b3993445df93c850ba98f8d9b30fd24fc4e25f8355a3d SHA512 f8e83fa3e57ac8fdbed61b66bb45fd0eafa6fb36eda26f10690d93f34b03daab6ce4e7eff45b79dcaf59f11f41c1b022d1d9314f576c50ad28f6bb5901f1b18d
27
28 diff --git a/sys-apps/systemd/systemd-245_rc2.ebuild b/sys-apps/systemd/systemd-245_rc2.ebuild
29 new file mode 100644
30 index 00000000000..6454de6e169
31 --- /dev/null
32 +++ b/sys-apps/systemd/systemd-245_rc2.ebuild
33 @@ -0,0 +1,510 @@
34 +# Copyright 2011-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +if [[ ${PV} == 9999 ]]; then
40 + EGIT_REPO_URI="https://github.com/systemd/systemd.git"
41 + inherit git-r3
42 +else
43 + if [[ ${PV} == *.* ]]; then
44 + MY_PN=systemd-stable
45 + else
46 + MY_PN=systemd
47 + fi
48 + MY_PV=${PV/_/-}
49 + MY_P=${MY_PN}-${MY_PV}
50 + S=${WORKDIR}/${MY_P}
51 + SRC_URI="https://github.com/systemd/${MY_PN}/archive/v${MY_PV}/${MY_P}.tar.gz"
52 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
53 +fi
54 +
55 +PYTHON_COMPAT=( python3_{6,7,8} )
56 +
57 +inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev usr-ldscript
58 +
59 +DESCRIPTION="System and service manager for Linux"
60 +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
61 +
62 +LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
63 +SLOT="0/2"
64 +IUSE="acl apparmor audit build cgroup-hybrid cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi http idn importd +kmod +lz4 lzma nat pam pcre pkcs11 policykit pwquality qrcode +resolvconf +seccomp selinux split-usr static-libs +sysv-utils test vanilla xkb"
65 +
66 +REQUIRED_USE="importd? ( curl gcrypt lzma )"
67 +RESTRICT="!test? ( test )"
68 +
69 +MINKV="3.11"
70 +
71 +COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}]
72 + sys-libs/libcap:0=[${MULTILIB_USEDEP}]
73 + acl? ( sys-apps/acl:0= )
74 + apparmor? ( sys-libs/libapparmor:0= )
75 + audit? ( >=sys-process/audit-2:0= )
76 + cryptsetup? ( >=sys-fs/cryptsetup-2.0.1:0= )
77 + curl? ( net-misc/curl:0= )
78 + dns-over-tls? ( >=net-libs/gnutls-3.5.3:0= )
79 + elfutils? ( >=dev-libs/elfutils-0.158:0= )
80 + gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
81 + http? (
82 + >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)]
83 + >=net-libs/gnutls-3.1.4:0=
84 + )
85 + idn? ( net-dns/libidn2:= )
86 + importd? (
87 + app-arch/bzip2:0=
88 + sys-libs/zlib:0=
89 + )
90 + kmod? ( >=sys-apps/kmod-15:0= )
91 + lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] )
92 + lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
93 + nat? ( net-firewall/iptables:0= )
94 + pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] )
95 + pkcs11? ( app-crypt/p11-kit:0= )
96 + pcre? ( dev-libs/libpcre2 )
97 + pwquality? ( dev-libs/libpwquality:0= )
98 + qrcode? ( media-gfx/qrencode:0= )
99 + seccomp? ( >=sys-libs/libseccomp-2.3.3:0= )
100 + selinux? ( sys-libs/libselinux:0= )
101 + xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )"
102 +
103 +# Newer linux-headers needed by ia64, bug #480218
104 +DEPEND="${COMMON_DEPEND}
105 + >=sys-kernel/linux-headers-${MINKV}
106 + gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
107 +"
108 +
109 +# baselayout-2.2 has /run
110 +RDEPEND="${COMMON_DEPEND}
111 + acct-group/adm
112 + acct-group/wheel
113 + acct-group/kmem
114 + acct-group/tty
115 + acct-group/utmp
116 + acct-group/audio
117 + acct-group/cdrom
118 + acct-group/dialout
119 + acct-group/disk
120 + acct-group/input
121 + acct-group/kvm
122 + acct-group/render
123 + acct-group/tape
124 + acct-group/video
125 + acct-group/systemd-journal
126 + acct-user/systemd-journal-remote
127 + acct-user/systemd-coredump
128 + acct-user/systemd-network
129 + acct-user/systemd-resolve
130 + acct-user/systemd-timesync
131 + >=sys-apps/baselayout-2.2
132 + selinux? ( sec-policy/selinux-base-policy[systemd] )
133 + sysv-utils? ( !sys-apps/sysvinit )
134 + !sysv-utils? ( sys-apps/sysvinit )
135 + resolvconf? ( !net-dns/openresolv )
136 + !build? ( || (
137 + sys-apps/util-linux[kill(-)]
138 + sys-process/procps[kill(+)]
139 + sys-apps/coreutils[kill(-)]
140 + ) )
141 + !sys-auth/nss-myhostname
142 + !sys-fs/eudev
143 + !sys-fs/udev
144 +"
145 +
146 +# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
147 +PDEPEND=">=sys-apps/dbus-1.9.8[systemd]
148 + >=sys-apps/hwids-20150417[udev]
149 + >=sys-fs/udev-init-scripts-25
150 + policykit? ( sys-auth/polkit )
151 + !vanilla? ( sys-apps/gentoo-systemd-integration )"
152 +
153 +BDEPEND="
154 + app-arch/xz-utils:0
155 + dev-util/gperf
156 + >=dev-util/meson-0.46
157 + >=dev-util/intltool-0.50
158 + >=sys-apps/coreutils-8.16
159 + sys-devel/m4
160 + virtual/pkgconfig[${MULTILIB_USEDEP}]
161 + test? ( sys-apps/dbus )
162 + app-text/docbook-xml-dtd:4.2
163 + app-text/docbook-xml-dtd:4.5
164 + app-text/docbook-xsl-stylesheets
165 + dev-libs/libxslt:0
166 + $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
167 +"
168 +
169 +python_check_deps() {
170 + has_version -b "dev-python/lxml[${PYTHON_USEDEP}]"
171 +}
172 +
173 +pkg_pretend() {
174 + if [[ ${MERGE_TYPE} != buildonly ]]; then
175 + if use test && has pid-sandbox ${FEATURES}; then
176 + ewarn "Tests are known to fail with PID sandboxing enabled."
177 + ewarn "See https://bugs.gentoo.org/674458."
178 + fi
179 +
180 + local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
181 + ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE
182 + ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS
183 + ~TIMERFD ~TMPFS_XATTR ~UNIX
184 + ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH
185 + ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
186 + ~!SYSFS_DEPRECATED_V2"
187 +
188 + use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
189 + use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER"
190 + kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
191 + kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES"
192 + kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF"
193 +
194 + if linux_config_exists; then
195 + local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
196 + if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then
197 + ewarn "It's recommended to set an empty value to the following kernel config option:"
198 + ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
199 + fi
200 + if linux_chkconfig_present X86; then
201 + CONFIG_CHECK+=" ~DMIID"
202 + fi
203 + fi
204 +
205 + if kernel_is -lt ${MINKV//./ }; then
206 + ewarn "Kernel version at least ${MINKV} required"
207 + fi
208 +
209 + check_extra_config
210 + fi
211 +}
212 +
213 +pkg_setup() {
214 + :
215 +}
216 +
217 +src_unpack() {
218 + default
219 + [[ ${PV} != 9999 ]] || git-r3_src_unpack
220 +}
221 +
222 +src_prepare() {
223 + # Do NOT add patches here
224 + local PATCHES=()
225 +
226 + [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches )
227 +
228 + # Add local patches here
229 + PATCHES+=(
230 + )
231 +
232 + if ! use vanilla; then
233 + PATCHES+=(
234 + "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch"
235 + "${FILESDIR}/gentoo-systemd-user-pam.patch"
236 + "${FILESDIR}/gentoo-generator-path-r1.patch"
237 + )
238 + fi
239 +
240 + default
241 +}
242 +
243 +src_configure() {
244 + # Prevent conflicts with i686 cross toolchain, bug 559726
245 + tc-export AR CC NM OBJCOPY RANLIB
246 +
247 + python_setup
248 +
249 + multilib-minimal_src_configure
250 +}
251 +
252 +meson_use() {
253 + usex "$1" true false
254 +}
255 +
256 +meson_multilib() {
257 + if multilib_is_native_abi; then
258 + echo true
259 + else
260 + echo false
261 + fi
262 +}
263 +
264 +meson_multilib_native_use() {
265 + if multilib_is_native_abi && use "$1"; then
266 + echo true
267 + else
268 + echo false
269 + fi
270 +}
271 +
272 +multilib_src_configure() {
273 + local myconf=(
274 + --localstatedir="${EPREFIX}/var"
275 + -Dsupport-url="https://gentoo.org/support/"
276 + -Dpamlibdir="$(getpam_mod_dir)"
277 + # avoid bash-completion dep
278 + -Dbashcompletiondir="$(get_bashcompdir)"
279 + # make sure we get /bin:/sbin in PATH
280 + -Dsplit-usr=$(usex split-usr true false)
281 + -Dsplit-bin=true
282 + -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")"
283 + -Drootlibdir="${EPREFIX}/usr/$(get_libdir)"
284 + -Dsysvinit-path=
285 + -Dsysvrcnd-path=
286 + # Avoid infinite exec recursion, bug 642724
287 + -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit"
288 + # no deps
289 + -Dima=true
290 + -Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified)
291 + # Optional components/dependencies
292 + -Dacl=$(meson_multilib_native_use acl)
293 + -Dapparmor=$(meson_multilib_native_use apparmor)
294 + -Daudit=$(meson_multilib_native_use audit)
295 + -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup)
296 + -Dlibcurl=$(meson_multilib_native_use curl)
297 + -Ddns-over-tls=$(meson_multilib_native_use dns-over-tls)
298 + -Delfutils=$(meson_multilib_native_use elfutils)
299 + -Dgcrypt=$(meson_use gcrypt)
300 + -Dgnu-efi=$(meson_multilib_native_use gnuefi)
301 + -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)"
302 + -Dmicrohttpd=$(meson_multilib_native_use http)
303 + -Didn=$(meson_multilib_native_use idn)
304 + -Dimportd=$(meson_multilib_native_use importd)
305 + -Dbzip2=$(meson_multilib_native_use importd)
306 + -Dzlib=$(meson_multilib_native_use importd)
307 + -Dkmod=$(meson_multilib_native_use kmod)
308 + -Dlz4=$(meson_use lz4)
309 + -Dxz=$(meson_use lzma)
310 + -Dlibiptc=$(meson_multilib_native_use nat)
311 + -Dpam=$(meson_use pam)
312 + -Dp11kit=$(meson_multilib_native_use pkcs11)
313 + -Dpcre2=$(meson_multilib_native_use pcre)
314 + -Dpolkit=$(meson_multilib_native_use policykit)
315 + -Dpwquality=$(meson_multilib_native_use pwquality)
316 + -Dqrencode=$(meson_multilib_native_use qrcode)
317 + -Dseccomp=$(meson_multilib_native_use seccomp)
318 + -Dselinux=$(meson_multilib_native_use selinux)
319 + -Ddbus=$(meson_multilib_native_use test)
320 + -Dxkbcommon=$(meson_multilib_native_use xkb)
321 + -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
322 + # Breaks screen, tmux, etc.
323 + -Ddefault-kill-user-processes=false
324 + -Dcreate-log-dirs=false
325 +
326 + # multilib options
327 + -Dbacklight=$(meson_multilib)
328 + -Dbinfmt=$(meson_multilib)
329 + -Dcoredump=$(meson_multilib)
330 + -Denvironment-d=$(meson_multilib)
331 + -Dfirstboot=$(meson_multilib)
332 + -Dhibernate=$(meson_multilib)
333 + -Dhostnamed=$(meson_multilib)
334 + -Dhwdb=$(meson_multilib)
335 + -Dldconfig=$(meson_multilib)
336 + -Dlocaled=$(meson_multilib)
337 + -Dman=$(meson_multilib)
338 + -Dnetworkd=$(meson_multilib)
339 + -Dquotacheck=$(meson_multilib)
340 + -Drandomseed=$(meson_multilib)
341 + -Drfkill=$(meson_multilib)
342 + -Dsysusers=$(meson_multilib)
343 + -Dtimedated=$(meson_multilib)
344 + -Dtimesyncd=$(meson_multilib)
345 + -Dtmpfiles=$(meson_multilib)
346 + -Dvconsole=$(meson_multilib)
347 +
348 + # static-libs
349 + -Dstatic-libsystemd=$(usex static-libs true false)
350 + -Dstatic-libudev=$(usex static-libs true false)
351 + )
352 +
353 + meson_src_configure "${myconf[@]}"
354 +}
355 +
356 +multilib_src_compile() {
357 + eninja
358 +}
359 +
360 +multilib_src_test() {
361 + unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR
362 + meson_src_test
363 +}
364 +
365 +multilib_src_install() {
366 + DESTDIR="${D}" eninja install
367 +}
368 +
369 +multilib_src_install_all() {
370 + local rootprefix=$(usex split-usr '' /usr)
371 +
372 + # meson doesn't know about docdir
373 + mv "${ED}"/usr/share/doc/{systemd,${PF}} || die
374 +
375 + einstalldocs
376 + dodoc "${FILESDIR}"/nsswitch.conf
377 +
378 + if ! use resolvconf; then
379 + rm -f "${ED}${rootprefix}"/sbin/resolvconf || die
380 + fi
381 +
382 + if ! use sysv-utils; then
383 + rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die
384 + rm "${ED}"/usr/share/man/man1/init.1 || die
385 + rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die
386 + fi
387 +
388 + if ! use resolvconf && ! use sysv-utils; then
389 + rmdir "${ED}${rootprefix}"/sbin || die
390 + fi
391 +
392 + # Preserve empty dirs in /etc & /var, bug #437008
393 + keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d}
394 + keepdir /etc/kernel/install.d
395 + keepdir /etc/systemd/{network,system,user}
396 + keepdir /etc/udev/{hwdb.d,rules.d}
397 + keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown}
398 + keepdir /usr/lib/{binfmt.d,modules-load.d}
399 + keepdir /usr/lib/systemd/user-generators
400 + keepdir /var/lib/systemd
401 + keepdir /var/log/journal
402 +
403 + # Symlink /etc/sysctl.conf for easy migration.
404 + dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
405 +
406 + rm -r "${ED}${rootprefix}"/lib/udev/hwdb.d || die
407 +
408 + if use split-usr; then
409 + # Avoid breaking boot/reboot
410 + dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
411 + dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
412 + fi
413 +
414 + gen_usr_ldscript -a systemd udev
415 +}
416 +
417 +migrate_locale() {
418 + local envd_locale_def="${EROOT}/etc/env.d/02locale"
419 + local envd_locale=( "${EROOT}"/etc/env.d/??locale )
420 + local locale_conf="${EROOT}/etc/locale.conf"
421 +
422 + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
423 + # If locale.conf does not exist...
424 + if [[ -e ${envd_locale} ]]; then
425 + # ...either copy env.d/??locale if there's one
426 + ebegin "Moving ${envd_locale} to ${locale_conf}"
427 + mv "${envd_locale}" "${locale_conf}"
428 + eend ${?} || FAIL=1
429 + else
430 + # ...or create a dummy default
431 + ebegin "Creating ${locale_conf}"
432 + cat > "${locale_conf}" <<-EOF
433 + # This file has been created by the sys-apps/systemd ebuild.
434 + # See locale.conf(5) and localectl(1).
435 +
436 + # LANG=${LANG}
437 + EOF
438 + eend ${?} || FAIL=1
439 + fi
440 + fi
441 +
442 + if [[ ! -L ${envd_locale} ]]; then
443 + # now, if env.d/??locale is not a symlink (to locale.conf)...
444 + if [[ -e ${envd_locale} ]]; then
445 + # ...warn the user that he has duplicate locale settings
446 + ewarn
447 + ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
448 + ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
449 + ewarn "and create the symlink with the following command:"
450 + ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
451 + ewarn
452 + else
453 + # ...or just create the symlink if there's nothing here
454 + ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
455 + ln -n -s ../locale.conf "${envd_locale_def}"
456 + eend ${?} || FAIL=1
457 + fi
458 + fi
459 +}
460 +
461 +save_enabled_units() {
462 + ENABLED_UNITS=()
463 + type systemctl &>/dev/null || return
464 + for x; do
465 + if systemctl --quiet --root="${ROOT:-/}" is-enabled "${x}"; then
466 + ENABLED_UNITS+=( "${x}" )
467 + fi
468 + done
469 +}
470 +
471 +pkg_preinst() {
472 + save_enabled_units {machines,remote-{cryptsetup,fs}}.target getty@××××.service
473 +
474 + if ! use split-usr; then
475 + local dir
476 + for dir in bin sbin lib; do
477 + if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then
478 + eerror "\"${EROOT}/${dir}\" and \"${EROOT}/usr/${dir}\" are not merged."
479 + eerror "One of them should be a symbolic link to the other one."
480 + FAIL=1
481 + fi
482 + done
483 + if [[ ${FAIL} ]]; then
484 + eerror "Migration to system layout with merged directories must be performed before"
485 + eerror "rebuilding ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage."
486 + die "System layout with split directories still used"
487 + fi
488 + fi
489 +}
490 +
491 +pkg_postinst() {
492 + systemd_update_catalog
493 +
494 + # Keep this here in case the database format changes so it gets updated
495 + # when required. Despite that this file is owned by sys-apps/hwids.
496 + if has_version "sys-apps/hwids[udev]"; then
497 + udevadm hwdb --update --root="${EROOT}"
498 + fi
499 +
500 + udev_reload || FAIL=1
501 +
502 + # Bug 465468, make sure locales are respect, and ensure consistency
503 + # between OpenRC & systemd
504 + migrate_locale
505 +
506 + systemd_reenable systemd-networkd.service systemd-resolved.service
507 +
508 + if [[ ${ENABLED_UNITS[@]} ]]; then
509 + systemctl --root="${ROOT:-/}" enable "${ENABLED_UNITS[@]}"
510 + fi
511 +
512 + if [[ -z ${REPLACING_VERSIONS} ]]; then
513 + if type systemctl &>/dev/null; then
514 + systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1
515 + fi
516 + elog "To enable a useful set of services, run the following:"
517 + elog " systemctl preset-all --preset-mode=enable-only"
518 + fi
519 +
520 + if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then
521 + rm "${EROOT}/var/lib/systemd/timesync"
522 + fi
523 +
524 + if [[ -z ${ROOT} && -d /run/systemd/system ]]; then
525 + ebegin "Reexecuting system manager"
526 + systemctl daemon-reexec
527 + eend $?
528 + fi
529 +
530 + if [[ ${FAIL} ]]; then
531 + eerror "One of the postinst commands failed. Please check the postinst output"
532 + eerror "for errors. You may need to clean up your system and/or try installing"
533 + eerror "systemd again."
534 + eerror
535 + fi
536 +}
537 +
538 +pkg_prerm() {
539 + # If removing systemd completely, remove the catalog database.
540 + if [[ ! ${REPLACED_BY_VERSION} ]]; then
541 + rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
542 + fi
543 +}