Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
a99a572b
Unverified
Commit
a99a572b
authored
Jan 20, 2024
by
Earle F. Philhower, III
Committed by
GitHub
Jan 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TZ.h database, borrowed from ESP8266 core (#1947)
parent
7ce7dde0
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
540 additions
and
0 deletions
+540
-0
cores/rp2040/TZ.h
cores/rp2040/TZ.h
+474
-0
tools/tzupdate.sh
tools/tzupdate.sh
+66
-0
No files found.
cores/rp2040/TZ.h
0 → 100644
View file @
a99a572b
This diff is collapsed.
Click to expand it.
tools/tzupdate.sh
0 → 100755
View file @
a99a572b
#!/bin/sh
# this shell script refreshes world timezone definitions in
# cores/rp2040/TZ.h
#
# to run it, use:
# /path/to/TZupdate.sh
# tools/TZupdate.sh
# ./TZupdate.sh
dir
=
$(
cd
${
0
%/*
}
2>/dev/null
;
pwd
)
base
=
${
0
##*/
}
csv
=
https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
set
-e
tz_tmpdir
=
$(
mktemp
-d
)
trap
'rm -r $tz_tmpdir'
EXIT
input
=
$tz_tmpdir
/zones.csv
names
=
$tz_tmpdir
/names.txt
values
=
$tz_tmpdir
/values.txt
wget
-O
$input
$csv
||
curl
$csv
>
$input
sed
-e
's/^[^,]*,//g'
-e
's,^,(,g'
-e
's,$,),g'
<
$input
>
$values
sed
-e
's/^\([^,]*\),.*/#define TZ_\1/g'
-e
's,["],,g'
<
$input
|
tr
'/\-+'
'_mp'
>
$names
(
cat
<<
EOF
// autogenerated from
$csv
// by script <rp2040 arduino core>/tools/
${
base
}
//
$(
date
-u
)
//
// This database is autogenerated from IANA timezone database
//
${
csv
}
// (using https://www.iana.org/time-zones)
// and can be updated on demand in this repository
// or by yourself using the above script
#pragma once
EOF
paste
$names
$values
)
>
$tz_tmpdir
/TZ.h
backup
=
$(
date
+%s
)
mv
${
dir
}
/../cores/rp2040/TZ.h
${
dir
}
/../cores/rp2040/TZ.h.
$backup
mv
$tz_tmpdir
/TZ.h
${
dir
}
/../cores/rp2040/TZ.h
cat
<<
EOF
Done:
'
${
dir
}
/../cores/rp2040/TZ.h' is updated
Diff:
----8<-------8<------8<---
$(
diff
-u
${
dir
}
/../cores/rp2040/TZ.h.
$backup
${
dir
}
/../cores/rp2040/TZ.h
)
--->8----->8------>8------
EOF
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