diff options
author | Roy Marples <roy@marples.name> | 2007-12-28 12:37:17 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-12-28 12:37:17 +0000 |
commit | dac354dad9c0412ec54b9c94092eb07ca83adf82 (patch) | |
tree | f5eb5ebc200a3ca5b74ab1c9f9f7c5bc8c7cd579 | |
parent | Fix upgraders (diff) | |
download | uberlord-dac354dad9c0412ec54b9c94092eb07ca83adf82.tar.gz uberlord-dac354dad9c0412ec54b9c94092eb07ca83adf82.tar.bz2 uberlord-dac354dad9c0412ec54b9c94092eb07ca83adf82.zip |
Try and support baselayout-1 upgraders
-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() { |