From 43bd80a4405d1806152920e4ad2608b1ea8797af Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 8 Nov 2022 18:04:26 +0100 Subject: setup-timezone: fix listing of sub-timezones fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10538 --- setup-timezone.in | 2 +- tests/setup_timezone_test | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/setup-timezone.in b/setup-timezone.in index ae7d141..01a5e37 100644 --- a/setup-timezone.in +++ b/setup-timezone.in @@ -29,7 +29,7 @@ show_tz_list() { local path="$zroot/$1" [ -d "$path" ] || return 1 - for i in $(find $path -maxdepth 1); do + for i in $(find $path/ -maxdepth 1); do case $i in *.tab|*/) continue;; esac diff --git a/tests/setup_timezone_test b/tests/setup_timezone_test index 93eb137..391760d 100755 --- a/tests/setup_timezone_test +++ b/tests/setup_timezone_test @@ -7,6 +7,7 @@ init_tests \ setup_timezone_install \ setup_timezone_z_compat \ setup_timezone_none \ + setup_timezone_interactive setup_timezone_usage_body() { test_usage setup-timezone @@ -54,3 +55,18 @@ setup_timezone_none_body() { setup-timezone none } +setup_timezone_interactive_body() { + init_env + mkdir -p usr/share/zoneinfo/Europe + touch usr/share/zoneinfo/Europe/Oslo + ( echo "Europe" + echo "?" + echo "Oslo" + ) > answers + atf_check -s exit:0 \ + -o match:"apk add .*tzdata" \ + -o match:"apk del" \ + -e empty \ + setup-timezone < answers +} + -- cgit v1.2.3