Handle upgrading and downgrading of the state dir cleanly, although the
authorRoy Marples <uberlord@gentoo.org>
Tue, 19 Dec 2006 16:27:02 +0000 (16:27 +0000)
committerRoy Marples <uberlord@gentoo.org>
Tue, 19 Dec 2006 16:27:02 +0000 (16:27 +0000)
  deptree won't be correct after an etc-update - see bug #158548 for why.
Package-Manager: portage-2.1.2_rc3-r7

sys-apps/baselayout/ChangeLog
sys-apps/baselayout/Manifest
sys-apps/baselayout/baselayout-1.13.0_alpha9-r3.ebuild

index f7b0669713587ce1aa173e6a44b3097f873de451..2734826aa5a7e0585edb46bad54f531779570a31 100644 (file)
@@ -1,10 +1,15 @@
 # ChangeLog for sys-apps/baselayout
 # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.376 2006/12/19 13:38:26 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.377 2006/12/19 16:27:02 uberlord Exp $
 
 # See the rc-scripts ChangeLog in subversion for release info:
 # http://sources.gentoo.org/viewcvs.py/*checkout*/baselayout/trunk/ChangeLog
 
+  19 Dec 2006; Roy Marples <uberlord@gentoo.org>
+  baselayout-1.13.0_alpha9-r3.ebuild:
+  Handle upgrading and downgrading of the state dir cleanly, although the
+  deptree won't be correct after an etc-update - see bug #158548 for why.
+
   19 Dec 2006; Roy Marples <uberlord@gentoo.org>
   baselayout-1.12.7-r3.ebuild, baselayout-1.12.7-r4.ebuild:
   Punt the create_dev_nodes function as it's no longer used.
index b726594c741eac5c9d5a7df7d1a95d92f4b1a16d..57b2867c99667e5d118dad6bc8a8b9e911906a69 100644 (file)
@@ -138,14 +138,14 @@ EBUILD baselayout-1.12.7-r4.ebuild 17119 RMD160 676581eb5f3f8b5303db0ac93ac71cf4
 MD5 ac3a87ec40ae5234d3e90b41abbca0b1 baselayout-1.12.7-r4.ebuild 17119
 RMD160 676581eb5f3f8b5303db0ac93ac71cf4ab958692 baselayout-1.12.7-r4.ebuild 17119
 SHA256 46a99024d17cbcac4d20f19b50881b01c059080cabf85ea825cd275f75c4fa1d baselayout-1.12.7-r4.ebuild 17119
-EBUILD baselayout-1.13.0_alpha9-r3.ebuild 10110 RMD160 4c294b0f3f228a1bf1c4e9d5eb63a0bcc22ef103 SHA1 08fe7dea011fabbee11b0329fc157cebfad7a746 SHA256 aa6260c073bf365af32fc3b6c948f8f2f89e0aea10f535af79e9663ed6b539b1
-MD5 aa02196f50280a51413fdccba2d07672 baselayout-1.13.0_alpha9-r3.ebuild 10110
-RMD160 4c294b0f3f228a1bf1c4e9d5eb63a0bcc22ef103 baselayout-1.13.0_alpha9-r3.ebuild 10110
-SHA256 aa6260c073bf365af32fc3b6c948f8f2f89e0aea10f535af79e9663ed6b539b1 baselayout-1.13.0_alpha9-r3.ebuild 10110
-MISC ChangeLog 85203 RMD160 723b2ed07ca08c591dea6a40273252e9289bae6e SHA1 16704cc24c7ddcddf24210f1b240c53fe000bf9d SHA256 0b0a5db8e6f6623e723c8f996b75656de00c3f5579a41c85d7c53fd481b59c8a
-MD5 f8e07a2ac015ecd0b4772795d20272f5 ChangeLog 85203
-RMD160 723b2ed07ca08c591dea6a40273252e9289bae6e ChangeLog 85203
-SHA256 0b0a5db8e6f6623e723c8f996b75656de00c3f5579a41c85d7c53fd481b59c8a ChangeLog 85203
+EBUILD baselayout-1.13.0_alpha9-r3.ebuild 9981 RMD160 a1a817145f97b028f2cea526301969c4d15d6ba5 SHA1 085af3429587b76cbc4271534fe9d5a6f2eac2cb SHA256 24c11f85edf89064064b6654fceb6b91c0e4adb0cffee4d0eaab1fd43b999bd9
+MD5 29d58ca7a5b103d70d3b09826f38d944 baselayout-1.13.0_alpha9-r3.ebuild 9981
+RMD160 a1a817145f97b028f2cea526301969c4d15d6ba5 baselayout-1.13.0_alpha9-r3.ebuild 9981
+SHA256 24c11f85edf89064064b6654fceb6b91c0e4adb0cffee4d0eaab1fd43b999bd9 baselayout-1.13.0_alpha9-r3.ebuild 9981
+MISC ChangeLog 85439 RMD160 d03c7d0ef88da8ff5d1f33bb19f2a800c5d198ad SHA1 c923458e76d49097e0c743b85a097d092bbfabc9 SHA256 14aab6b1c512f0d00aa43b302db4f725f6b0a0e83ab353d8d39eeb17a876ba5c
+MD5 826218aa16e3cc08c40f27d83be9a52c ChangeLog 85439
+RMD160 d03c7d0ef88da8ff5d1f33bb19f2a800c5d198ad ChangeLog 85439
+SHA256 14aab6b1c512f0d00aa43b302db4f725f6b0a0e83ab353d8d39eeb17a876ba5c ChangeLog 85439
 MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 metadata.xml 164
