4182 Commits

Author SHA1 Message Date
Alexander Larsson
b6a8cab35f Update pofiles 1.0.3 2018-10-04 14:54:32 +02:00
Alexander Larsson
651785c974 tests: Don't dist the .wrap files (as they don't exist) 2018-10-04 11:22:50 +02:00
Alexander Larsson
1196ff54bf Update version to 1.0.3 2018-10-04 11:08:16 +02:00
Alexander Larsson
eb5ffeab77 Update NEWS for 1.0.3 2018-10-04 11:08:05 +02:00
Alexander Larsson
a94eea8cc7 build-update-repo: Add appstream2 to the metadata cache
The old "appstream" is there already, and this allows us to get
things like download size info for it.

Closes: #2182
Approved by: alexlarsson
2018-10-04 06:58:23 +00:00
Alexander Larsson
35b92d7237 Support --allow=canbus for AF_CAN access
This fixes https://github.com/flatpak/flatpak/issues/2176

Closes: #2179
Approved by: alexlarsson
2018-10-03 14:31:30 +00:00
Kalev Lember
1a827c0469 transaction: Return G_IO_ERROR_CANCELLED when cancelled
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
2018-10-03 13:56:49 +00:00
Alexander Larsson
89e2b6679c Don't expose host /dev/shm with --device=all (fixing debian problems)
--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
2018-10-03 13:56:44 +00:00
Alexander Larsson
43c7e7eeec tests: Don't generate the .wrap tests, launch them via test-wrapper.sh
There is no need for these files to be generated on disk

Closes: #2170
Approved by: alexlarsson
2018-10-03 13:19:35 +00:00
Alexander Larsson
5ab1b99d62 tests: Run in /tmp
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
2018-10-03 13:19:35 +00:00
Alexander Larsson
5fa3fbf19e tests: Autogenerate test matrix
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
2018-10-03 13:19:35 +00:00
Piotr Drąg
58c1b9c46d Update POTFILES.in
Closes: #2172
Approved by: alexlarsson
2018-10-03 09:15:26 +00:00
Umang Jain
8da2c64fa1 dir: Fix parameter naming for consistency
Closes: #2173
Approved by: alexlarsson
2018-10-03 09:02:13 +00:00
Matthew Leeds
7c5751a4f9 create-usb: Avoid updating the source repo summary
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
2018-10-02 06:32:54 +00:00
Robert McQueen
8bd22682f7 installation: nitpicks
Make the new _run_triggers function appear correctly in GtkDoc and cross-link.

Closes: #2164
Approved by: alexlarsson
2018-10-02 06:22:27 +00:00
Matthias Clasen
823511b87a Update tests for changed errors
Great that we're actually testing these.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
868552cb1f Fix localization
On the library side, we need to include gi18n-lib in order
to use dgettext for _().

Closes: #2163

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
e9bf1c3f75 Replace a warning with an error
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
2018-10-02 06:21:49 +00:00
Matthias Clasen
56d975f8c4 Add a few more error codes
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
2018-10-02 06:21:49 +00:00
Matthias Clasen
5b9d8e5ab8 Translate more error messages
As a rule of thumb, if we use a FlatpakError, the message
is probably worth translating.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
38eebef90c Avoid flatpak_fail in ref parsing
Add an error code for invalid refs, and use it when
composing or decomposing refs.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
9d0fbdd0b4 FlatpakContext: Avoid flatpak_fail
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
2018-10-02 06:21:49 +00:00
Matthias Clasen
df4df62d04 Fix a typo
Its bwrapinfo.json, not brwapinfo.json

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Robert McQueen
33cfa59af6 installation: tidy doc comments on new API additions
Closes: #2162
Approved by: alexlarsson
2018-10-01 14:43:09 +00:00
Robert McQueen
00fcc65157 installation: fix inverted logic in new _NO_TRIGGERS flag
Philip Withnall wins today's gold star.

Closes: #2162
Approved by: alexlarsson
2018-10-01 14:43:09 +00:00
Matthias Clasen
dd7a163a28 run: Document new options
Document --user, --system nd --installation.

Closes: #2158
Approved by: alexlarsson
2018-10-01 13:05:12 +00:00
Matthias Clasen
651c86d3c6 run: Allow selecting an installation
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: #2146

