diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-10-19 20:12:23 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-10-19 20:12:23 +0000 |
commit | da4beb8067b66a3ec2a263dadb2b3ff29d9f2aa9 (patch) | |
tree | 77be102a0f12c08d0bdd76adbeefe010cff42367 /sys-libs/timezone-data/timezone-data-2011k.ebuild | |
parent | Stabilize for everyone. (diff) | |
download | gentoo-2-da4beb8067b66a3ec2a263dadb2b3ff29d9f2aa9.tar.gz gentoo-2-da4beb8067b66a3ec2a263dadb2b3ff29d9f2aa9.tar.bz2 gentoo-2-da4beb8067b66a3ec2a263dadb2b3ff29d9f2aa9.zip |
If /etc/localtime is a broken symlink, and /etc/timezone does not exist, assume the user is maintaining their own thing and leave /etc/localtime alone.
(Portage version: 2.2.0_alpha65/cvs/Linux x86_64)
Diffstat (limited to 'sys-libs/timezone-data/timezone-data-2011k.ebuild')
-rw-r--r-- | sys-libs/timezone-data/timezone-data-2011k.ebuild | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sys-libs/timezone-data/timezone-data-2011k.ebuild b/sys-libs/timezone-data/timezone-data-2011k.ebuild index 0732fc3e98b4..b6c2aea5749b 100644 --- a/sys-libs/timezone-data/timezone-data-2011k.ebuild +++ b/sys-libs/timezone-data/timezone-data-2011k.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/timezone-data/timezone-data-2011k.ebuild,v 1.2 2011/10/07 15:23:20 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/timezone-data/timezone-data-2011k.ebuild,v 1.3 2011/10/19 20:12:23 vapier Exp $ inherit eutils toolchain-funcs flag-o-matic @@ -66,7 +66,7 @@ src_install() { pkg_config() { # make sure the /etc/localtime file does not get stale #127899 - local tz src + local tz src etc_lt="${ROOT}etc/localtime" if has_version '<sys-apps/baselayout-2' ; then src="${ROOT}etc/conf.d/clock" @@ -84,23 +84,29 @@ pkg_config() { if [[ ${tz} == "FOOKABLOIE" ]] ; then elog "You do not have TIMEZONE set in ${src}." - if [[ ! -e ${ROOT}/etc/localtime ]] ; then - cp -f "${ROOT}"/usr/share/zoneinfo/Factory "${ROOT}"/etc/localtime - elog "Setting ${ROOT}etc/localtime to Factory." + if [[ ! -e ${etc_lt} ]] ; then + # if /etc/localtime is a symlink somewhere, assume they + # know what they're doing and they're managing it themselves + if [[ ! -L ${etc_lt} ]] ; then + cp -f "${ROOT}"/usr/share/zoneinfo/Factory "${etc_lt}" + elog "Setting ${etc_lt} to Factory." + else + elog "Assuming your ${etc_lt} symlink is what you want; skipping update." + fi else - elog "Skipping auto-update of ${ROOT}etc/localtime." + elog "Skipping auto-update of ${etc_lt}." fi return 0 fi if [[ ! -e ${ROOT}/usr/share/zoneinfo/${tz} ]] ; then elog "You have an invalid TIMEZONE setting in ${src}" - elog "Your ${ROOT}etc/localtime has been reset to Factory; enjoy!" + elog "Your ${etc_lt} has been reset to Factory; enjoy!" tz="Factory" fi - einfo "Updating ${ROOT}etc/localtime with ${ROOT}usr/share/zoneinfo/${tz}" - [[ -L ${ROOT}/etc/localtime ]] && rm -f "${ROOT}"/etc/localtime - cp -f "${ROOT}"/usr/share/zoneinfo/"${tz}" "${ROOT}"/etc/localtime + einfo "Updating ${etc_lt} with ${ROOT}usr/share/zoneinfo/${tz}" + [[ -L ${etc_lt} ]] && rm -f "${etc_lt}" + cp -f "${ROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}" } pkg_postinst() { |