Commit Graph

250 Commits (94d5f0a86e40543917a9ff7c0749b32cc2982d1b)

Author SHA1 Message Date
Simon McVittie 646b4c468b Use correct format string for guint64 on 32-bit
Signed-off-by: Simon McVittie <smcv@debian.org>
2017-04-04 12:17:28 +02:00
Colin Walters 2618a19716 Import ostree's compiler warnings, fix up callers
In ostree I maintain what I consider a "baseline" set of compiler
warnings that should *always* be fatal for a modern C project.

I noticed while working on a previous patch that a `-Werror=format`
warning wasn't fatal.

There are a few that are really, really important like
`-Werror=missing-prototypes`. I also take some like `-Werror=misleading-indentation`
which already caught some bugs.  See also https://lwn.net/Articles/678019/
2017-03-27 10:42:36 +02:00
Georges Basile Stavracas Neto 556782ac06 Fix comment 2017-03-08 15:42:44 +01:00
Georges Basile Stavracas Neto d74956c23a Improve progress calculation
When calculating the progress of a flatpak installation,
it considers the extra-data and OSTree pull as different
operations and that makes the progress to go back and
forth between 0% and 100%.

Consumers of this API, like GNOME Software, end up having
a bad experience reporting the progress of a Flatpak app
instalation.

Fix that by using a set of heuristics to improve the process,
splitting the operation in parts that can be tracked (or at
least estimated).
2017-03-08 15:37:28 +01:00
Richard Hughes d2307ca8b1 Don't include newlines in error messages 2017-02-24 17:03:03 +00:00
Richard Hughes 6125dabf58 Return the container from flatpak_get_system_installations()
This matches what other functions in libflatpak do, and also fixes a memory
leak in the error path.
2017-02-23 17:26:45 +01:00
Mario Sanchez Prada 2e1740297c Report progress for extra data downloads, as we do for OSTree pulls
Otherwise, clients such as GNOME Software won't be able to report
any progress once the flatpak application has been downloaded and
we enter the stage to download the extra data.
2017-02-14 09:00:57 +01:00
Matt Watson ee83b5a70d install: handle arch when installing from a flatpakref
Before this commit
$ flatpak install --arch someArch --from some.flatpakref
Would completely ignore the arch argument and only install for the
default flatpak architecture. Since flatpakref files don't include
an arch field, there's no reason we can't attempt to install the
arch specified on the command line.
2017-01-20 15:28:11 +01:00
Alexander Larsson f20e5f7823 bundles: Support dependencies and runtime-repo
If the bundle contains an origin link we can now install related
things from it, such as locale data.

