summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-11-08 18:04:26 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-11-08 17:05:45 +0000
commit43bd80a4405d1806152920e4ad2608b1ea8797af (patch)
tree6f26eeed3af7eb75f6b5937fc8952fd3929acc6c
parentc9391c7f47a81703460dc309da7d1e75ebfe6963 (diff)
downloadalpine-conf-43bd80a4405d1806152920e4ad2608b1ea8797af.zip
setup-timezone: fix listing of sub-timezones
fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10538
-rw-r--r--setup-timezone.in2
-rwxr-xr-xtests/setup_timezone_test16
2 files changed, 17 insertions, 1 deletions
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
+}
+