diff options
-rw-r--r-- | sys-apps/openrc/openrc-0.1.ebuild | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys-apps/openrc/openrc-0.1.ebuild b/sys-apps/openrc/openrc-0.1.ebuild index 4452782..5cbb5d2 100644 --- a/sys-apps/openrc/openrc-0.1.ebuild +++ b/sys-apps/openrc/openrc-0.1.ebuild @@ -74,6 +74,26 @@ pkg_preinst() { ln -snf /etc/init.d/"${x}" "${ROOT}"etc/runlevels/boot/"${x}" done fi + + # Upgrade out state for baselayout-1 users + if [ ! -e "${ROOT}${LIBDIR}"/init.d/started \ + -a -e "${ROOT}"etc/conf.d/rc ]; then + ( + . "${ROOT}etc/conf.d/rc" + svcdir="${svcdir:-/var/lib/init.d}" + if [ ! -d "${ROOT}${svcdir}/started" ]; then + ewarn "No state found, and no state exists" + elog "You should reboot this host" + else + einfo "Moving state from ${ROOT}${svcdir} to ${ROOT}${LIBDIR}/rc/init.d" + mv "${ROOT}${svcdir}"/* "${ROOT}${LIBDIR}"/rc/init.d + rm -rf "${ROOT}${LIBDIR}"/rc/init.d/daemons \ + "${ROOT}${LIBDIR}"/rc/init.d/console + umount "${ROOT}${svcdir}" 2>/dev/null + rm -rf "${ROOT}${svcdir}" + fi + ) + fi } pkg_postinst() { |