Bug 237400 - games/flightgear: METAR data won't download
Summary: games/flightgear: METAR data won't download
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ganael LAPLANCHE
URL: https://forum.flightgear.org/viewtopi...
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-20 01:40 UTC by russo
Modified: 2019-04-24 10:22 UTC (History)
0 users

See Also:
koobs: maintainer-feedback+
koobs: merge-quarterly+


Attachments
First patch file needed to correct METAR URL (427 bytes, text/plain)
2019-04-20 01:40 UTC, russo
no flags Details
Second required patch file to correct METAR URL (500 bytes, text/plain)
2019-04-20 01:40 UTC, russo
no flags Details
Regenerated patch #1 made with make makepatch (425 bytes, text/plain)
2019-04-20 07:19 UTC, russo
no flags Details
Regenerated patch #2 made with make makepatch (490 bytes, text/plain)
2019-04-20 07:20 UTC, russo
no flags Details
flightgear fix METAR data download (1.93 KB, patch)
2019-04-20 07:52 UTC, Kubilay Kocak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description russo 2019-04-20 01:40:16 UTC
Created attachment 203810 [details]
First patch file needed to correct METAR URL

Flightgear connects to a NOAA web site to get weather data.  This site switched to HTTPS-only, but only after the most recent release of flightgear had hard-coded the HTTP version of the URL into the program.

Two one-line patches restore correct function to this feature of flightgear, which is also being addressed by the flightgear developers (so this patch almost certainly will be made obsolete by the next release).

Steps to reproduce:  Run flightgear and start it at any airport.  Enable detailed weather by selecting Environment->Weather, then clicking the "Detailed Weather" button and selecting "Live Weather" in pulldown box.  

Expected results:  live weather data for the selected airport will appear in the dialog box and the "data is valid" box will be selected.

Actual results: It will report that no METAR data is available.

Adding the two files attached to the /usr/ports/games/flightgear/files directory fixes the problem and restores METAR capability.
Comment 1 russo 2019-04-20 01:40:45 UTC
Created attachment 203811 [details]
Second required patch file to correct METAR URL
Comment 2 russo 2019-04-20 01:41:52 UTC
See also https://forum.flightgear.org/viewtopic.php?f=20&t=35217 for details of where I got this patch.
Comment 3 russo 2019-04-20 02:25:16 UTC
I have also reviewed Flightgear's git repo, and find that they have revamped this feature a few weeks ago so it is no longer hard-coded.  The next release won't need these two patches, and in fact the patches won't work in the next release.  But they are required to get full functionality back in today's port pending whatever that next release will be.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2019-04-20 06:44:42 UTC
@Russo Thank you for the report and patch.

Could you generate a diff against the port using the `make makepatch` process outlined here please: https://www.freebsd.org/doc/en/books/porters-handbook/book.html#slow-patch

Also, is the quarterly version of the port affected?
Comment 5 russo 2019-04-20 07:19:32 UTC
Created attachment 203815 [details]
Regenerated patch #1 made with make makepatch

This patch replaces the original one, and was created using make makepatch as requested.
Comment 6 russo 2019-04-20 07:20:20 UTC
Created attachment 203816 [details]
Regenerated patch #2 made with make makepatch

This patch replaces the second original patch file, and was regenerated using make makepatch as requested.
Comment 7 russo 2019-04-20 07:27:54 UTC
Done.  I have replaced the attachments with the files that were created by make makepatch.  These should now have the correct names for FreeBSD ports (I had created the other files by hand).  The content of the patches are identical to the previously attached files.

I have no idea what will happen in the next release --- all I can say is that the port (which contains the 2018.3.2 release of Flightgear from January) is currently broken with respect to metar downloads, the patches fix it, and the current git repository has commits that show that this exact change was made back in February, but then was superceded by an alternate approach in mid-March that replaces the hard-coded URL with a user-configurable URL.  see commits [2fdc24](https://sourceforge.net/p/flightgear/flightgear/ci/2fdc24c1097955c5d2c88a9cc0be66069b22eebe/), [c2fb01](https://sourceforge.net/p/flightgear/flightgear/ci/c2fb01ccb7df6fc893ab79850654cb39153cea3d/), and [c686f6](https://sourceforge.net/p/flightgear/flightgear/ci/c686f6181742ee9c1112937fdca5d37b70868435/)

Presumably the next release will be made off of the git master branch when the time comes, and so these two patch files will be obsolete and can simply be removed when that release is brought into the port.
Comment 8 russo 2019-04-20 07:30:15 UTC
I also cannot answer your question about the "quarterly version of the port."  I only know about the current version.
Comment 9 Kubilay Kocak freebsd_committer freebsd_triage 2019-04-20 07:52:34 UTC
Created attachment 203819 [details]
flightgear fix METAR data download

The quarterly (2019Q2) version of the port is the same as head, so it is affected too and these changes should be merged to the quarterly branch.

@Russo Thank you for additional upstream information. The updated patches provided are correct in content, but the diff should be a single file, created using svn diff against the port directory after make makepatch generates patches in the ports files/ dir.

I've generated that patch here for you
Comment 10 russo 2019-04-20 07:56:07 UTC
SVN diff in my ports directory shows NO differences after the make makepatch process:

> cd /usr/ports/games/flightgear
> svn diff
>  svn status
?       files/patch-src_Environment_realwx__ctrl.cxx
?       files/patch-src_Main_metar__main.cxx
> 

I had expected it to show a diff against the current ports tree, but it didn't, which is why I attached the files that it produced.
Comment 11 Kubilay Kocak freebsd_committer freebsd_triage 2019-04-20 08:10:43 UTC
(In reply to russo from comment #10)

`svn add files/*` will add the new files (? in svn status signifies untracked files), so svn diff will then include the content of the newly tracked (added) files.

Using svn diff saves one from having to create a copy of the port dir and using diff -ruN, etc
Comment 12 Ganael LAPLANCHE freebsd_committer 2019-04-20 18:39:04 UTC
Hi Russo,

Thanks a lot for your patch, I'll look at it ASAP.

Best regards,

Ganael.
Comment 13 commit-hook freebsd_committer 2019-04-23 10:03:14 UTC
A commit references this bug:

Author: martymac
Date: Tue Apr 23 10:02:22 UTC 2019
New revision: 499741
URL: https://svnweb.freebsd.org/changeset/ports/499741

Log:
  Fix METAR data download

  PR:		237400
  Submitted by:	russo@bogodyn.org
  MFH:		2019Q2

Changes:
  head/games/flightgear/Makefile
  head/games/flightgear/files/patch-src_Environment_realwx__ctrl.cxx
  head/games/flightgear/files/patch-src_Main_metar__main.cxx
Comment 14 Ganael LAPLANCHE freebsd_committer 2019-04-23 10:05:02 UTC
I've just committed your patch, thanks to both of you!

Best regards,
Ganael.
Comment 15 commit-hook freebsd_committer 2019-04-24 10:14:31 UTC
A commit references this bug:

Author: martymac
Date: Wed Apr 24 10:13:49 UTC 2019
New revision: 499828
URL: https://svnweb.freebsd.org/changeset/ports/499828

Log:
  MFH: r499741

  Fix METAR data download

  PR:		237400
  Submitted by:	russo@bogodyn.org

  Approved by:	portmgr (miwi)

Changes:
_U  branches/2019Q2/
  branches/2019Q2/games/flightgear/Makefile
  branches/2019Q2/games/flightgear/files/patch-src_Environment_realwx__ctrl.cxx
  branches/2019Q2/games/flightgear/files/patch-src_Main_metar__main.cxx