diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-12-07 09:09:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-12-07 09:09:26 +0000 |
commit | d0660783b69248a5354fd71c0c35943bb7ebfbb5 (patch) | |
tree | e8a1afc9e8795d1907083c6ab90fa46b6236e2c2 | |
parent | Version bump, thanks Kacper Kowalik for his initial work. (diff) | |
download | gentoo-2-d0660783b69248a5354fd71c0c35943bb7ebfbb5.tar.gz gentoo-2-d0660783b69248a5354fd71c0c35943bb7ebfbb5.tar.bz2 gentoo-2-d0660783b69248a5354fd71c0c35943bb7ebfbb5.zip |
Migrate hostname by default to avoid default thrashing on conf.d/hostname #295406 by Martin Mokrejš. Also delay automatic dep tree update till after we are done screwing with /etc.
(Portage version: 2.2_rc55/cvs/Linux x86_64)
-rw-r--r-- | sys-apps/openrc/ChangeLog | 8 | ||||
-rw-r--r-- | sys-apps/openrc/openrc-0.5.3.ebuild | 19 | ||||
-rw-r--r-- | sys-apps/openrc/openrc-9999.ebuild | 19 |
3 files changed, 37 insertions, 9 deletions
diff --git a/sys-apps/openrc/ChangeLog b/sys-apps/openrc/ChangeLog index 4269ac9b90ca..796d2a500ab0 100644 --- a/sys-apps/openrc/ChangeLog +++ b/sys-apps/openrc/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-apps/openrc # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.100 2009/12/06 19:00:43 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/ChangeLog,v 1.101 2009/12/07 09:09:26 vapier Exp $ + + 07 Dec 2009; Mike Frysinger <vapier@gentoo.org> openrc-0.5.3.ebuild, + openrc-9999.ebuild: + Migrate hostname by default to avoid default thrashing on conf.d/hostname + #295406 by Martin Mokrejš. Also delay automatic dep tree update till + after we are done screwing with /etc. 06 Dec 2009; William Hubbs <williamh@gentoo.org> -openrc-0.5.2-r2.ebuild, -files/openrc-0.5.2-dont-wipe-wtmp.patch, diff --git a/sys-apps/openrc/openrc-0.5.3.ebuild b/sys-apps/openrc/openrc-0.5.3.ebuild index 5d3530d7a0d9..619d490cdd05 100644 --- a/sys-apps/openrc/openrc-0.5.3.ebuild +++ b/sys-apps/openrc/openrc-0.5.3.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.5.3.ebuild,v 1.1 2009/12/02 23:42:29 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.5.3.ebuild,v 1.2 2009/12/07 09:09:26 vapier Exp $ EAPI="1" @@ -170,9 +170,20 @@ pkg_preinst() { # file in the CONTENTS for binary packages. [[ -e ${ROOT}/etc/conf.d/net ]] && cp "${ROOT}"/etc/conf.d/net "${D}"/etc/conf.d/ + # avoid default thrashing in conf.d files when possible #295406 + if [[ -e ${ROOT}/etc/conf.d/hostname ]] ; then + ( + unset hostname HOSTNAME + source "${ROOT}"/etc/conf.d/hostname + : ${hostname:=${HOSTNAME}} + [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}" + ) + fi + # upgrade timezone file ... do it before moving clock if [[ -e ${ROOT}/etc/conf.d/clock && ! -e ${ROOT}/etc/timezone ]] ; then ( + unset TIMEZONE source "${ROOT}"/etc/conf.d/clock [[ -n ${TIMEZONE} ]] && echo "${TIMEZONE}" > "${ROOT}"/etc/timezone ) @@ -347,9 +358,6 @@ pkg_postinst() { fi fi - # update the dependency tree bug #224171 - [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u - # /etc/conf.d/net.example is no longer valid local NET_EXAMPLE="${ROOT}/etc/conf.d/net.example" local NET_MD5='8ebebfa07441d39eb54feae0ee4c8210' @@ -385,6 +393,9 @@ pkg_postinst() { ewarn "your files to /etc/conf.d/modules and delete the directory." fi + # update the dependency tree after touching all files #224171 + [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u + elog "You should now update all files in /etc, using etc-update" elog "or equivalent before restarting any services or this host." elog diff --git a/sys-apps/openrc/openrc-9999.ebuild b/sys-apps/openrc/openrc-9999.ebuild index d6796f345f65..db8409469bab 100644 --- a/sys-apps/openrc/openrc-9999.ebuild +++ b/sys-apps/openrc/openrc-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-9999.ebuild,v 1.65 2009/11/13 19:40:33 zzam Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-9999.ebuild,v 1.66 2009/12/07 09:09:26 vapier Exp $ EAPI="1" @@ -170,9 +170,20 @@ pkg_preinst() { # file in the CONTENTS for binary packages. [[ -e ${ROOT}/etc/conf.d/net ]] && cp "${ROOT}"/etc/conf.d/net "${D}"/etc/conf.d/ + # avoid default thrashing in conf.d files when possible #295406 + if [[ -e ${ROOT}/etc/conf.d/hostname ]] ; then + ( + unset hostname HOSTNAME + source "${ROOT}"/etc/conf.d/hostname + : ${hostname:=${HOSTNAME}} + [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}" + ) + fi + # upgrade timezone file ... do it before moving clock if [[ -e ${ROOT}/etc/conf.d/clock && ! -e ${ROOT}/etc/timezone ]] ; then ( + unset TIMEZONE source "${ROOT}"/etc/conf.d/clock [[ -n ${TIMEZONE} ]] && echo "${TIMEZONE}" > "${ROOT}"/etc/timezone ) @@ -347,9 +358,6 @@ pkg_postinst() { fi fi - # update the dependency tree bug #224171 - [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u - # /etc/conf.d/net.example is no longer valid local NET_EXAMPLE="${ROOT}/etc/conf.d/net.example" local NET_MD5='8ebebfa07441d39eb54feae0ee4c8210' @@ -385,6 +393,9 @@ pkg_postinst() { ewarn "your files to /etc/conf.d/modules and delete the directory." fi + # update the dependency tree after touching all files #224171 + [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u + elog "You should now update all files in /etc, using etc-update" elog "or equivalent before restarting any services or this host." elog |