Commit Graph
141 Commits
Author SHA1 Message Date
James Turner 08906ebbb0 Launhcer: fix crashes adding a catalog
Traversing a container which is modified causes crashes, take a copy
during traversal for firePackageStatus.

Sentry-Id: FLIGHTGEAR-CJF
Sentry-Id: FLIGHTGEAR-CJ5
2021-01-01 15:34:17 +00:00
Automatic Release Builder 15c6f73136 Catalogs: fix ownership of new Catalogs
When doing the initial download of a Catalog, ensure we still keep
an owning ref to it.
2020-11-18 17:32:10 +00:00
Automatic Release Builder afcbf2ff3a Catalog migration: migrate packages too
When doing a catalog migration to a new ID (eg, 2018 -> 2020), also
mark the installed packages for installation, on the new catalog.

Related to this, when manually removing a catalog, record this fact,
so we don’t re-add it automatically due to migration.

Add unit-tests covering both of these cases.
2020-10-29 14:09:36 +00:00
Automatic Release Builder 6d892e8d18 Packages: fix circular refernece bug
Packages had a strong back-pointer to their catalog, creating a circular
reference loop. Break this so catalogs & packages are freed on exit.
2020-10-29 14:00:47 +00:00
Automatic Release Builder ed8ff68114 Catalogs: fix enabling/disabling
Relates to bug Michael found in the launcher:
https://sourceforge.net/p/flightgear/codetickets/2380/
2020-10-29 14:00:40 +00:00
James Turner 456c63935c Cmake refresh
Use target objects everywhere, and simplify handling of system vs
local dependencies.
2020-08-18 11:40:27 +01:00
gallaert 567293c14d Replace boost::function by std::function 2020-04-22 14:04:21 +01:00
gallaert 2ff6a4966a Replace boost::bind by std::bind and lambda function 2020-04-22 14:04:21 +01:00
gallaert 2ab0122124 Replace boost::to_lower and boost::to_upper by strutils::lowercase and strutils::uppercase 2020-04-14 13:24:59 +01:00
gallaert c9a4c0dac1 Replace BOOST_FOREACH by C++ 11 for range loop. 2020-04-12 14:39:12 +01:00
James Turner c90ab3df5b Packages: consider checksum failures for retry.
This means an out-of-sync mirror causes a retry on a different
mirror server.
2020-04-10 15:03:17 +01:00
James Turner 92ebdbfacc Expose compare-version helper publicly.
This helper was added for Catalog version checking, but will be used in
FlightGear now, so move it to strutils.
2020-04-09 14:39:12 +01:00
James Turner 9cdec99fa4 Quiet some warnings 2020-04-03 10:00:22 +01:00
James Turner ec315bf26d Fix thumbnail cache retrieval
Use direct reading of thumbnail-cache files, instead of using libCurl
2020-03-26 16:51:00 +00:00
James Turner 8cf11f9208 Packages: fix handling of unsafe paths in zips
This was breaking the P-51D which contains a mis-named PNG file which
tripped the unsafe path detection.
2020-03-24 13:51:57 +00:00
James Turner 40725a76ab Packages: randomise mirror URL selection
Also add retry on mirrors when a download fails.
2020-03-21 18:31:53 +00:00
James Turner 3e4d528859 Additional install / download failure test
Ensure we can install again on a previously failed URL.
2020-03-09 15:00:23 +00:00
James Turner d670cc13ac testHTTP mods to investigate macOS failure.
Disabled one test for now, since it’s blocking macOS release process
2020-02-25 16:12:12 +00:00
James Turner 43699d039f Track package install status persistently. 2020-02-25 14:27:48 +00:00
James Turner 9192b009e1 Catalog enable/disable feature 2020-02-24 11:35:04 +00:00
James Turner 0185884ca8 Catalogs: allow migration to alternate IDs 2018-10-16 09:56:56 +01:00
James Turner 46b271d75c Packages: improve localised string support 2018-10-12 10:49:14 +01:00
James Turner 854b958797 Packages: check for existing update when scheduling
This is fixing an issue identified in the launcher in a secondary way,
to ensure if another user of the API tries to schedule an already
scheduled package, we ignore the second request.
2018-10-05 10:40:35 +01:00
James Turner 264779e1d3 Packages: fix download progress
(Broke it when improving zip/tar support)
2018-08-08 11:12:53 +02:00
James Turner 126f69434b Refactor untar/unzip code
This is to enable reuse in more places, especially scenery extraction and TerraSync
2018-07-04 10:32:09 +01:00
James Turner 9755110ec7 Packages: Remove deprecation warnings for now
Probably a bit over-zealous for these.
2018-05-09 10:15:07 +01:00
James Turner f5ff969cd4 Warning improvements when requesting bad URLs
Found while debugging some issues with add-default-catalog flow in
the launcher.
2018-05-08 06:50:15 +01:00
James Turner 831369f653 Packages: add archive-path XML support
Allow the in-archive file path to differ from the after-install path.
Requested to allow easier operation with GitHub/Labs zip generation.
2018-04-27 15:25:13 +01:00
James Turner 888d7fb262 Packages: archive-type support in catalogs
Allow URLs which don’t encode the file extension to work
2018-04-27 12:07:10 +01:00
James Turner 48b228f68f Packages: additional test for updating invalid
This is part of trying to trace a crash reported on the devel list,
unfortunately the test passes but it’s sill good to have it
2018-04-25 17:04:07 +01:00
James Turner 2797970837 Catalogs: better invalid data handling 2018-04-08 23:57:24 +01:00
James Turner cba07157d5 Packages: better version handling & migration
Add test coverage for disabling a catalog due to version, and also
for auto-migrating to a new version. Expose disabled catalogs on the
Root, so they can be checked for.
2018-02-28 17:26:15 +00:00
James Turner bc63381fb0 Packages: tweaks to thumbnail cache
Don’t discard the existing data when expiring from the cache, in case
the refresh request fails.
2018-01-31 15:00:58 +00:00
James Turner 9078a085c3 Kill exception if removeDelegate fails
This simplifies logic when changing the package::Root
2018-01-20 16:19:13 +00:00
James Turner b766ce76ff Package thumbnail caching tweaks
Resolves some issue with expired thumbnails not being reloaded
correctly.
2017-11-27 23:37:56 +00:00
James Turner 69ba2617d2 Fix thumbnail loading on Windows 2017-07-28 12:05:35 +01:00
James Turner 34c215ad83 Persistent thumbnail cache for aircraft packages
This should reduce the load on Ibiblio when browsing aircraft, the
package system caches thumbnails for seven days. Also we detect for
certain failure conditions and retry, to deal with Ibiblio’s rate-
limiting mechanism.
2017-07-28 11:38:59 +01:00
James Turner 2a3bb62001 Add efficient hasTag check to Package.
Avoids copying the tags set each time to check for presence / absence
of a particular tag.
2017-07-27 23:26:06 +01:00
James Turner fe46ae09ef Fix MSVC build.
MSVC really needs these methods to be out of line, to avoid generating code for the shared pointers
in each translation unit which includes the header.
2017-07-19 13:00:33 +01:00
James Turner a54b3ffcee Extend Package delegate callbacks.
This makes it easier to report the status in the launcher, at least.
2017-06-28 22:27:40 +01:00
James Turner fe87e7f60d Define SG_DEPRECATED, remove unused DEPRECATED.
Use this to mark two Package APIs as deprecated.
2017-04-05 22:09:52 +09:00
James Turner f3e83cf020 Package APIs to support multiple primary aircraft.
This (with some catalog and front-end changes) will allow packages to
supply multiple primary aircraft.
2017-04-04 07:04:43 +02:00
James Turner c170f576b6 Ensure <simgear_config.h> is always included.
This is going to become important soon - prep for enabling SIMGEAR_SHARED on Windows.
2017-03-28 09:36:53 +01:00
James Turner 9c9e4e86e7 Packages allows thumbnails per variant.
Change API for thumbnail access, so each variant can have a unique thumbnail alongside other data. Map existing catalog XML format to
this system.
2017-02-25 20:52:35 +00:00
James Turner 707d9e12cf Fix issues with package upgrades on Windows. 2017-02-23 13:26:02 +00:00
Florent Rougon 79f869a7f3 Move IOStreams-related files to simgear/io/iostreams; rename zfstream.[ch]xx to gzfstream.[ch]xx
- Rename zfstream.cxx (resp. zfstream.hxx) to gzfstream.cxx (resp.
  gzfstream.hxx)

  This is because these files only deal with the gzip format (RFC 1952),
  while zlib can actually read and write two slightly different formats:
  this one and the "ZLIB Compressed Data Format" (RFC 1950). Since I am
  going to add std::streambuf and std::istream subclasses able to deal
  with both formats (and supporting data sources that are general
  std::istream instances, not just files), this renaming will make
  things a bit clearer, I hope.

