Commit Graph

2703 Commits

Author SHA1 Message Date
Alexander Larsson
c6d4330cea export: Add install/download size and metadata to commit
This way we can faster access this when updating the
summary, and also have a way to access this in case we ever
want to not have it in the summary.
2017-05-11 10:09:39 +02:00
Alexander Larsson
1e5ffa926a Add workaround to flatpak_repo_collect_sizes for uncommited objects
It turns out the underlying call ostree_repo_query_object_storage_size
doesn't work for staged objects, so we work around this by actually
loading the object, walking back to the original unix input stream
and fstat:ing the fd from that.
2017-05-11 10:09:39 +02:00
Matthias Clasen
f15d1b78ec Remove an unused autoptr definition
This makes clang complain about an unused function.
2017-05-11 08:38:32 +02:00
Matthias Clasen
029a5e38e1 Remove unused variables
clang flags these.
2017-05-11 08:38:32 +02:00
Matthias Clasen
3ce8be47a9 Improve error wording
I just saw a confusing error messages that looked like two error
messages just running into each other. Better to end the first
one with a colon when using g_prefix_error.
2017-05-11 08:38:01 +02:00
Alexander Larsson
644bb1cd41 common: Break out the flatpak progress calculator to a helper method. 2017-05-10 17:24:48 +02:00
Alexander Larsson
96cdf9acfc Don't use gdbus-codegen autoptr generation
This requires a glib more recent than what we want, so just do it
manually.
2017-05-10 17:22:05 +02:00
Matthias Clasen
9998b0e6a1 repo: Print out gpg key hash too
This seems useful, at least it shows that a key is there.
2017-05-10 16:01:24 +02:00
Alexander Larsson
2f533f3a68 tests: run test-repo.sh with system repo too 2017-05-10 11:54:27 +02:00
Alexander Larsson
755d4b6337 tests: Add tests for --redirect-url and new GPG key 2017-05-10 11:54:27 +02:00
Alexander Larsson
b09185c356 tests: Add new test-repo.sh with initial GPG tests
This just ensures we can install from GPG and non-GPG repos
and we can't install with missing on wrong GPG key.
2017-05-10 11:54:27 +02:00
Alexander Larsson
ec89340a26 tests: Add a second gpg keyring 2017-05-10 11:54:27 +02:00
Alexander Larsson
b33d6fd04f tests: Allow overriding GPG args 2017-05-10 11:54:27 +02:00
Alexander Larsson
99a6200cab tests: Make it possible to create multiple test repos 2017-05-10 11:54:27 +02:00
Matthias Clasen
66e91f55e8 Add a marker to rewritten desktop files
Add X-Flatpak=true to rewritten desktop files.
Desktop files have multiple consumers, and this
makes it easier for them to know what to do.
2017-05-10 11:54:19 +02:00
Matthias Clasen
b6ffa5aecb Document is-set keys in repo config 2017-05-10 11:53:33 +02:00
Matthias Clasen
e8836b0b52 Update docs for build-update-repo
Mention both --import-gpg and --redirect-url.
2017-05-10 11:53:33 +02:00
Matthias Clasen
c30e00eef2 Make it possible to unset values in update-repo
The underlying setters interpret NULL as 'unset this key', but
we never pass NULL. Since empty strings are not useful values
for title or default-branch or redirect-url, just interpret
an explicit empty value as 'unset this key'. E.g. to unset
the redirect url, use

flatpak build-update-repo --redirect-url= ~/my-repo/
2017-05-10 11:53:01 +02:00
Matthias Clasen
0ea9d93001 repo: Print out redirect url too
This is useful information about a repository, so make
the repo command print it out.
2017-05-10 11:53:01 +02:00
Matthias Clasen
4b5062d344 Drop an unused variable 2017-05-10 11:43:40 +02:00
Matthias Clasen
4ecd7a9dfe Add a missing return
The compiler pointed this out.
2017-05-10 11:43:40 +02:00
Alexander Larsson
7a4c82529e Support build-update-repo --redirect-url=
When clients install/update they will see this property in the
(signed) summary and update the url in the config, making this
essentially a permanent redirect.
2017-05-09 17:02:00 +02:00
Alexander Larsson
c7f770bd7a install: Fix automatic metadata update
We should update the metadata when installing from
a regular repo, not from a bundle.
2017-05-09 17:00:55 +02:00
Alexander Larsson
21778f1075 Add support for adding new gpg keys via signed summary 2017-05-09 16:43:20 +02:00
Alexander Larsson
0bf1b31256 update_remote_configuration_for_summary: Never use system-helper
The system-helper support now happens at the higher level
in update_remote_configuration, so there is no need for this.
2017-05-09 16:33:47 +02:00
Alexander Larsson
c89aa03695 remote-add/modify: Break out gpg loading code to helper 2017-05-09 15:56:31 +02:00
Alexander Larsson
fe09ffaa03 Optimize flatpak_summary_match_subrefs
This is called a lot during update, so we rewrite it to
avoid splitting up each ref in the summary file.
2017-05-09 15:18:13 +02:00
Alexander Larsson
d3a7dce117 Use flatpak_variant_bsearch_str to lookup in summary cache
This is a lot faster than the linear probe of g_variant_lookup.
2017-05-09 15:17:07 +02:00
Alexander Larsson
a058c5cbf2 Optimize flatpak_variant_bsearch_str
Rather than parsing a get_child string we just access
the right child and type.
2017-05-09 15:15:54 +02:00
Alexander Larsson
44cf5076fa update: Split update into check_for_update and update
This way we can avoid printing "updating foo" for every
app even if there is no update.
2017-05-09 14:08:27 +02:00
Alexander Larsson
864f2def12 transaction: Always update metadata for remotes on update/install
All remotes involved in an update are updated before starting
transaction.
2017-05-09 13:25:21 +02:00
Alexander Larsson
9896005ad0 remote-modify: Implement --update-metadata as a system-helper method
We download the summary and send it to the system helper, it verifies
the checksum and applies the changes, with the same polkit permissions
required as for an app update (i.e. typically none).

