Commit Graph

3812 Commits

Author SHA1 Message Date
Alexander Larsson
bdbd4d15e2 dir: Split flatpak_dir_find_local/remote_related()
These are split into two, one that loads the metadata and one
that works on the pre-loaded GKeyFile.

This changes no behaviour, but we will later use the split out
functions from FlatpakTransaction when we already have the
metadata loaded.

Closes: #1787
Approved by: alexlarsson
2018-06-18 08:11:29 +00:00
Alexander Larsson
641e416280 dir: Export flatpak_dir_find_latest_rev
Closes: #1787
Approved by: alexlarsson
2018-06-18 08:11:29 +00:00
Alexander Larsson
0a6f676161 dir: Split flatpak_dir_check_for_update
This splits out the part that extracts the current commit id
from the code that sees if given a particular commit id we need
to update.

Closes: #1787
Approved by: alexlarsson
2018-06-18 08:11:29 +00:00
Alexander Larsson
6459a13b2a transaction: Extract commit when adding bundle
This way we know ahead of time what we're going to be installing.

Closes: #1787
Approved by: alexlarsson
2018-06-18 08:11:28 +00:00
Alexander Larsson
6a73c26003 flatpak_dir_read_latest_commit: Also return commit id
Closes: #1787
Approved by: alexlarsson
2018-06-18 08:11:28 +00:00
Alexander Larsson
d4a476711f transaction: Avoid some duplicated code
This doesn't change any behaviour, but it avoids duplicating
shared code.

Closes: #1787
Approved by: alexlarsson
2018-06-18 08:11:28 +00:00
Matthew Leeds
2df6916505 Fix a few mistakes in the docs 2018-06-15 12:31:40 -07:00
Alexander Larsson
854be2430e transaction: Use g_message, it g_warning for warnings
g_warning is fatal in the test-suite, breaking tests when p2p is
enabled.
2018-06-13 17:09:43 +02:00
Alexander Larsson
14560093b0 Update pofiles 0.11.8.3 2018-06-13 12:48:05 +02:00
Alexander Larsson
3f584376f1 Update to 0.11.8.3 2018-06-13 12:16:24 +02:00
Alexander Larsson
11d9b5b0b6 session-helper: Disable p11-kit for older broken versions
p11-kit server version < 0.23.10 doesn't properly daemonize which
causes g_spawn_sync() to hang forever waiting for the pipe to
close.

We work around this by passing --sh, which is only available in the
working version, and fill fail the old ones.

https://github.com/flatpak/flatpak/issues/1768

Closes: #1782
Approved by: alexlarsson
2018-06-13 10:08:56 +00:00
Alexander Larsson
ab87617ac1 session-helper: break out the p11-kit code to a separate function
This makes it easier to read. Also, we convert some nested ifs
to early returns.

Closes: #1782
Approved by: alexlarsson
2018-06-13 10:08:56 +00:00
Alexander Larsson
a59fa5c1af portals: By default, only allow portal calls, not broadcasts
No portal is currently using broadcasts, but we want to eventually use
them in dconf. But when doing that they can't be sent to all instances
but rather limited by the sender (dconfd). The exact way this will work
is still unclear, but to pave the way for this we start by defaulting
to not delivering any broadcasts.

Closes: #1689
Approved by: alexlarsson
2018-06-11 14:31:27 +00:00
Alexander Larsson
679248254a run: Add flatpak instance id directory
Each flatpak instance gets a (random uint32) identifier which is
unique during the runtime of the instance. Additionally there is a
directory created in $XDR_RUN_DIR/.flatpak/$id which is writable on
the host, but read-only bind-mounted into the sandbox. Services (like
dconf which this targets) can use this to pass file data to the
sandbox instance.

We use locks on a file in the instance directory to ensure that we
can clean up unused directories.

The container id is also put in the .flatpak-info file so that
portals can know where the instance directory is.

