diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-03-27 06:06:27 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-03-27 06:06:27 +0000 |
commit | 8d5dbd847cbc704a6a06405856e94b461011afe3 (patch) | |
tree | 4d26462d027b14926335894749d2e01d982234d0 /sys-libs/timezone-data/timezone-data-2021a.ebuild | |
parent | 5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 (diff) |
gentoo resync : 27.03.2021
Diffstat (limited to 'sys-libs/timezone-data/timezone-data-2021a.ebuild')
-rw-r--r-- | sys-libs/timezone-data/timezone-data-2021a.ebuild | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/sys-libs/timezone-data/timezone-data-2021a.ebuild b/sys-libs/timezone-data/timezone-data-2021a.ebuild index 52f5fbdca3bd..b7dce14ae8a4 100644 --- a/sys-libs/timezone-data/timezone-data-2021a.ebuild +++ b/sys-libs/timezone-data/timezone-data-2021a.ebuild @@ -150,28 +150,39 @@ configure_tz_data() { fi if ! tz=$(get_TIMEZONE) ; then - einfo "Assuming your empty ${etc_lt} file is what you want; skipping update." + einfo "Assuming your empty ${src} 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 + if [[ "${tz}" == "FOOKABLOIE" ]] ; then + einfo "You do not have a timezone set in ${src}; skipping update." 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" + local tzpath="${EROOT}/usr/share/zoneinfo/${tz}" + + if [[ ! -e ${tzpath} ]]; then + ewarn "The timezone specified in ${src} is not valid." + return 1 + fi + + if [[ -f ${etc_lt} ]]; then + # If a regular file already exists, copy over it. + ewarn "Found a regular file at ${etc_lt}." + ewarn "Some software may expect a symlink instead." + ewarn "You may convert it to a symlink by removing the file and running:" + ewarn " emerge --config sys-libs/timezone-data" + einfo "Copying ${tzpath} to ${etc_lt}." + cp -f "${tzpath}" "${etc_lt}" + else + # Otherwise, create a symlink and remove the timezone file. + tzpath="../usr/share/zoneinfo/${tz}" + einfo "Linking ${tzpath} at ${etc_lt}." + if ln -snf "${tzpath}" "${etc_lt}"; then + einfo "Removing ${src}." + rm -f "${src}" + fi fi - einfo "Updating ${etc_lt} with ${EROOT}/usr/share/zoneinfo/${tz}" - cp -f "${EROOT}/usr/share/zoneinfo/${tz}" "${etc_lt}" } pkg_config() { |