Commit Graph

99 Commits (b2af78fb6f5684cecc256a25183791a6cd6a8788)

Author SHA1 Message Date
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
Alexander Larsson 94295873e9 Summary cache: Fix valgrind report
We need to use g_hash_table_replace() to avoid the old freed key being
left in the hashtable.
2016-10-19 11:34:22 +02:00
Alexander Larsson 3c2b8a92b1 FlatpakDir: Fix leak in fetch_remote_title/default_branch
We were not freeing the GVariant returned by g_variant_dict_end.
In fact, we don't need the GVariantDict at all.
2016-10-18 10:10:03 +02:00
Alexander Larsson cb744c2d13 tests: Fix assert comming from ostree
It seems that ostree_repo_remote_fetch_summary asserts if you
pass a NULL error, so lets not do that.
2016-10-18 10:09:09 +02:00
Alexander Larsson aa081420a4 Fix whitespace issues 2016-10-17 17:27:51 +02:00
Mario Sanchez Prada 7e5f2580a6 New internal API to update configuration of remotes from their summary file
The new function flatpak_dir_update_remote_configuration() can be called
to fetch the contents of the summary file from the remote's source location
and update the local configuration in the installation directory accordingly.

For now, only the xa.title and xa.default-branch configuration parameters
are supported, since those seem to be the only relevant ones at the moment.
2016-10-14 16:42:17 +01:00
Mario Sanchez Prada 44dcc77a18 Check and use the remote's default branch when installing flatpaks
If no branch is explicitly stated when installing a flatpak, and several
options (branches) are available for the same ID, we now check the remote's
default branch and use that one, if it's defined and available for the app.

https://github.com/flatpak/flatpak/issues/221
2016-10-14 16:42:17 +01:00
Mario Sanchez Prada 7ed464834f Refactor code for fetching the remote's title and the default branch 2016-10-14 16:23:15 +01:00
Mario Sanchez Prada c492def9a7 Fetch the default branch when adding a remote from its repo's summary file
Just like we do with the title, fetch the default-branch from the
repository's summary file and use that information when adding a
remote reference from the command line.

https://github.com/flatpak/flatpak/issues/221
2016-10-14 16:23:15 +01:00
Alexander Larsson a5d1f6331b install: Better not-found error message
This adds more details about what was not found
2016-10-14 13:25:58 +02:00
Alexander Larsson c23316cb5d Add FlatpakKinds flag and use instead of booleans 2016-10-14 11:20:53 +02:00
Alexander Larsson 5be7e4deb7 common: Remove unused variables 2016-10-06 12:31:54 +02: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 9e6421d0d9 common: Accept empty/no url in modify_remote
This means that the remote is there, but disabled.
This is needed for e.g. bundles without origin url, and when bundles
starting using this codepath this regressed like in:
 https://github.com/flatpak/flatpak/issues/314
2016-09-19 16:27:54 +02:00
Matthias Clasen 06c7aca9f9 Make flatpak_is_valid_branch set a GError
Return detailed information about the problem with the branch in
the GError. Update all callers.
2016-09-13 13:28:42 -04:00
Matthias Clasen b2b281e485 Make flatpak_is_valid_name set a GError
Return detailed information about the problem with the name in
the GError. Update all callers.
2016-09-12 23:25:54 -04:00
Alexander Larsson edac377e86 origin remotes: Store main ref
If you install an app via a bundle of a .flatpakref file then
the ref of the app is also saved with the remote metadata.
2016-09-12 11:58:22 +02:00
Alexander Larsson fba645a999 Remove unused local variables reported by clang 2016-09-12 11:11:35 +02:00
Alexander Larsson 3fafba8b1e Don't use deprecated ostree_repo_checkout_tree_at function
We now use the new (almost identical) ostree_repo_checkout_at.
2016-09-12 09:03:33 +02:00
Alexander Larsson 71500ae5ec Add support for .flatpakref files
These are similar to .flatpakrepo, but for a single app.

For example, if you have a file gedit.flatpakref with this:

