diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-08-21 20:16:36 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-08-21 20:16:36 -0400 |
commit | 59491564457b11aa864a36444797e9c9dfb59047 (patch) | |
tree | 80826d4b3b4ff3b1f6da0bb3d3c6a09879c470c7 /sys-libs/timezone-data | |
parent | dev-libs/mpfr: version bump. (diff) | |
download | gentoo-59491564457b11aa864a36444797e9c9dfb59047.tar.gz gentoo-59491564457b11aa864a36444797e9c9dfb59047.tar.bz2 gentoo-59491564457b11aa864a36444797e9c9dfb59047.zip |
sys-libs/timezone-data: short circuit config step when /etc/localtime is a symlink #511474
The code path already does nothing whenever /etc/localtime is a symlink,
so deleting the different ways we message the user in favor a shortcut
at the start should be fine. It also means you don't get misleading
messages when running systemd.
Diffstat (limited to 'sys-libs/timezone-data')
-rw-r--r-- | sys-libs/timezone-data/timezone-data-2015f.ebuild | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sys-libs/timezone-data/timezone-data-2015f.ebuild b/sys-libs/timezone-data/timezone-data-2015f.ebuild index 0ba79099f6b0..fdeb5231eeed 100644 --- a/sys-libs/timezone-data/timezone-data-2015f.ebuild +++ b/sys-libs/timezone-data/timezone-data-2015f.ebuild @@ -106,19 +106,20 @@ pkg_config() { # make sure the /etc/localtime file does not get stale #127899 local tz src="${EROOT}etc/timezone" etc_lt="${EROOT}etc/localtime" + # If it's a symlink, assume the user knows what they're doing and + # they're managing it themselves. #511474 + if [[ -L ${etc_lt} ]] ; then + einfo "Assuming your ${etc_lt} symlink is what you want; skipping update." + return 0 + fi + tz=$(get_TIMEZONE) || return 0 if [[ ${tz} == "FOOKABLOIE" ]] ; then elog "You do not have TIMEZONE set in ${src}." 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 "${EROOT}"/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 + cp -f "${EROOT}"/usr/share/zoneinfo/Factory "${etc_lt}" + elog "Setting ${etc_lt} to Factory." else elog "Skipping auto-update of ${etc_lt}." fi @@ -130,12 +131,8 @@ pkg_config() { elog "Your ${etc_lt} has been reset to Factory; enjoy!" tz="Factory" fi - if [[ -L ${etc_lt} ]]; then - einfo "Skipping symlinked ${etc_lt}" - else - einfo "Updating ${etc_lt} with ${EROOT}usr/share/zoneinfo/${tz}" - cp -f "${EROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}" - fi + einfo "Updating ${etc_lt} with ${EROOT}usr/share/zoneinfo/${tz}" + cp -f "${EROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}" } pkg_postinst() { |