Closes: #1689
Approved by: alexlarsson
2018-06-11 14:31:27 +00:00
Alexander Larsson
9bfef97027 Update pofiles 0.11.8.2 2018-06-11 12:28:13 +02:00
Alexander Larsson
22eed59b3f Update to 0.11.8.2 2018-06-11 12:18:54 +02:00
Alexander Larsson
ae58744b10 appstream: Allow multiple components per app
Some apps (like libreoffice) has multiple sup-apps, so we allow them to have multiple
appstream components (as well as e.g. multiple desktop files).

Fixes #1749

Closes: #1778
Approved by: alexlarsson
2018-06-11 10:00:17 +00:00
Alexander Larsson
f37396b2de uninstall --unused: Fix handling of autoprune-unless
We were doing autoprune-if instead, which is the opposite
of what we want.

Fixes #1766

Closes: #1777
Approved by: alexlarsson
2018-06-11 09:50:25 +00:00
Alexander Larsson
a123c858a5 uninstall --unused: Don't prompt if no unused refs found
If there was no refs found to delete, we don't want to print the "ok?" prompt.
Instead we just say that nothing was found.

Closes: #1776
Approved by: alexlarsson
2018-06-11 09:22:55 +00:00
Alexander Larsson
27fe8dd6a3 build: Compute app_context before using it
This fixes a crash dereferencing a null app_context.

Fixes https://github.com/flatpak/flatpak/issues/1770

Closes: #1774
Approved by: alexlarsson
2018-06-11 08:24:08 +00:00
Rafael Fontenelle
ecc603cb4b Update Brazilian Portuguese translation
Closes: #1772
Approved by: alexlarsson
2018-06-11 07:47:32 +00:00
Simon McVittie
69bc824813 test-webserver.sh: Wait longer for web server to start
When under load (for example running parallel tests) it can take a
while to get the web server ready.

Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #1760
Approved by: alexlarsson
2018-06-11 07:38:21 +00:00
Simon McVittie
acb33b4a0e test-webserver: Print http server output
Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #1760
Approved by: alexlarsson
2018-06-11 07:38:21 +00:00
Simon McVittie
ea73d96e02 testlibrary: Correct a wrong string in a debug message
This always printed "setting HOME=(null)" because we didn't set
datadir yet, but it should have been looking at homedir anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #1760
Approved by: alexlarsson
2018-06-11 07:38:21 +00:00
Simon McVittie
2471f0552c testlibrary: Let the test web server's stderr go to the test's stderr
Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #1760
Approved by: alexlarsson
2018-06-11 07:38:21 +00:00
Alexander Larsson
16f9b7322a Update pofiles 0.11.8.1 2018-06-08 14:46:04 +02:00
Alexander Larsson
c7f2095413 Update version and NEWS for 0.11.8.1 2018-06-08 14:41:22 +02:00
Alexander Larsson
7311eff800 Fix regression with --own=name
We deleted the "filtered" policy, but forgot to delete it in one place.

This fixes https://github.com/flatpak/flatpak/issues/1761
2018-06-08 14:39:35 +02:00
Alexander Larsson
c86ad3125b Update pofiles 0.11.8 2018-06-07 16:47:02 +02:00
Alexander Larsson
d3a66bc414 Update NEWS for release 2018-06-07 16:37:47 +02:00
Alexander Larsson
68b14e3512 Bump version to 0.11.8 2018-06-07 16:14:04 +02:00
Alexander Larsson
66b2ff40f7 run: Support accessing host trusted certificates
If p11-kit server is installed on the host, we spawn a copy of this, forwarding the access to the
p11-kit trust module in a read-only way.

We then (if the above worked) bind mount the socket as /run/user/$UID/p11-kit/pkcs11 in the sandbox,
which is the default socket path for the p11-kit-client module.

We also add a configuration file in /etc/pkcs11/modules/p11-kit-trust.module that makes the trust
module actually load the client module instead. This means applications automatically switch
to using the host certs for trust if possible, and use the runtime ca-certificates otherwise.

Additionally we add a config file that always disables pkcs user
config merging, because pkcs11 modules on the host are unlikely to work in a random runtime.

Closes: #1757
Approved by: alexlarsson
2018-06-07 12:25:21 +00:00
Alexander Larsson
b4bb890516 session-helper: Add new more generic helper start method
This does the same as RequestMonitor, but returns the status via a
a{sv} so that its more extensible.