[Flatpak Ref]
Title=GEdit
Name=org.gnome.gedit
Branch=stable
Url=http://sdk.gnome.org/repo-apps/
IsRuntime=False
GPGKey=mQENBFUUCGcBCAC/K9WeV4xCaKr3NKRqPXeY5mpaXAJyasLqCtrDx92WUgbu0voWrhohNAKpqizod2dvzc/XTxm3rHyIxmNfdhz1gaGhynU75Qw4aJVcly2eghTIl++gfDtOvrOZo/VuAq30f32dMIgHQdRwEpgCwz7WyjpqZYltPAEcCNL4MTChAfiHJeeiQ5ibystNBW8W6Ymf7sO4m4g5+/aOxI54oCOzD9TwBAe+yXcJJWtc2rAhMCjtyPJzxd0ZVXqIzCe1xRvJ6Rq7YCiMbiM2DQFWXKnmYQbj4TGNMnwNdAajCdrcBWEMSbzq7EzuThIJRd8Ky4BkEe1St6tuqwFaMZz+F9eXABEBAAG0KEdub21lIFNESyAzLjE2IDxnbm9tZS1vcy1saXN0QGdub21lLm9yZz6JATgEEwECACIFAlUUCGcCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEArkz6VV0VKBa5cH/0vXa31YgEjNk78gGFXqnQxdD1WYA87OYxDi189l4lA802EFTF4wCBuZyDOqdd5BhS3Ab0cR778DmZXRUP2gwe+1zTJypU2JMnDpkwJ4NK1VP6/tE4SAPrznBtmb76BKaWBqUfZ9Wq1zg3ugvqkZB/Exq+usypIOwQVp1KL58TrjBRda0HvRctzkNhr0qYAtkfLFe0GvksBp4vBm8uGwAx7fw/HbhIjQ9pekTwvB+5GwDPO/tSip/1bQfCS+XJB8Ffa04HYPLGedalnWBrwhYY+G/kn5Zh9L/AC8xeLwTJTHM212rBjPa9CWs9C6a57MSaeGIEHLC1hEyiJJ15w8jmY=

You can then install gedit with
  flatpak install --from gedit.flatpakref
2016-09-09 16:50:32 +02:00
Alexander Larsson 65a1ba186f bundles: Support updating from a bundle
Now:
 flatpak install --bundle $file
Will update the bundle if its already installed.
2016-09-09 14:54:38 +02:00
Alexander Larsson fbca999cc9 Create /app/(.updated|.removed) file after update/uninstall
This way running apps can easily detect this and restart themselves.
2016-09-06 09:16:04 +02:00
Alexander Larsson a788965eec Support FLATPAK_USER_DIR env var 2016-09-05 21:41:14 +02:00
Alexander Larsson b678431197 Treat remotes with empty url as disabled
This happens with e.g. remotes from a bundle with no origin.

Fixes https://github.com/flatpak/flatpak/issues/270
2016-08-29 12:03:33 +02:00
Alexander Larsson d637d471fb Fix double-free during install/update 2016-08-24 15:42:01 +02:00
Alexander Larsson 522ac5200b update: Disable update shortcut for local repos
These may not have up-to-date summaries
2016-08-23 14:33:48 +02:00
Alexander Larsson c17e073f81 update: Add early check for nop updates using cached summary
This makes flatpak update a lot faster.
2016-08-23 12:30:41 +02:00
Alexander Larsson 6578d37984 Drop libgsystem dependency 2016-08-22 16:00:33 +02:00
Alexander Larsson 540a3a49df Drop use of gs_file_open_in_tmpdir_at
We import a copy of this
2016-08-22 15:44:52 +02:00
Alexander Larsson c14fbc3efb Drop calls to gs_file_rename
We make an equivalent helper inline.
2016-08-22 15:28:17 +02:00
Alexander Larsson 289ae4474b Use glnx_gen_temp_name instead of gs_fileutil_gen_tmp_name
+      enter the commit message for your changes. Lines starting
2016-08-22 15:20:39 +02:00
Alexander Larsson be8dae4693 Convert to glxn_* console helpers instead of gs_* 2016-08-22 15:08:59 +02:00
Alexander Larsson fcffefee26 Replace openat() calls from libgsystem 2016-08-22 14:12:31 +02:00
Alexander Larsson 65f1cf993d Create and use flatpak_file_get_path_cached
This is simpler that the one in libgs, as well as lockless. Also, it
removes one more use of libgs.
2016-08-22 10:22:42 +02:00
Alexander Larsson 9c907c992d Replace gs_shutil_rm_rf with small helper wrapper over libglnx 2016-08-22 10:06:08 +02:00
Alexander Larsson e0bd22bfe8 Add flatpak_mkdir_p helper and use it
This replaces all current callers of gs_file_ensure_directory with
equivalent code.

