Commit Graph

85 Commits (4b3636a4524d50788d114c5160fe3a9bb8606661)

Author SHA1 Message Date
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
Alexander Larsson 874fbbff34 Fix various leaks 2016-06-10 12:59:30 +02:00
Matthias Clasen 26b083333a Fix a case of NULL<>FALSE confusion
This causes a compiler warning.
2016-06-08 20:05:26 -04:00
Alexander Larsson 70093d426f lib: Fix crash on install/update due to uninitialized dir->repo 2016-06-08 13:49:01 +02:00
Alexander Larsson cfef57e343 Properly handle subpaths on update 2016-06-07 22:12:51 +02:00
Alexander Larsson 77f1d7660c Don't abort on errors when pruning
This could happen for local partial pulls, due to a bug in ostree
where it didn't create commitpartial state files during local pulls.
2016-06-07 22:12:51 +02:00
Alexander Larsson a0358c8785 Handle non-existing dirs when deploying a subpath 2016-06-03 18:03:23 +02:00
Alexander Larsson e769af8661 system-helper: Handle installing bundles 2016-06-03 16:04:10 +02:00
Alexander Larsson 8ef84cc3d1 Move shared bundle install code to flatpak_dir_install_bundle 2016-06-03 14:30:25 +02:00
Alexander Larsson 21ab14b19a Improve deployment of appstream data
This has several improvements:
 * Writes to a temporary location and renames at the end, so
   we never end up with partial checkouts.
 * Don't fsync each file during checkout, instead syncfs() at
   the end
 * Pre-create the target deployment directory so that we get the right
   permissions for it.
2016-06-03 14:30:25 +02:00
Alexander Larsson 13707f6b18 system-helper: Support directly pulling local remotes
For a local (file:// uri) remote, do an (untrusted) direct pull instead
of pulling into the users cached repo first. This way we do less copies,
as well as guaranteeing the source of the data. The later means its
mostly safe to also allow this for non-gpg signed remotes.
2016-06-02 15:30:08 +02:00
Sam Spilsbury 4fb1ae0b45 remote: Make the error message when summary_bytes == NULL more informative
It seems like one common user-error that could cause this is when
the remote URL was invalid.
2016-06-01 06:03:47 +00:00
Sam Spilsbury c533e1aee6 summary: Make flatpak_cache_dir_summary static void
This function always returned NULL, and the return value was never
checked.
2016-06-01 05:59:54 +00:00
Sam Spilsbury d9ec859878 summary: Don't cache summary if none was returned
ostree_repo_remote_fetch_summary can set out_summary to NULL but
still return TRUE according to the documentation, so don't assume
that *out_summary will always be set.
2016-06-01 05:58:21 +00:00
Alexander Larsson 733a28c9c4 Deply: Disable per-file fsync and do a single syncfs when deploy is done
This should perform a lot better
2016-05-31 14:41:04 +02:00