Closes: #1757
Approved by: alexlarsson
2018-06-07 12:25:21 +00:00
Alexander Larsson
c6ccf26eec configure: Bump system bwrap requirement to 0.2.1
There are some fixes in this, like the /dev/fd symlinks that
are important.

See e.g. https://github.com/flatpak/flatpak-builder/issues/160 for an example.

Closes: #1758
Approved by: alexlarsson
2018-06-07 12:24:33 +00:00
Alexander Larsson
df3a0c444b deploy: Do required-version check on deploy too
We only checked this in transaction. This is now the recommended way to installation
via libflatpak too, but if you use the old API this check also ensures that
installation fails if the required version is too old.

Also, we add a specific error code for this so callers can check for it.

Fixes https://github.com/flatpak/flatpak/issues/881

Closes: #1755
Approved by: alexlarsson
2018-06-04 13:30:00 +00:00
Philip Withnall
ebb9baaeac common/installation: Fix indentation in a block
This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1736
Approved by: alexlarsson
2018-06-04 12:22:30 +00:00
Philip Withnall
441fe25255 all: Use GMainContextPopDefault when handling thread defaults
Simplify some of the return logic when handling pushing/popping the
thread default main context by using g_autoptr(GMainContextPopDefault).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1736
Approved by: alexlarsson
2018-06-04 12:22:30 +00:00
Alexander Larsson
cefe0a2e41 uninstall: Add --unused
This removes all runtimes that are not used by some app, or any sdk
used by a runtime that some app uses.

Closes: #1754
Approved by: alexlarsson
2018-06-04 12:08:59 +00:00
Alexander Larsson
a7ea6844d8 Add new extension key autoprune-unless and propagate it to related refs
The idea is for e.g. the gl extension to have
 download-if=active-gl-driver
 autoprune-unless=active-gl-driver

And then we can automatically find and uninstall unused gl drivers.

Closes: #1754
Approved by: alexlarsson
2018-06-04 12:08:59 +00:00
Alexander Larsson
e3559ddd41 flatpak_dir_find_local_related: Fix handling of subdir extensions
We were not correctly handling the partial refs that ostree_repo_list_refs()
returned, instead assuming they were full refs.

Closes: #1754
Approved by: alexlarsson
2018-06-04 12:08:59 +00:00
Alexander Larsson
4b119c41f0 info: Add show-runtime and show-sdk
Also show sdk in regular output

Closes: #1753
Approved by: alexlarsson
2018-06-04 11:46:07 +00:00
Alexander Larsson
798e8adfee remote-info: Add show-runtime and show-sdk
Also, print sdk in regular output

Closes: #1753
Approved by: alexlarsson
2018-06-04 11:46:07 +00:00
Alexander Larsson
1463c468e2 flatpak info: Add --show-location
This shows the location the ref is deployed to

Closes: #1753
Approved by: alexlarsson
2018-06-04 11:46:07 +00:00
Alexander Larsson
376a325eda tests: Test uninstall fail due to dependencies
Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
3134512111 transaction: Reorder uninstalls so apps come before the runtimes they depend on
Otherwise we will fail if we uninstall "runtime app".

Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
de5a713336 uninstall: Don't allow uninstalling a runtime with apps that need it
Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
518da832ee Deploy: Store runtime dependencies in deploy data
For applications, we extract the name of the runtime it uses
so that we quickly can look up dependencies.

Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
3e47247425 Batch running triggers
This moves the triggers from out of flatpak_install/update/uninstall
and instead calls them manually at all the sites that call this.

This allows FlatpakTransaction to only run the triggers once for the
entire operation.

Closes: #1743
Approved by: alexlarsson
2018-06-01 11:41:56 +00:00
Alexander Larsson
bc4a2d8dbf uninstall: Add --all
Closes: #1744
Approved by: alexlarsson
2018-06-01 10:59:14 +00:00
Alexander Larsson
715cc173ef Transactions: Add uninstall operation and handle no-pull correctly
In the no-pull case and when uninstalling, we never want to do any network
i/o for e.g. detecting depenedencies.

Closes: #1744
Approved by: alexlarsson
2018-06-01 10:59:14 +00:00