Instead of FLATPAK_ERROR_ABORTED, return G_IO_ERROR_CANCELLED when the
passed in GCancellable gets cancelled. This makes it possible to cancel
updates in gnome-software without getting a generic "Aborted due to
failure" error popup.
Closes: #2178
Approved by: alexlarsson
--device=all really means the device nodes, we should not expose the host
shared memory objects.
This change incidentally fixes issues with --device=all on debian (#2136)
where /dev/shm is a symlink to /run/shm, which doesn't exist in the sandbox.
Closes: #2160
Approved by: alexlarsson
These days we don't really need xattrs for the tests to run,
so move the test runs to /tmp, which brings down make check time
from 5 to 3.5 minutes on my machine.
Closes: #2170
Approved by: alexlarsson
Several tests have alternative wrappers that just set some feature
flags. For instance to switch between user and system and with or
without deltas. This change makes those wrappers automatically
generated from a simple description of the features.
For example the test-run.sh test goes from:
- tests/test-run.sh \
- tests/test-run-system.sh \
- tests/test-run-deltas.sh \
- tests/test-run-system-deltas.sh \
to
+ tests/test-run.sh{{user+system},{nodeltas+deltas}} \
There is some complexity here because the TESTS variable in automake
can't be runtime generated, so we rewrite it during "make
update-test-matrix" and commit the result to git.
The way it works is that make update-test-matrix takes the
TEST_MATRIX_SOURCE list, passes it to tests/expand-test-matrix.sh
which generates all the combinations in tests/Makefile-test-matrix.am.inc
where a test like tests/test-foo.sh{user+system} will get
converted to tests/test-foo.sh@user.wrap and tests/test-foo.sh@system.wrap.
We then have a pattern rule matchin tests/*.wrap which will generate
a wrapper that sets the right environment flags based on $0 and then
spawns the wrapper.
Closes: #2170
Approved by: alexlarsson
This commit removes the call to flatpak_dir_update_summary() in the
create-usb implementation. It turns out that libostree does not rely on
a summary being present when a pull is local (meaning it uses a file://
URI). I'm not sure where I got the idea that create-usb depends on a
summary in the source repo. I went back to the first commit that
introduced the "ostree create-usb" command and even using that a summary
isn't required, so it seems unlikely that this changed recently.
One important benefit of removing the summary update is that currently
summary generation takes an exclusive lock, and we've seen on Endless
the attempt to acquire that lock time out (possibly due to a prune
happening in another process).
We could also remove the system-helper method UpdateSummary since it
doesn't have any users after this commit, but maybe someone will need it
in the future, and technically removing it would be an API break.
Closes: #2166
Approved by: alexlarsson
It is not really nice to have g_warnings pop out of
the library left and right, they should be replaced
by proper errors as far as possible. This is a small
start.
Closes: #2150
Approved by: alexlarsson
Add FLATPAK_ERROR_INVALID_DATA and use if for cases where
the incoming data for an update or install is faulty, and
add FLATPAK_ERROR_UNTRUSTED, FLATPAK_ERROR_SETUP_FAILED and
FLATPAK_ERROR_EXPORT_FAILED to cover more error conditions.
Closes: #2150
Approved by: alexlarsson
flatpak_fail is a convenient shortcut, but falls short
for actual error reporting. Use proper G_OPTION_ERROR
error codes here.
Closes: #2150
Approved by: alexlarsson
It may be an unlikely case, but if the same app
is installed in multiple installations, there was
no way to select which one to run, so far.
Closes: #2146Closes: #2158
Approved by: alexlarsson
flatpak_find_deploy_for_ref_in is a variation of
flatpak_find_deploy_for_ref that allows to restrict
what installations to search in.
Closes: #2158
Approved by: alexlarsson
The code was looking for a ref with the name
ostree-metadata, but using an api that falls
back to remote refs with the same name, which
is not desirable here.
Use a different ostree api instead that only
resolves local refs.
Closes: #1805Closes: #2157
Approved by: alexlarsson
We were exporting files in subdirectories of all the common
directories. This only really makes sense for icons. For
desktop files, D-Bus service files and mime types, we should
only export from the exact directory itself.
Note that this makes us no longer support the obsolescent
vendor-prefix convention of the desktop entry spec, which was
only relevant for KDE4 and breaks app-id matching.
Closes: #2142Closes: #2152
Approved by: alexlarsson
This fixes the “bwrap: Can't mkdir parents for /var/run/user/1000/.dbus-proxy/: No such file or directory” error. This error occurs on systems where the path in the XDG_RUNTIME_DIR variable contains a symlink under var, for example /var/run → /run.
The reason for the error is that bubblewrap was called both with “--bind /var /var” and “--bind /var/run/user/1000/.dbus-proxy/ /var/run/user/1000/.dbus-proxy/”. This leads to the destination path already existing but with “/var/run” being a symlink. Bubblewrap then tries to make sure the mount point is present in the sandbox and creates all the dirs with its parents, which fails for “/var/run/user” because its parent is a symlink.
This fix simply resolves the path used for the runtime dir before it adds it to the bind parameter.
Closes: #2137
Approved by: alexlarsson
Currently it's possible for Flatpak to consider a runtime used but
consider its Locale extension unused when executing `flatpak uninstall
--unused`, which doesn't make much sense. This only happens if the
runtime is indirectly used; in other words it's used as a related ref
rather than directly as the runtime of an installed app.
In the case of Endless, `com.endlessm.EknServicesMultiplexer` uses all
versions of `com.endlessm.apps.Platform`, and since v1 isn't used by any
app on this computer its Locale extension is considered unused:
$ flatpak list --runtime -a | grep com.endlessm.apps.Platform.*/x86_64/1
com.endlessm.apps.Platform.Locale/x86_64/1 system,partial
com.endlessm.apps.Platform/x86_64/1 system
$ flatpak uninstall --unused
Uninstalling from system:
com.endlessm.apps.Platform.Locale/x86_64/1
Is this ok [y/n]:
This commit changes the behavior of uninstall --unused so that when
something is considered used because it's a related ref, we recursively
check its own related refs so they are considered used too.
Closes: #2103
Approved by: alexlarsson
Mention how flatpak run handles environment variables,
and include the blacklist of variables we always override.
Closes: #2141
Approved by: alexlarsson
Based on my understanding of the matter, we claim
that FlatpakInstallation api is threadsafe.
This commit rewords things a bit, to more strongly
recommend FlatpakTransaction as the preferred API
for the tasks that it covers.
Closes: #2141
Approved by: alexlarsson
This information is nice to have. For example, it can be used
to optimize deltas by reusing delta parts from the base ref.
Closes: #2140
Approved by: alexlarsson
Split flatpak-builtins-add-remote.c into separate files
for the two commands that are defined in here, and rename
things to match the other commands.
Closes: #2132
Approved by: alexlarsson