Closes: #2158
Approved by: alexlarsson
2018-10-01 13:05:12 +00:00
Matthias Clasen
2290099ead Add a new utility function for finding deploys
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
2018-10-01 13:05:12 +00:00
Robert McQueen
041ae7bd99 installation: add _run_triggers function
Closes: #2161
Approved by: alexlarsson
2018-10-01 12:29:50 +00:00
Robert McQueen
3dea58b53b installation: add _NO_TRIGGERS flags to install/update/uninstall ops
Closes: #2161
Approved by: alexlarsson
2018-10-01 12:29:50 +00:00
Robert McQueen
b881d9576f dir: use g_utime in flatpak_dir_mark_changed
Avoids an un-necessary fsync() call of an empty file.

Closes: #2161
Approved by: alexlarsson
2018-10-01 12:29:50 +00:00
Matthias Clasen
6c806f2dd9 repo: Don't use remote ostree-metadata
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: #1805

Closes: #2157
Approved by: alexlarsson
2018-10-01 11:40:37 +00:00
Matthias Clasen
14cd84fa68 Be stricter about exports
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: #2142

Closes: #2152
Approved by: alexlarsson
2018-10-01 11:26:34 +00:00
Andreas Zuber
c102bd2b50 common: fix the "can't mkdir parents" error
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
2018-10-01 11:12:07 +00:00
Matthew Leeds
b0ee220d02 uninstall: Refine definition of what is used
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
2018-10-01 10:58:21 +00:00
Kukuh Syafaat
5bf5bab859 Update Indonesian translation
Closes: #2159
Approved by: alexlarsson
2018-10-01 06:31:26 +00:00
Matthias Clasen
d83adbc71a docs: Document environment variable handling
Mention how flatpak run handles environment variables,
and include the blacklist of variables we always override.

Closes: #2141
Approved by: alexlarsson
2018-09-27 07:29:18 +00:00
Matthias Clasen
24d70fee0a ref: Document thread-safety
State that FlatpakRef objects are immutable and
can thus be used freely across threads.

Closes: #2141
Approved by: alexlarsson
2018-09-27 07:29:18 +00:00
Matthias Clasen
8132978169 installation: Document thread-safety
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
2018-09-27 07:29:18 +00:00
Matthias Clasen
22f12aa7b7 transaction: Document thread-safety
Based on my understanding of the matter, we claim
that FlatpakTransaction api is threadsafe.

Closes: #2141
Approved by: alexlarsson
2018-09-27 07:29:18 +00:00
Matthias Clasen
7ea96906dc transaction: Flesh out the docs
Explain why 'transaction' is really a misnomer.

Closes: #2141
Approved by: alexlarsson
2018-09-27 07:29:18 +00:00
Matthias Clasen
1c665eca5e Merge pull request #2143 from mwleeds/runtime-error-msg-typo
common: Fix wording of missing runtime error
2018-09-26 20:53:43 -04:00
Matthew Leeds
3ac63fdcdf common: Fix wording of missing runtime error 2018-09-26 13:53:56 -07:00
Alexander Larsson
167bf49ccf build-init: Record the base ref in the metadata
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
2018-09-26 12:21:09 +00:00
Matthias Clasen
146ff4845d Update POTFILES.in
Closes: #2132
Approved by: alexlarsson
2018-09-26 09:02:42 +00:00
Matthias Clasen
5213645f58 Split a file
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
2018-09-26 09:02:42 +00:00
Matthias Clasen
dd822f2781 Rename a file
This is anther step towards making command names
match the files they are defined in.

Closes: #2132
Approved by: alexlarsson
2018-09-26 09:02:42 +00:00
Matthias Clasen
ddbf0103c6 Rename a file
This is anther step towards making command names
match the files they are defined in.

Closes: #2132
Approved by: alexlarsson
2018-09-26 09:02:42 +00:00
Matthias Clasen
de2c69c728 Rename a file
This is anther step towards making command names
match the files they are defined in.

Closes: #2132
Approved by: alexlarsson
2018-09-26 09:02:42 +00:00
Matthias Clasen
356742c7e7 Rename a file
This is anther step towards making command names
match the files they are defined in.

Closes: #2132
Approved by: alexlarsson
2018-09-26 09:02:42 +00:00