Commit Graph
45 Commits
Author SHA1 Message Date
James Turner 0fbfa3426f Catalogs: check for local IO failures writing to disk
Sentry.io shows some examples where we failed to write valid data
to disk; check for that if possible.
2021-06-14 19:58:18 +01:00
James Turner fe41a03180 Asan: fix leaks in Catalog code 2021-04-23 11:54:56 +01:00
Automatic Release Builder 1568ed8b97 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-22 21:27:47 +01:00
Automatic Release Builder dab015742a Catalogs: fix enabling/disabling
Relates to bug Michael found in the launcher:
https://sourceforge.net/p/flightgear/codetickets/2380/
2020-09-30 14:38:35 +01:00
gallaert 567293c14d Replace boost::function by std::function 2020-04-22 14:04:21 +01:00
gallaert c9a4c0dac1 Replace BOOST_FOREACH by C++ 11 for range loop. 2020-04-12 14:39:12 +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 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 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 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
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 f21eac8473 Building with clean SGPath API 2016-06-30 16:17:52 +01:00
James Turner 1492de4391 Fix a leak / potential crash 2016-06-06 11:36:47 +01:00
James Turner 100e327684 More permissive catalog version checks
- support wildcard prefixes on FlightGear versions
- drop catalog version equality check
2016-06-01 22:46:17 +01:00
James Turner 8211f1c482 Allow updating a Catalog URL explicitly.
Needed for fallback Catalog URL support.
2016-05-26 17:38:02 +01:00
James Turner 6285a409ed Fix a crash with mismatch package versions. 2016-05-18 19:02:41 +01:00
Torsten Dreyer 87eaec3ce7 Fix some warnings reported from msvc 2016-05-02 20:54:28 +02:00
James Turner 27baafab0d Packages: handle catalog versions better
When a catalog version is stale, disable it but don’t remove it,
and still try to refresh it. This should give much better behaviour
when the FG version changes, should behave as users expect.
2016-03-25 23:04:45 +00:00
James Turner 78a548b861 Expose catalog name directly. 2015-11-29 12:43:20 +00:00
James Turner 3bfd0c872a Avoid duplicate refresh of Catalogs
- also fix duplicate reporting of successful refresh
2015-09-27 23:14:50 -05:00
James Turner 4e40913aef Package support progress
- check the catalog version explicitly when refreshing
- handle packages with distinct dir name / primary ID correctly
  (requires an updated catalog XML format)
2015-09-27 19:42:08 -05:00
James Turner 60a0c51e2b Package support hacking
- rename failure code to status code, and add more to handle
  cancellation.
- change caching of active Installs from Catalog to Root, to clarify
  ownership
- expose download status on Install
- adjust Delegate signatures to pass more information
2015-09-20 19:34:51 -05:00
James Turner b7fbb79565 Package work on version support.
- start adding test coverage for packages
2015-04-22 23:50:08 +01:00
James Turner 181afb7fd0 Catalogs: version-redirect support. 2015-03-15 21:55:54 +01:00
James Turner 596591bb64 Catalog install feedback.
- also support removing (uninstalling) a catalog and
all installs relating to it.
2015-03-15 21:55:54 +01:00
James Turner 611785c04b Kill off allCatalogs list.
No longer needed, and fixes crash on shutdown.
2015-02-20 11:31:15 +00:00
James Turner bb5e07d958 Package: support for variants
- Catalog keeps a map from variant IDs to packages
- Package caches its ID
- Refreshing a catalog updates existing Package instances

Dropping a package from a Catalog will now warn, need to decide
a real policy for this scenario.
2014-06-15 19:55:50 +02:00
Thomas Geymayer e8f10dd2e8 pkg: Fix recursion in Install destructor.
Prevent creating a shared pointer from this in
destructor, which would lead to recursively
calling the descructor.
2014-06-12 23:21:56 +02:00
James Turner dc60cf0e67 Pkg: record live installs in Catalog.
Ensures active Installs can be found immediately after creation.
2014-06-12 18:43:27 +01:00
Thomas Geymayer 03cafe4547 Catalog: add method to get all packages in a catalog. 2014-06-04 17:47:29 +02:00
Thomas Geymayer 32274027ef Missing return statement 2014-06-01 12:14:31 +02:00
James Turner da6ab1eabc Add installedPackages() to Catalog. 2014-05-31 18:00:38 +01:00
James Turner e3ddcbe2dd Update package classes ownership model.
Use SGReferences as the base for package classes, so they can be
exposed directly to Nasal by cppbind.
2014-05-31 16:47:12 +01:00
Thomas Geymayer f93fead8f2 io: refactor and improve HTTP modules.
- refactor code used multiple times spread over sg/fg into
   one single location.
 - allow aborting requests.
 - Provide two common request types:
  * FileRequest: Save response into file
  * MemoryRequest: Keep resonse in memory (std::string)
 - extend HTTP::Client interface:
  * urlretrieve: Save url to file (shortcut for making a
                 FileRequest)
  * urlload: Get respons into memory (shortcut for making
             a MemoryRequest)
2013-10-27 19:05:49 +01:00
James Turner fe9caad391 Max catalog age configurable per-catalog.
Allows for short-validity catalogs for development use.
2013-03-03 23:03:09 +00:00
James Turner 26e7d134ce Package management tweaks. 2013-03-03 15:03:25 +00:00
James Turner 71e9548c20 Lots more work on package support.
Delegate is hooked up in the demo util, and Install forwards control to the delegate too.
2013-03-02 16:30:39 +00:00
James Turner fc64abea5c LGPL license on package files. 2013-03-02 15:15:52 +00:00
James Turner 413e89c955 Package dependencies. 2013-03-02 15:14:09 +00:00
James Turner ad7d6624de Fix some signed/unsigned comparisoms. 2013-02-28 19:45:19 +00:00
Thomas Geymayer 06bfa4f1a1 Fix package management compiling with linux 2013-02-21 14:03:08 +01:00
James Turner a530712491 Initial work on package management.
Basic library infrastructure, catalog download/refresh, and package install,
uninstall and update. Disabled at cmake time by default, and not yet hooked
into FlightGear.
2013-02-20 16:17:22 +00:00