Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/openrc/
Date: Wed, 12 Dec 2018 22:59:17
Message-Id: 1544655498.d773a16432d0ce1af5703a7d28aaae41be5d23e1.williamh@gentoo
1 commit: d773a16432d0ce1af5703a7d28aaae41be5d23e1
2 Author: William Hubbs <william.hubbs <AT> sony <DOT> com>
3 AuthorDate: Wed Dec 12 22:53:15 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 12 22:58:18 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d773a164
7
8 sys-apps/openrc-9999: remove runlevels directory from /usr/share
9
10 This was needed due to bug #523684.
11 Since this bug has been fixed for some time, we can remove this processing and
12 work with /etc/init.d/runlevels which means that most of the processing
13 now moves upstream.
14
15 Bug: https://bugs.gentoo.org/672924
16 Copyright: Sony Interactive Entertainment Inc.
17 Package-Manager: Portage-2.3.51, Repoman-2.3.12
18 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
19
20 sys-apps/openrc/openrc-9999.ebuild | 122 +------------------------------------
21 1 file changed, 1 insertion(+), 121 deletions(-)
22
23 diff --git a/sys-apps/openrc/openrc-9999.ebuild b/sys-apps/openrc/openrc-9999.ebuild
24 index 03c55deff41..423caaa847a 100644
25 --- a/sys-apps/openrc/openrc-9999.ebuild
26 +++ b/sys-apps/openrc/openrc-9999.ebuild
27 @@ -127,11 +127,6 @@ src_install() {
28 fi
29 keepdir /lib/rc/tmp
30
31 - # Backup our default runlevels
32 - dodir /usr/share/"${PN}"
33 - cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
34 - rm -rf "${ED}"/etc/runlevels
35 -
36 # Setup unicode defaults for silly unicode users
37 set_config_yes_no /etc/rc.conf unicode use unicode
38
39 @@ -140,7 +135,7 @@ src_install() {
40
41 # On HPPA, do not run consolefont by default (bug #222889)
42 if use hppa; then
43 - rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
44 + rm -f "${ED}"/etc/runlevels/boot/consolefont
45 fi
46
47 # Support for logfile rotation
48 @@ -158,37 +153,7 @@ src_install() {
49 fi
50 }
51
52 -add_boot_init() {
53 - local initd=$1
54 - local runlevel=${2:-boot}
55 - # if the initscript is not going to be installed and is not
56 - # currently installed, return
57 - [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
58 - || return
59 - [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
60 -
61 - # if runlevels dont exist just yet, then create it but still flag
62 - # to pkg_postinst that it needs real setup #277323
63 - if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
64 - mkdir -p "${EROOT}"etc/runlevels/${runlevel}
65 - touch "${EROOT}"etc/runlevels/.add_boot_init.created
66 - fi
67 -
68 - elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
69 - ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
70 -}
71 -add_boot_init_mit_config() {
72 - local config=$1 initd=$2
73 - if [[ -e ${EROOT}${config} ]] ; then
74 - if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
75 - add_boot_init ${initd}
76 - fi
77 - fi
78 -}
79 -
80 pkg_preinst() {
81 - local f LIBDIR=$(get_libdir)
82 -
83 # avoid default thrashing in conf.d files when possible #295406
84 if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
85 (
86 @@ -201,95 +166,10 @@ pkg_preinst() {
87
88 # set default interactive shell to sulogin if it exists
89 set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
90 -
91 - # termencoding was added in 0.2.1 and needed in boot
92 - has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
93 -
94 - # swapfiles was added in 0.9.9 and needed in boot (february 2012)
95 - has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
96 -
97 - if ! has_version ">=sys-apps/openrc-0.11"; then
98 - add_boot_init sysfs sysinit
99 - fi
100 -
101 - if ! has_version ">=sys-apps/openrc-0.11.3" ; then
102 - migrate_udev_mount_script
103 - fi
104 -
105 - # these were added in 0.12.
106 - if ! has_version ">=sys-apps/openrc-0.12"; then
107 - add_boot_init loopback
108 -
109 - # ensure existing /etc/conf.d/net is not removed
110 - # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
111 - # this needs to stay in openrc ebuilds for a long time. :(
112 - # Added in 0.12.
113 - if [[ -f "${EROOT}"etc/conf.d/net ]]; then
114 - einfo "Modifying conf.d/net to keep it from being removed"
115 - cat <<-EOF >>"${EROOT}"etc/conf.d/net
116 -
117 -# The network scripts are now part of net-misc/netifrc
118 -# In order to avoid sys-apps/${P} from removing this file, this comment was
119 -# added; you can safely remove this comment. Please see
120 -# /usr/share/doc/netifrc*/README* for more information.
121 -EOF
122 - fi
123 - fi
124 - has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
125 -
126 - if ! has_version ">=sys-apps/openrc-0.18.3"; then
127 - add_boot_init mtab
128 - if [[ -f "${EROOT}"etc/mtab ]] && [[ ! -L "${EROOT}"etc/mtab ]]; then
129 - ewarn "${EROOT}etc/mtab will be replaced with a"
130 - ewarn "symbolic link to /proc/self/mounts on the next"
131 - ewarn "reboot."
132 - ewarn "Change the setting in ${EROOT}etc/conf.d/mtab"
133 - ewarn "if you do not want this to happen."
134 - fi
135 - fi
136 -
137 - has_version ">=sys-apps/openrc-0.35" || add_boot_init cgroups sysinit
138 -
139 - if ! has_version ">=sys-apps/openrc-0.40"; then
140 - add_boot_init save-keymaps
141 - add_boot_init save-termencoding
142 - fi
143 -}
144 -
145 -# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
146 -migrate_udev_mount_script() {
147 - if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
148 - ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
149 - add_boot_init udev-mount sysinit
150 - fi
151 return 0
152 }
153
154 pkg_postinst() {
155 - local LIBDIR=$(get_libdir)
156 -
157 - # Make our runlevels if they don't exist
158 - if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
159 - einfo "Copying across default runlevels"
160 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
161 - rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
162 - else
163 - if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
164 - mkdir -p "${EROOT}"etc/runlevels/sysinit
165 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
166 - "${EROOT}"etc/runlevels/sysinit
167 - fi
168 - if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
169 - mkdir -p "${EROOT}"etc/runlevels/shutdown
170 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
171 - "${EROOT}"etc/runlevels/shutdown
172 - fi
173 - if [[ ! -e "${EROOT}"etc/runlevels/nonetwork/local ]]; then
174 - cp -RPp "${EROOT}"usr/share/${PN}/runlevels/nonetwork \
175 - "${EROOT}"etc/runlevels
176 - fi
177 - fi
178 -
179 if use hppa; then
180 elog "Setting the console font does not work on all HPPA consoles."
181 elog "You can still enable it by running:"