- Add new folder simgear/io/iostreams and move the following files to
  this folder:

    simgear/misc/gzcontainerfile.cxx
    simgear/misc/gzcontainerfile.hxx
    simgear/misc/gzfstream.cxx
    simgear/misc/gzfstream.hxx
    simgear/misc/sgstream.cxx
    simgear/misc/sgstream.hxx
    simgear/misc/sgstream_test.cxx

- Adapt other files accordingly (mainly #includes and CMakeLists.txt
  files).
2017-02-12 21:18:52 +01:00
James Turner 3cb3084725 Rename ‘new’ thumbnails to ‘previews’
This avoids an XML naming clash, and allows both systems to exist in
parallel peacefully. Update the tests to check both the thumbnails
and preview system in parallel with each other.
2017-01-10 18:05:40 +00:00
James Turner 8c4695b991 Fix duplicate variants in packages. 2016-12-15 17:37:32 +00:00
Erik Hofman e768553a4a Replace auto_ptr with unique_ptr 2016-12-07 11:03:49 +01:00
Florent Rougon e655d41817 Rename the COMPARE, COMPARE_EP, COMPARE_EP2 and VERIFY test macros
COMPARE     -> SG_CHECK_EQUAL
COMPARE_EP  -> SG_CHECK_EQUAL_EP
COMPARE_EP2 -> SG_CHECK_EQUAL_EP2
VERIFY      -> SG_VERIFY

Also remove duplicate private definitions of these macros in test
modules, using instead those defined in simgear/misc/test_macros.hxx.
2016-12-04 21:04:40 +01:00