Actually, two instances were calling gs_file_ensure_directory with
FALSE, i.e. error out on EEXIST, but those cases seem fine with the
do-nothing-if-exists semantics.
2016-08-22 09:29:24 +02:00
Matthias Clasen 1e7bd752bf Don't handle already-installed error too early
Leave this to the callers which may well print out a
different message depending on whether the update did
anything or not.
2016-08-04 18:41:01 -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 764cb91cbe Remove workaround for issue #144 now that ostree is fixed
The fix for this is in ostree 2016.7

https://github.com/flatpak/flatpak/issues/144
2016-07-29 01:20:40 +02:00
Matthias Clasen 8732c5a8fb Translate errors
These show up in the UI and often refer to (translated) parts of
the UI.
2016-07-23 14:37:02 -04:00
Cosimo Cecchi a8e3e1826f FlatpakDir: use correct function to free FlatpakContext refs
These are not keyfiles. This fixes a crash when launching applications
through gnome-sofware.
2016-07-14 17:26:02 -07:00
Alexander Larsson 51663de427 Remove unused variables 2016-07-01 14:45:53 +02:00
Alexander Larsson 4a40fece78 Add flatpak_dir_install_or_update
This is needed in the case where we can do any, such as when
installing related refs, which may be already installed.
2016-06-30 16:55:31 +02:00
Alexander Larsson 8293527dbd FlatpakDir: Add flatpak_dir_find_remote/local_related
This lets us find all the "related" refs to a ref in a particular
remote, or locally.  These are the things we should automatically
download or delete when installing/updating/uninstalling the ref.

The implementation currently looks at all the extensions handled by the
app/runtime. For debug extensions and extensions marked no-autodownload we
only consider them related if its already locally installed. For locale
extensions we always consider them related, but we only pull the current
locale data for it.
2016-06-30 16:55:26 +02:00
Alexander Larsson 9be05bc511 common: Remove unused functions 2016-06-29 16:43:02 +02:00
Simon McVittie ee99e8afff Add BWRAP and --with-system-bubblewrap configure arguments
This lets distributors share a system copy of bubblewrap (>= 0.1.0)
between Flatpak and any other projects that benefit from it, if they are
careful to keep new versions in sync. The default is still to use the
bundled submodule, ensuring compatibility and simplifying dependencies.

Enable $PATH search everywhere that runs bwrap, so that $BWRAP doesn't
necessarily need to be a fully-qualified path.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-06-26 11:09:03 +01:00
Alexander Larsson f9ce1b16ed Make finding refs handle multi-arch
If opt_arch is not specified:
 * find_xxx_refs now return refs for all supported arches
 * find_xxx_ref looks at each supported arch in prio order
2016-06-23 12:52:55 +02:00
Alexander Larsson 9915e3740b Disable static deltas for system-helper updates
Due to an issue with ostree (https://github.com/ostreedev/ostree/pull/362)
applying non-from-scratch deltas fail when using parent_repo such as
in the system-helper case. We fix this temporarily by disabling the
use of deltas for that case.
2016-06-23 12:16:02 +02:00
Alexander Larsson 34faddfa8f common: Make some internal functions static 2016-06-23 11:31:19 +02:00
Alexander Larsson cbe35fedbc system-helper: Correctly copy the system config when modifying a repo
We were accidentally using the passed in copy of the rest of the config
when we should be using the one we read.
2016-06-16 19:56:50 +02:00