Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
5690826e
Commit
5690826e
authored
Apr 23, 2014
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-timezone: use /usr/zoneinfo/localtime instead of /etc/TZ
musl uses /etc/zoneinfo/localtime ref #927 fixes
#2867
parent
4b2f418d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
19 deletions
+7
-19
setup-timezone.in
setup-timezone.in
+7
-19
No files found.
setup-timezone.in
View file @
5690826e
...
...
@@ -37,9 +37,9 @@ show_tz_list() {
(
cd
$path
&&
ls
--color
=
never
-Cd
$z
)
}
valid
_tz
()
{
find
$zroot
-type
f
-a
-not
-name
'*.tab'
-a
-not
-name
'Factory'
\
| xargs posixtz |
sort
|
uniq
|
grep
-q
-w
"
$1
"
setup
_tz
()
{
mkdir
-p
"
${
ROOT
}
"
etc/zoneinfo
cp
"
$1
"
"
${
ROOT
}
"
etc/zoneinfo/localtime
}
while
getopts
"hz:"
opt
;
do
...
...
@@ -53,15 +53,11 @@ if ! apk info --quiet --installed tzdata; then
apk add
--quiet
tzdata
&&
apkdel
=
"tzdata"
||
exit
1
fi
zonepath
=
$(
cat
/etc/TZ 2>/dev/null
)
[
-z
"
$zonepath
"
]
&&
zonepath
=
"UTC"
zonepath
=
UTC
while
true
;
do
if
[
-n
"
$ZONEINFODIR
"
]
;
then
TZ
=
$(
posixtz
"
$ZONEINFODIR
"
)
||
echo
"Failed to convert '
$ZONEINFODIR
' to POSIX TZ"
if
[
-n
"
$TZ
"
]
;
then
echo
$TZ
>
/etc/TZ
||
rm
-f
/etc/TZ
fi
setup_tz
"
$ZONEINFODIR
"
break
fi
...
...
@@ -82,16 +78,8 @@ while true; do
zonepath
=
"
$zonepath
/
$zone
"
done
TZ
=
if
valid_tz
"
$zonepath
"
;
then
TZ
=
"
$zonepath
"
elif
[
-f
"
$zroot
/
$zonepath
"
]
;
then
TZ
=
$(
posixtz
"
$zroot
/
$zonepath
"
)
\
||
echo
"Failed to convert '
$zroot
/
$zonepath
' to POSIX TZ"
fi
if
[
-n
"
$TZ
"
]
;
then
echo
$TZ
>
/etc/TZ
||
rm
-f
/etc/TZ
if
[
-f
"
$zroot
/
$zonepath
"
]
;
then
setup_tz
"
$zroot
/
$zonepath
"
break
fi
echo
"'
$zonepath
' is not a valid timezone on this system"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment