[libmateweather] 01/02: debian/patches: Add 0001_metar-switch-to-aviationweather-gov.patch. The site weather.noaa.gov is discontinued. (Closes: #846900).
Mike Gabriel
sunweaver at debian.org
Mon Dec 12 11:31:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch debian/jessie/updates
in repository libmateweather.
commit 4802a951b3838f486de46d122ac8aa270884265d
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Dec 12 11:04:19 2016 +0100
debian/patches: Add 0001_metar-switch-to-aviationweather-gov.patch. The site weather.noaa.gov is discontinued. (Closes: #846900).
---
.../0001_metar-switch-to-aviationweather-gov.patch | 53 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 54 insertions(+)
diff --git a/debian/patches/0001_metar-switch-to-aviationweather-gov.patch b/debian/patches/0001_metar-switch-to-aviationweather-gov.patch
new file mode 100644
index 0000000..8fbf9e7
--- /dev/null
+++ b/debian/patches/0001_metar-switch-to-aviationweather-gov.patch
@@ -0,0 +1,53 @@
+Author: monsta <monsta at inbox.ru>
+Description: metar: switch to aviationweather.gov (weather.noaa.gov is discontinued)
+
+--- a/libmateweather/weather-iwin.c
++++ b/libmateweather/weather-iwin.c
+@@ -462,7 +462,7 @@
+ zone = g_ascii_strdown (loc->zone, -1);
+ state = g_strndup (zone, 2);
+
+- url = g_strdup_printf ("http://weather.noaa.gov/pub/data/forecasts/zone/%s/%s.txt", state, zone);
++ url = g_strdup_printf ("http://tgftp.nws.noaa.gov/data/forecasts/zone/%s/%s.txt", state, zone);
+
+ g_free (zone);
+ g_free (state);
+--- a/libmateweather/weather-metar.c
++++ b/libmateweather/weather-metar.c
+@@ -510,7 +510,7 @@
+
+ loc = info->location;
+
+- searchkey = g_strdup_printf ("\n%s", loc->code);
++ searchkey = g_strdup_printf ("<raw_text>%s", loc->code);
+ p = strstr (msg->response_body->data, searchkey);
+ g_free (searchkey);
+ if (p) {
+@@ -522,8 +522,8 @@
+ metar = g_strdup (p);
+ success = metar_parse (metar, info);
+ g_free (metar);
+- } else if (!strstr (msg->response_body->data, "National Weather Service")) {
+- /* The response doesn't even seem to have come from NWS...
++ } else if (!strstr (msg->response_body->data, "aviationweather.gov")) {
++ /* The response doesn't even seem to have come from NOAA...
+ * most likely it is a wifi hotspot login page. Call that a
+ * network error.
+ */
+@@ -550,8 +550,14 @@
+ }
+
+ msg = soup_form_request_new (
+- "GET", "http://weather.noaa.gov/mgetmetar.php",
+- "cccc", loc->code,
++ "GET", "https://www.aviationweather.gov/adds/dataserver_current/httpparam",
++ "dataSource", "metars",
++ "requestType", "retrieve",
++ "format", "xml",
++ "hoursBeforeNow", "3",
++ "mostRecent", "true",
++ "fields", "raw_text",
++ "stationString", loc->code,
+ NULL);
+ soup_session_queue_message (info->session, msg, metar_finish, info);
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..327bd86
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001_metar-switch-to-aviationweather-gov.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/libmateweather.git
More information about the pkg-mate-commits
mailing list