Commit Graph

2206 Commits

Author SHA1 Message Date
Mario Sanchez Prada
54d65aabc5 Fix CI build with clang: remove unused variable 2016-12-20 16:26:20 +01:00
Mario Sanchez Prada
29510ff4e0 Add unit tests to check the new feature to support multiple installations
Test all the new public APIs, making sure that the list of system-wide
installations is returned in the right order according to their priorities.
2016-12-20 09:54:39 +01:00
Mario Sanchez Prada
82906a63bd Add support for the FLATPAK_CONFIG_DIR environment variable
This will be useful for testing purposes, so that we can provide
our own versions of the configuration files normally under
/etc/flatpak/installations.d.
2016-12-20 09:54:39 +01:00
Mario Sanchez Prada
15e7f14ca3 Adjusted internal representation for storage types of system installations
I set these as separate bits by mistake when there's no good reason for
them to be like that, as they are not flags that are meant to be combined,
but a list of exclusive values.
2016-12-20 09:52:03 +01:00
Alexander Larsson
92a84cf61e install: Report errors when finding deps 2016-12-19 20:55:12 +01:00
Mario Sanchez Prada
40eb7fb07d Add bits to document the multiple installations feature
Documented the --installation parameter for all the CLI commands
that accept it, and added a small generic description in the main
flatpak document.
2016-12-19 15:12:06 +01:00
Alexander Larsson
8737153ded builder: Fix --verbose logging
We need to pass the right log domain in.
2016-12-19 14:55:22 +01:00
Alexander Larsson
5ef7e9d582 flatpak.supp: Suppress weird libsoup leak 2016-12-19 14:19:41 +01:00
Alexander Larsson
4ef4a7d982 transactions: Fix leak 2016-12-19 14:19:41 +01:00
Alexander Larsson
5a12917a2f oci: Fix leak in flatpak_pull_from_oci 2016-12-19 14:19:41 +01:00
Alexander Larsson
8d1d92fd4e remote-list: Fix leak of dirs 2016-12-19 14:19:41 +01:00
Alexander Larsson
f92f233758 flatpak_bundle_load: Fix leak 2016-12-19 14:19:41 +01:00
Mario Sanchez Prada
677cd771e4 Declare new public API as available since 0.8, not 0.6.15 2016-12-19 13:07:33 +01:00
Mario Sanchez Prada
b704c385c8 Change file extension for installations configuration files to '.conf'
The old '.install' one was probably too specific, so let's move it to
a more generic (and common) extension before making the release.
2016-12-19 12:52:46 +01:00
Alexander Larsson
507e4dd355 flatpak_oci_registry_store_json: Don't leak GBytes 2016-12-19 11:16:27 +01:00
Alexander Larsson
7267669ee1 build-bundle: Fix leaks 2016-12-19 11:16:17 +01:00
Alexander Larsson
6d0af18df1 Require system bwrap 0.1.5
This is the latest stable release
2016-12-19 10:51:43 +01:00
Alexander Larsson
3f94bb5982 Update to bubblewrap 0.1.5 2016-12-19 10:51:01 +01:00
Alexander Larsson
b066d863bc Remove unused variables 2016-12-19 10:08:18 +01:00
Mario Sanchez Prada
886eeb7d4a Support multiple --installation parameters for CLI commands
This affects `remote-list`, `list` and `info`, which can now pass
multiple installations to search for references in at the same time.
2016-12-17 00:56:10 +00:00
Mario Sanchez Prada
ed1b0e2b23 Add internal API: flatpak_dir_get_name()
This will allow us to refactor some code using in the CLI, when
we want to print the name of a FlatpakDir for detailed listings.
2016-12-17 00:56:10 +00:00
Mario Sanchez Prada
d3a9982837 Give the default system installation values for all its properties
This will allow explicitly referring to the default installation
using the 'default' ID, as well as overriding its values via a
configuration file specifying that same ID.
2016-12-17 00:56:06 +00:00
Mario Sanchez Prada
7962d4d145 Ignore system installations configured with a duplicated ID
If a system installation with the same ID than the one being
considered has been added, print a warning and ignore.
2016-12-17 00:32:53 +00:00
Mario Sanchez Prada
a663e5ba73 Add public API: implement the other getters required by GNOME Software
Implemented the following functions along with the required internal APIs:

  * flatpak_installation_get_id ()
  * flatpak_installation_get_display_name ()
  * flatpak_installation_get_priority ()
  * flatpak_installation_get_storage_type ()
2016-12-17 00:32:53 +00:00
Mario Sanchez Prada
34cf626029 Support additional configuration fields for system installations
As per the discussion with GNOME Software maintainer Richard Hughes [1],
we need to support a few additional fields in the configuration files
for better integration with external clients. Thus, this commits adds
support for reading "DisplayName", "StorageType" and "Priority" values
from the configuration files, being all of them optional.

Note: priorities are currently used to sort the system installations
list statically stored in flatpak-dir.c (bigger number, bigger priority).