This allows us to update metadata automatically, without permission
requests.
2017-05-09 13:25:21 +02:00
Alexander Larsson
b25987255e remote-modify: Don't modify if no arguments are specified
For instance, if we pass only --update-metadata we don't
want to get a polkit request for a no-op change.
2017-05-09 13:25:21 +02:00
Alexander Larsson
f7c2fd0c30 common: Drop verbose log of using cached summary
This is just to common and is making -v useless
2017-05-09 13:25:21 +02:00
Alexander Larsson
b06e38073a common: Store the summary signature in the cache too
We will need this later
2017-05-09 13:25:21 +02:00
Alexander Larsson
e428ee47fc common: Add flatpak_dir_update_remote_configuration_for_summary 2017-05-09 13:25:21 +02:00
Alexander Larsson
b106fd9c67 remote-modify: Never update explicitly set values
Whenever you explicitly specify some value (e.g. for
title or default-branch) we set a $KEY-is-set option
to True, and if that is set we never automatically update it.
2017-05-09 13:25:21 +02:00
Alexander Larsson
62598840d1 common: Remove unused flatpak_dir_install_or_update 2017-05-09 13:25:21 +02:00
Alexander Larsson
6c1ebbcd1a install: Handle no-static-delta in --user installs too 2017-05-09 13:25:21 +02:00
Alexander Larsson
0d4fa486b5 Fix tests by setting XDG_CACHE_HOME
We use this now, so need to have it set to the test homedir
2017-05-09 13:24:54 +02:00
Matthias Clasen
b04529dfd0 info: Print some more information
Make sure that info prints at least the same amount of
information as list -d.
2017-05-08 11:29:22 +02:00
Matthias Clasen
172d7ad9db Use clearer terminology in docs about extensions
Differentiate between the 'extension point' (definition of
a place where extensions can be mounted) and the 'extension'
(a runtime matching an extension point).
2017-05-08 11:28:55 +02:00
Colin Walters
48b5dd5e7b tests: Fix race condition in tmp webserver
I was seeing this when trying to run flatpak's tests in ostree's CI:
https://github.com/ostreedev/ostree/pull/824

The race here is that the python process can still be writing to the output
while sed is reading it, and hence we'll find a difference on the next line.
Fix this by making a tmp copy of the file, which then both sed and cmp will
read consistently.

I'm not *entirely* sure this will fix the problem as I couldn't easily reproduce
the race locally, but I believe it at least fixes *a* race.
2017-05-08 11:27:09 +02:00
Alexander Larsson
1a49029f9d Move caches to ~/.cache
The system-cache (summaries and temporary repos for downloads) are moved
from ~/.local/share/flatpak/system-cache to
~/.cache/flatpak/system-cache (or wherever XDG_CACHE_HOME is) because
this is the proper location for caches.

Fixes https://github.com/flatpak/flatpak/issues/767
2017-05-04 17:29:30 +02:00
Alexander Larsson
2b5af6a036 install: Make already-installed a warning, not an error
This seems to match what dnf and apt does, and it makes it
easier to ensure a set of apps are installed.
2017-05-04 13:48:27 +02:00
Alexander Larsson
4d2d07d033 Expose host /etc/hosts and /etc/host.conf
These are local network configuration, very much similar to
resolv.conf, so should also be exposed.

Fixes https://github.com/alexlarsson/spotify-app/issues/42
2017-05-04 13:08:25 +02:00
Alexander Larsson
858a4b6044 build: Kill sandbox when flatpak build dies
This ensures that no processes from the build lives
past the return of the build itself, which might
accidentally happen.

We still allow apps to stay around after the regular
flatpak run command finished though, as this is sometimes
done on purpose.
2017-05-04 10:53:48 +02:00
Alexander Larsson
24cdbf51b9 Update to bubblewrap 0.1.8 for die-with-parent
This requires 0.1.8 if you use the system build and
updates the submodule to 0.1.8.
2017-05-04 10:40:29 +02:00
Alexander Larsson
f28d318cc9 run: Handle the case where /tmp on the host is a symlink
If the app explicitly grants access to the host /tmp (for
instance telegram) then when this is being exposed as a symlink
in the sandbox we get an error because /tmp already exists
as a dir, which we create very early on.

It doesn't really make sense to keep /tmp as a symlink in
the sandbox anyway, so we just special case this and mount
the symlink target as /tmp.
2017-05-04 10:34:40 +02:00
Alexander Larsson
08397923bf remote-ls: Fix up the column titles
The index for these were wrong.
2017-05-04 10:16:21 +02:00