Mercurial > hg > egg-tcls
changeset 404:32be5d1dca29
fetch_weather: Add commandline option for forcing update of static metadata caches.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 06 Jan 2017 18:53:42 +0200 |
parents | 282e9d9ddb99 |
children | 26c613434971 |
files | fetch_weather.pl |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/fetch_weather.pl Fri Jan 06 18:47:22 2017 +0200 +++ b/fetch_weather.pl Fri Jan 06 18:53:42 2017 +0200 @@ -273,11 +273,12 @@ die( "Weather Fetch v0.7 by ccr/TNSP <ccr\@tnsp.org>\n". -"Usage: $0 <config file>\n" +"Usage: $0 <config file> [force]\n" ) unless scalar(@ARGV) >= 1; my $cfgfile = shift; opt_read_config($cfgfile) == 0 or die("Errors while parsing configuration file '".$cfgfile."'.\n"); +my $force_update = shift eq "force"; ### @@ -336,7 +337,7 @@ # Fetch or read the cache my $meta_str; - if ($fetch_meta) + if ($fetch_meta || $force_update) { print STDERR "Fetching Tiehallinto static meta data.\n" if (opt_get_int("debug") > 0); my $uri = "https://raw.githubusercontent.com/finnishtransportagency/metadata/master/csv/meta_rws_stations.csv";