commit:     b41ddc85a7b6a3e010ce27e6b0ae57d0121b01e3
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 17 01:54:21 2025 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Feb 17 21:24:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b41ddc85

sys-libs/timezone-data: simplify code to read /etc/timezone

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-libs/timezone-data/timezone-data-2025a.ebuild | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/sys-libs/timezone-data/timezone-data-2025a.ebuild 
b/sys-libs/timezone-data/timezone-data-2025a.ebuild
index 2a4457e2c0fe..46dd58e0f15d 100644
--- a/sys-libs/timezone-data/timezone-data-2025a.ebuild
+++ b/sys-libs/timezone-data/timezone-data-2025a.ebuild
@@ -107,17 +107,6 @@ src_install() {
        dodoc CONTRIBUTING README NEWS *.html
 }
 
-get_TIMEZONE() {
-       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}"
-}
-
 configure_tz_data() {
        # Make sure the /etc/localtime file does not get stale, bug #127899
        local tz src="${EROOT}/etc/timezone" etc_lt="${EROOT}/etc/localtime"
@@ -129,13 +118,15 @@ configure_tz_data() {
                return 0
        fi
 
-       if ! tz=$(get_TIMEZONE) ; then
-               einfo "Assuming your empty ${src} file is what you want; 
skipping update."
+       if [[ ! -e ${src} ]] ; then
+               einfo "You do not have a timezone set in ${src}; skipping 
update."
                return 0
        fi
 
-       if [[ "${tz}" == "FOOKABLOIE" ]] ; then
-               einfo "You do not have a timezone set in ${src}; skipping 
update."
+       tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
+
+       if [[ -z ${tz} ]]; then
+               einfo "Assuming your empty ${src} file is what you want; 
skipping update."
                return 0
        fi
 

Reply via email to