index 96b8cc79f326790515836659358c2d924609df82..fe7f3e09c4042fbe35a035c92733c085a654ea5e 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.13.0_alpha9-r3.ebuild,v 1.1 2006/12/14 12:33:01 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.13.0_alpha9-r3.ebuild,v 1.2 2006/12/19 16:27:02 uberlord Exp $
 
 inherit flag-o-matic eutils toolchain-funcs multilib
 
@@ -42,8 +42,6 @@ src_unpack() {
        unpack ${A}
        cd "${S}"
 
-       epatch "${FILESDIR}/${P}"-ifconfig.patch
-
        # Setup unicode defaults for silly unicode users
        if use unicode ; then
                sed -i -e '/^UNICODE=/s:no:yes:' etc/rc.conf
@@ -155,10 +153,6 @@ pkg_postinst() {
        fi
 
        if use kernel_linux ; then
-               # Ensure the new volumes init script is in the boot runlevel
-               if [[ ! -e ${ROOT}etc/runlevels/boot/volumes ]] ; then
-                       ln -s ../../init.d/volumes "${ROOT}"etc/runlevels/boot
-               fi
                if use build || use bootstrap ; then
                        # Create base directories
                        if [[ ! -e ${ROOT}/dev/.udev && ! -e ${ROOT}/dev/.devfsd ]] ; then
@@ -180,25 +174,23 @@ pkg_postinst() {
                cp -p "${ROOT}usr/share/baselayout/${x}" ${ROOT}etc
        done
 
-       # Reload init to fix unmounting problems of / on next reboot.
-       # This is really needed, as without the new version of init cause init
-       # not to quit properly on reboot, and causes a fsck of / on next reboot.
-       if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
-               # We need to copy svcdir if it's empty
-               if [[ ! -e ${ROOT}lib/rcscripts/init.d/deptree ]] ; then
-                       (
-                       source "${ROOT}etc/conf.d/rc"
-                       svcdir="${svcdir:-/var/lib/init.d}"
-                       if [[ -e ${ROOT}${svcdir}/deptree ]] ; then
-                               cp -RPp "${ROOT}${svcdir}"/* ${ROOT}lib/rcscripts/init.d
-                       fi
-                       )
+       # We need to copy svcdir if upgrading
+       if has_version "<sys-apps/${PN}-1.13.0_alpha" ; then
+               (
+               source "${ROOT}etc/conf.d/rc"
+               svcdir="${svcdir:-/var/lib/init.d}"
+               einfo "Moving state from ${ROOT}${svcdir} to ${ROOT}lib/rcscripts/init.d"
+               cp -RPp "${ROOT}${svcdir}"/* "${ROOT}"lib/rcscripts/init.d
+               )
+               # Install our new init script and mark it started
+               if use kernel_linux ; then
+                       ln -snf ../../init.d/volumes "${ROOT}"etc/runlevels/boot
+                       ln -snf /etc/init.d/volumes "${ROOT}"lib/rcscripts/init.d/started
                fi
+       fi
 
-               # Regenerate init.d dependency tree
+       if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
                /sbin/depscan.sh --update >/dev/null
-       else
-               rm -f "${ROOT}"/etc/modules.conf
        fi
 
        # This is also written in src_install (so it's in CONTENTS), but
@@ -274,13 +266,22 @@ pkg_postinst() {
        einfo "${lo}. So if you need to restart a net script that is listed in the"
        einfo "runlevel you are in and not restart anything that needs it then you"
        einfo "will need to use the --nodeps command line option."
+}
 
-       echo
-       ewarn "baselayout-1.13 and higher now force \$svcdir to be mounted ramdisk."
-       ewarn "If you downgrade to a lower version you'll need to copy the directory"
-       ewarn "  /$(get_libdir)/rcscripts/init.d"
-       ewarn "to \$svcdir as defined in /etc/conf.d/rc"
-       ewarn "  /var/lib/init.d (by default)"
-       ewarn "You should also erase /$(get_libdir)/rcscripts/init.d so that when you upgrade"
-       ewarn "again your current state is automatically copied across."
+# Handle our downgraders
+# We should remove this when <1.13 has been removed from the tree
+pkg_postrm() {
+       # Remove dir if downgrading
+       if has_version "<sys-apps/${PN}-1.13.0_alpha" ; then
+               (
+               source "${ROOT}etc/conf.d/rc"
+               svcdir="${svcdir:-/var/lib/init.d}"
+               einfo "Moving state from ${ROOT}lib/rcscripts/init.d to ${ROOT}${svcdir}"
+               mkdir -p "${ROOT}${svcdir}"
+               cp -RPp "${ROOT}lib/rcscripts/init.d"/* "${ROOT}${svcdir}"
+               umount "${ROOT}lib/rcscripts/init.d" 2>/dev/null
+               rm -rf "${ROOT}lib/rcscripts/init.d"
+               )
+               ewarn "You will need to re-emerge ${PN} to restore ${ROOT}etc/init.d/net.lo"
+       fi
 }