sys-libs/timezone-data: Apply CoreOS changes

Recreate the old posix symlink for compatibility, and drop all the
pkg functions that maintain /etc/localtime since we default to UTC.
This commit is contained in:
David Michael 2018-10-22 20:56:19 +00:00
parent f1f2b3111b
commit b722154c3f
2 changed files with 5 additions and 77 deletions

View File

@ -1,4 +1,4 @@
DEFINED_PHASES=compile config configure install postinst preinst prepare test DEFINED_PHASES=compile configure install prepare test
DEPEND=nls? ( virtual/libintl ) DEPEND=nls? ( virtual/libintl )
DESCRIPTION=Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdump) DESCRIPTION=Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdump)
EAPI=6 EAPI=6
@ -10,4 +10,4 @@ RDEPEND=nls? ( virtual/libintl ) !sys-libs/glibc[vanilla(+)]
SLOT=0 SLOT=0
SRC_URI=http://www.iana.org/time-zones/repository/releases/tzdata2018e.tar.gz http://www.iana.org/time-zones/repository/releases/tzcode2018e.tar.gz SRC_URI=http://www.iana.org/time-zones/repository/releases/tzdata2018e.tar.gz http://www.iana.org/time-zones/repository/releases/tzcode2018e.tar.gz
_eclasses_=desktop b1d22ac8bdd4679ab79c71aca235009d epatch a1bf4756dba418a7238f3be0cb010c54 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 6e6c2737b59a4b982de6fb3ecefd87f8 flag-o-matic 55aaa148741116aa54ad0d80e361818e ltprune 08f9e1d9ee0af8f5d9a7854efbcd8c0e multilib b2f01ad412baf81650c23fcf0975fa33 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs f164325a2cdb5b3ea39311d483988861 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf _eclasses_=desktop b1d22ac8bdd4679ab79c71aca235009d epatch a1bf4756dba418a7238f3be0cb010c54 estack 43ddf5aaffa7a8d0482df54d25a66a1f eutils 6e6c2737b59a4b982de6fb3ecefd87f8 flag-o-matic 55aaa148741116aa54ad0d80e361818e ltprune 08f9e1d9ee0af8f5d9a7854efbcd8c0e multilib b2f01ad412baf81650c23fcf0975fa33 preserve-libs ef207dc62baddfddfd39a164d9797648 toolchain-funcs f164325a2cdb5b3ea39311d483988861 vcs-clean 2a0f74a496fa2b1552c4f3398258b7bf
_md5_=f232d6c6f6c2c38aa5d82991fa318711 _md5_=151a11dcda86d01d9551c03c7294ea6f

View File

@ -91,79 +91,7 @@ src_install() {
# Delete man pages installed by man-pages package. # Delete man pages installed by man-pages package.
rm "${ED}"/usr/share/man/man5/tzfile.5* "${ED}"/usr/share/man/man8/{tzselect,zdump,zic}.8 || die rm "${ED}"/usr/share/man/man5/tzfile.5* "${ED}"/usr/share/man/man8/{tzselect,zdump,zic}.8 || die
dodoc CONTRIBUTING README NEWS *.html dodoc CONTRIBUTING README NEWS *.html
}
# install the symlink by hand to not break existing timezones
get_TIMEZONE() { dosym . /usr/share/zoneinfo/posix
local tz src="${EROOT}etc/timezone"
if [[ -e ${src} ]] ; then
tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
else
tz="FOOKABLOIE"
fi
[[ -z ${tz} ]] && return 1 || echo "${tz}"
}
pkg_preinst() {
local tz=$(get_TIMEZONE)
if [[ ${tz} == right/* || ${tz} == posix/* ]] ; then
eerror "The right & posix subdirs are no longer installed as subdirs -- they have been"
eerror "relocated to match upstream paths as sibling paths. Further, posix/xxx is the"
eerror "same as xxx, so you should simply drop the posix/ prefix. You also should not"
eerror "be using right/xxx for the system timezone as it breaks programs."
die "Please fix your timezone setting"
fi
# Trim the symlink by hand to avoid portage's automatic protection checks.
rm -f "${EROOT}"/usr/share/zoneinfo/posix
if has_version "<=${CATEGORY}/${PN}-2015c" ; then
elog "Support for accessing posix/ and right/ directly has been dropped to match"
elog "upstream. There is no need to set TZ=posix/xxx as it is the same as TZ=xxx."
elog "For TZ=right/, you can use TZ=../zoneinfo-leaps/xxx instead. See this post"
elog "for details: https://mm.icann.org/pipermail/tz/2015-February/022024.html"
fi
}
configure_tz_data() {
# 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
if ! tz=$(get_TIMEZONE) ; then
einfo "Assuming your empty ${etc_lt} file is what you want; skipping update."
return 0
fi
if [[ ${tz} == "FOOKABLOIE" ]] ; then
elog "You do not have TIMEZONE set in ${src}."
if [[ ! -e ${etc_lt} ]] ; then
cp -f "${EROOT}"/usr/share/zoneinfo/Factory "${etc_lt}"
elog "Setting ${etc_lt} to Factory."
else
elog "Skipping auto-update of ${etc_lt}."
fi
return 0
fi
if [[ ! -e ${EROOT}/usr/share/zoneinfo/${tz} ]] ; then
elog "You have an invalid TIMEZONE setting in ${src}"
elog "Your ${etc_lt} has been reset to Factory; enjoy!"
tz="Factory"
fi
einfo "Updating ${etc_lt} with ${EROOT}usr/share/zoneinfo/${tz}"
cp -f "${EROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}"
}
pkg_config() {
configure_tz_data
}
pkg_postinst() {
configure_tz_data
} }