From 5e8175705911c1daf54d527b93c2c304afd3c507 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 1 Jul 2022 11:43:27 +0200 Subject: setup-timezone: exit if 'none' is set as timezone --- setup-timezone.in | 4 ++++ tests/setup_timezone_test | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/setup-timezone.in b/setup-timezone.in index 4f056b4..5c5b139 100644 --- a/setup-timezone.in +++ b/setup-timezone.in @@ -77,6 +77,10 @@ if [ -z "$ZONE" ]; then ZONE="$1" fi +if [ "$ZONE" = "none" ]; then + exit 0 +fi + if $INSTALL_TZDATA; then pkg=tzdata apkdel= diff --git a/tests/setup_timezone_test b/tests/setup_timezone_test index e6bc402..93eb137 100755 --- a/tests/setup_timezone_test +++ b/tests/setup_timezone_test @@ -5,7 +5,8 @@ init_tests \ setup_timezone_usage \ setup_timezone_copy \ setup_timezone_install \ - setup_timezone_z_compat + setup_timezone_z_compat \ + setup_timezone_none \ setup_timezone_usage_body() { test_usage setup-timezone @@ -45,3 +46,11 @@ setup_timezone_z_compat_body() { setup-timezone -z Europe/Oslo } +setup_timezone_none_body() { + init_env + atf_check -s exit:0 \ + -o empty \ + -e empty \ + setup-timezone none +} + -- cgit v1.2.3