diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-01 11:43:27 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-01 10:15:32 +0000 |
commit | 5e8175705911c1daf54d527b93c2c304afd3c507 (patch) | |
tree | 5e02a9037a26181ee2c945f5380a695a1bed9c6d | |
parent | a2b37feaf807b0c8773d41a4157d733328557386 (diff) | |
download | alpine-conf-5e8175705911c1daf54d527b93c2c304afd3c507.zip |
setup-timezone: exit if 'none' is set as timezone
-rw-r--r-- | setup-timezone.in | 4 | ||||
-rwxr-xr-x | tests/setup_timezone_test | 11 |
2 files changed, 14 insertions, 1 deletions
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 +} + |