[1] https://mail.gnome.org/archives/gnome-software-list/2016-December/msg00000.html
2016-12-17 00:32:52 +00:00
Mario Sanchez Prada
8eaa88c016 Add public API: flatpak_installation_new_system_with_id()
It will look for the list of configured system-wide installations
and return the one matching the passed ID, if any.
2016-12-17 00:32:51 +00:00
Mario Sanchez Prada
fe1540f988 Add public API: flatpak_get_system_installations()
It's meant to provide a list of the system installations, not
just the default one, which can still be obtained by calling
flatpak_installation_new_system(), as usual.
2016-12-17 00:32:51 +00:00
Mario Sanchez Prada
719616f086 Add support for multiple installations in the system helper
Allow passing an extra string parameter specifying the ID of a
system installation to refer to it, or an empty string for the
default one.
2016-12-17 00:32:50 +00:00
Mario Sanchez Prada
3e295085b7 Support the --installation parameter for the flatpak info command 2016-12-17 00:32:49 +00:00
Mario Sanchez Prada
4e68283f47 Support the --installation parameter for the flatpak run command 2016-12-17 00:32:48 +00:00
Mario Sanchez Prada
7d6197e3aa Support the --installation parameter for the flatpak list command
Also, refactor code that finds and prints the references with flatpak list,
as this needed to change a bit when considering multiple installations, as
the current code was not flexible enough for dealing with that.
2016-12-17 00:32:48 +00:00
Mario Sanchez Prada
7846195da5 Support the --installation parameter for the flatpak remote-list command 2016-12-17 00:32:47 +00:00
Mario Sanchez Prada
a3961b4875 Support the --installation parameter for most flatpak commands
Other commands (e.g. remote-list) need explicit support for this parameter.
2016-12-17 00:32:46 +00:00
Mario Sanchez Prada
53a81e3f1c Migrate flatpak-builtins-install.c to flatpak_dir_get_system_list()
We need to traverse now the full list of system directories here too.
2016-12-17 00:32:46 +00:00
Mario Sanchez Prada
81492a352a Migrate flatpak-<utils|transaction>.c to flatpak_dir_get_system_list()
We need to traverse now the full list of system directories, as
defined in /etc/flatpak/installations.d, not just the default one.
2016-12-17 00:32:45 +00:00
Mario Sanchez Prada
9d97382f82 Add internal API: flatpak_dir_get_system_by_id()
It will return a FlatpakDir by ID, according to the configuration.
2016-12-17 00:32:44 +00:00
Mario Sanchez Prada
1858b8987d Add internal API: flatpak_dir_get_id()
This will be used both from the CLI commands and the public API.
2016-12-17 00:32:44 +00:00
Mario Sanchez Prada
d7de3225cc Store the ID for a FlatpakDir when reading the configuration files
This information will be used when querying system-wide installations,
so that we can refer to those pre-configured installations by the id
defined in the configuration files under /etc/flatpak/installations.d
2016-12-17 00:32:43 +00:00
Mario Sanchez Prada
d27270635a Add internal API: flatpak_dir_get_system_list()
This will return an array of FlatpakDir instances with all the system
installations configured via key files in an optional drop-in directory
under FLATPAK_CONFIGDIR/installations.d, plus the default one.
2016-12-17 00:32:38 +00:00
Mario Sanchez Prada
22e3f83fb6 Remove internal API flatpak_dir_get(gboolean user)
User and system installations is no longer a binary decision, so remove
this API to force explicit calls to either flatpak_dir_get_system_default()
or flatpak_dir_get_system_list() when dealing with system installations.
2016-12-16 19:17:18 +00:00
Mario Sanchez Prada
44a2d73c98 Rename flatpak_get_system_base_dir_location(void) for the default case
It will be called flatpak_get_system_default_base_dir_location() now, to
distinguish it from the one that retrieves all the system directories.
2016-12-16 19:17:16 +00:00
Mario Sanchez Prada
521c3fcd4b Rename flatpak_dir_get_system() into flatpak_dir_get_system_default()
There will be a way to retrieve the list of all system installations,
not just the default one, so we rename this for backward compatibility.

Note that some (most?) of the places where we will be now using this
renamed function will likely have to migrate to using specific system
installations, but we don't have the necessary APIs yet so we do this
as an initial step to all the incremental changes that will come next.
2016-12-16 19:17:13 +00:00
Alexander Larsson
cc85b93584 build-finish: Add --require-version and handling of it
This means that clients will refuse to install or update to your
new app if the flatpak version they are using is too old.
2016-12-14 13:48:51 +01:00
Matthew Leeds
a528db5b95 install: Fix typo 2016-12-14 09:17:24 +01:00
Alexander Larsson
74e25701aa CI: Build clang in a container 2016-12-13 16:43:44 +01:00
Alexander Larsson
017313d049 Use a VM, not a container 2016-12-13 16:43:44 +01:00
Alexander Larsson
208f562c8e CI: Pick up build requirements from rpm 2016-12-13 16:43:44 +01:00
Alexander Larsson
e1bf3eff52 Flatpak[ref|repo]: Add Version field
If this is set it has to be 1, or we fail.
This lets us later introduce incompatible changes.
2016-12-13 15:54:14 +01:00
Alexander Larsson
f3b188cef3 flatpak-json: Correctly handle NULL in json_to_node 2016-12-13 13:52:09 +01:00
Alexander Larsson
5e80abd234 build-sign: Support empty id to mean sign all apps 2016-12-13 12:39:06 +01:00