You can also build the bundle with --runtime-repo=URL, where the url
points to a flatpakrepo file for a repo with runtimes. This works
similar to the RuntimeRepo= feature in flatpakref files.
2016-12-20 16:27:57 +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
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 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 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 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 9ddc4aca48 Support flatpak install --oci to install apps from OCI 2016-12-12 16:22:16 +01:00
Alexander Larsson 63c1aace83 Import OCI initial support to common/* 2016-12-08 17:43:03 +01:00
Alexander Larsson b744cd2493 Add backport of g_autoptr support for json-glib 2016-11-29 10:14:33 +01:00
Alexander Larsson 63842a1247 flatpak_installation_update_appstream_sync: Remove dead code 2016-11-11 11:07:05 +01:00
Alexander Larsson 0695712152 lib: Don't list updates from disabled remotes 2016-10-21 08:46:57 +02:00
Alexander Larsson b2af78fb6f remotes: Add no-use-for-deps property
If this is set for a remote we will never automatically look for
dependencies in it. This makes dependency search faster, as we
don't need to search in app-only remotes.
2016-10-19 11:34:22 +02:00
Mario Sanchez Prada 8decac7d7f Added new public API: flatpak_installation_update_remote_sync()
Provides access to the functionality offered by the new internal API
flatpak_dir_update_remote_configuration(), in a similar way to what
can be done via the command 'flatpak remote-modify --update-metadata'.
2016-10-14 16:42:17 +01:00
Mario Sanchez Prada 69831c60ca Check flatpak_remote_get_default_branch() in test-lib.c 2016-10-14 16:23:15 +01:00
Tiago Gomes 847fdc657f Docs: update system-wide directory used by flatpak 2016-10-07 15:51:38 +01:00
Alexander Larsson bef4de5308 Support default-branch setting in remote configuration
For now this is a purely client side setting which lets you store
the default branch to use for a remote. This is mostly meant to
be used for UI tools, although the CLI could also be made to use this.

You can set this manually in the CLI with --default-branch, or via a
flatpakrepo file (new key DefaultBranch).
2016-10-06 11:36:28 +02:00
Alexander Larsson bd7ab85102 Add FLATPAK_CHECK_VERSION macro
From: https://github.com/flatpak/flatpak/issues/304
2016-09-13 13:30:04 +02:00
Alexander Larsson e3b346c661 lib: Add flatpak_installation_install_ref_file
This gives libflatpak API support for .flatpakref files
2016-09-12 12:13:52 +02:00
Alexander Larsson c076b33ba3 Fix last commit
The checks where inverted.
2016-08-29 16:15:32 +02:00
Alexander Larsson aa160aa111 lib: Make sure we always call flatpak_dir_ensure_repo after cloning the dir
Otherwise we're not guaranteed the new FlatpakDir has a repo.
2016-08-29 16:11:48 +02:00
Alexander Larsson 6578d37984 Drop libgsystem dependency 2016-08-22 16:00:33 +02:00
Matthias Clasen e1207256d0 lib: Fix saving of remote titles
We were using the key 'title' in some places, but 'xa.title'
elsewhere. Make it 'xa.title' everywhere. This bug was found
by the new unit tests.
2016-08-01 23:05:38 -04:00
Matthias Clasen 75218c4a65 Fix license headers
We were referring to the nonexisting "version 2" of the
Lesser GPL. It should be "version 2.1".
2016-07-29 14:27:49 -04:00
Alexander Larsson 01d4209892 Add some code I used to test the new related refs code. 2016-07-01 10:39:56 +02:00
Alexander Larsson 5da7a0411a lib: Support listing related refs 2016-07-01 10:32:57 +02:00
Joaquim Rocha 84043767fb Fix leak in flatpak-installed-ref
The latest_commit string needs to be freed.
2016-06-28 13:14:35 +02:00
Alexander Larsson fa6fb1033f lib: Add flatpak_get_supported_arches 2016-06-23 11:05:49 +02:00
Simon McVittie 2e729aacab lib: do not distribute generated files in tarball
Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-12 10:35:13 +01:00
Alexander Larsson 1ddd173507 lib: Fix NOT_INSTALLED error when updating 2016-06-09 12:04:45 +02:00
Alexander Larsson 1bebedea8a lib: Add install/update_full() versions that allow you to specify subpaths
Also, we add a (yet unused) flags field for installation if we
want to extend this in the future.
2016-06-08 09:26:31 +02:00
Alexander Larsson bfe20c246e lib: Better checking for pre-existing installs
We don't just check for a deploy dir, because it may exist from
a failed install.
2016-06-08 09:25:40 +02:00
Alexander Larsson cfef57e343 Properly handle subpaths on update 2016-06-07 22:12:51 +02:00
Alexander Larsson 8ef84cc3d1 Move shared bundle install code to flatpak_dir_install_bundle 2016-06-03 14:30:25 +02:00
Josh Soref c0574db1a8 spelling: elapsed 2016-05-27 06:42:21 +00:00
Josh Soref ddc021911c spelling: common 2016-05-27 06:38:44 +00:00
Alexander Larsson 958a4b45a7 lib: Fix order of ref/remote in update call 2016-05-20 14:29:54 +02:00
Bastien Nocera 313d5fb2d3 lib: Fix compilation warnings
lib/flatpak-installation.c: In function ‘flatpak_installation_modify_remote’:
lib/flatpak-installation.c:738:12: warning: return makes integer from pointer without a cast [-Wint-conversion]
     return NULL;
            ^~~~
lib/flatpak-installation.c: In function ‘flatpak_installation_remove_remote’:
lib/flatpak-installation.c:773:12: warning: return makes integer from pointer without a cast [-Wint-conversion]
     return NULL;
            ^~~~
2016-05-18 13:48:23 +02:00
Alexander Larsson dcd8d85900 lib: Make flatpak_installation_drop_caches return TRUE on success 2016-05-17 12:09:32 +02:00
Matthias Clasen fab3e4b991 Document new FlatpakInstallation api 2016-05-16 21:25:48 -04:00
Matthias Clasen d30ef7c602 Document FlatpakBundleRef apis 2016-05-16 19:50:30 -04:00
Matthias Clasen d784322f4e Fix a doc comment typo
Tis was causing the docs for flatpak_remote_get_disabled not
to be picked up.
2016-05-16 19:36:30 -04:00