davical/zonedb/update-tzdata.sh
Andrew Ruthven b15e320fb7 Fix up update-tzdata.sh so it'll run
On my Debian Sid system, the readlink commands return the empty string.
Given we use these as output files and the files to fetch, I figure
that using hardcoded names is better.
2021-01-24 23:23:58 +13:00

27 lines
646 B
Bash
Executable File

#!/bin/sh
set -e
TZCODEFILE="tzcode-latest.tar.gz"
TZDATAFILE="tzdata-latest.tar.gz"
# if [ ! -f $TZCODEFILE ]; then
(
wget --continue -O $TZCODEFILE 'ftp://ftp.iana.org/tz/'$TZCODEFILE
rm -rf tzcode
mkdir -p tzcode && cd tzcode && tar -xzf ../$TZCODEFILE
)
# fi
# if [ ! -f $TZDATAFILE ]; then
(
wget --continue -O $TZDATAFILE 'ftp://ftp.iana.org/tz/'$TZDATAFILE
rm -rf tzdata
mkdir -p tzdata && cd tzdata && tar -xzf ../$TZDATAFILE
)
# fi
# From: https://github.com/libical/vzic
vzic --pure --olson-dir tzdata --output-dir vtimezones
echo "Olson `echo $TZDATAFILE | cut -f1 -d.`" >vtimezones/primary-source