Commit Graph

7164 Commits

Author SHA1 Message Date
Alexander Larsson
83d5567a4a Update pofiles 0.11.1 2018-02-14 11:11:32 +01:00
Alexander Larsson
b497369ce3 Update NEWS for release 2018-02-14 11:06:07 +01:00
Alexander Larsson
1fe1337bea Silence coverity (CID 1465243)
Check the return value of repo_get_remote_collection_id like we do
in other places. This doesn't really affect the result, because
we return NULL both before and after in the failure case, but
it makes things clearer.
2018-02-14 10:29:48 +01:00
Alexander Larsson
f33fac310c Add fallback-x11 socket permission
This means use x11 if no alternative is present, and should be used
for applications that support both X11 and wayland, but want to be
sandboxed when running under a wayland compositor (but still want to
run under an X server).

Closes: #1416
Approved by: alexlarsson
2018-02-14 09:19:56 +00:00
Alexander Larsson
44833bcc98 Allow personality syscall in devel mode
Emacs needs ADDR_NO_RANDOMIZE during the build, and its possible
that other things do too. Also this make sense, as personality
seems like a syscall on the level of ptrace() which is already
in devel.

Closes: #1414
Approved by: alexlarsson
2018-02-13 15:43:11 +00:00
Matthew Leeds
c5ab9e22b5 dir: Check for appstream updates using P2P code
This commit breaks out the code in flatpak_dir_check_for_update() that
finds the latest revision of a ref into its own function and uses it in
flatpak_dir_check_for_appstream_update(). This allows appstream updates
to work even for offline machines.

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

Closes: #1397
Approved by: alexlarsson
2018-02-13 14:46:47 +00:00
Matthew Leeds
e95d3763fe dir: Avoid another summary fetch in P2P code
Before doing an update, flatpak fetches remote repo metadata to find
related refs and other information. But after fetching the metadata
flatpak fetches the remote summary to get the checksum that was just
fetched, which can fail if the computer is offline. So instead get the
checksum by reading the local repo, which has the side benefit of
eliminating a race condition (the summary being updated right after the
fetch happens).

Closes: #1397
Approved by: alexlarsson
2018-02-13 14:46:47 +00:00
Matthew Leeds
840683595b dir: Make untrusted local pulls aware of collection IDs
In the last step in a LAN app update when the system helper is called to
deploy the update, there's a call chain to pull from the temporary child
repo:
handle_deploy() ->
flatpak_dir_pull_untrusted_local() ->
repo_pull_one_local_untrusted() ->
ostree_repo_pull_with_options()

But since repo_pull_one_local_untrusted() isn't aware of the existence
of collection IDs, it doesn't pass a collection ID along to libostree
and sets gpg-verify-summary to true. This leads to the error "GPG
verification enabled, but no summary.sig found" because P2P code paths
don't use summary signatures.

Add the appropriate ostree pull options to
repo_pull_one_local_untrusted() so that P2P updates work when the
system-helper is used.

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

Closes: #1397
Approved by: alexlarsson
2018-02-13 14:46:47 +00:00
Matthew Leeds
1ea10e0705 dir: Don't fetch the summary unnecessarily
Currently P2P flatpak app updates aren't working when
the system installation is being used (but they work for the user
installation). This is because there's a
flatpak_dir_remote_fetch_summary() call in flatpak_dir_update() which
fails if the machine isn't connected to the Internet. And in fact we
don't need to pull the summary from the system remote, we need the one
from the temporary P2P remote, and that gets pulled as a result of the
flatpak_dir_pull() call to get the ref because
OSTREE_REPO_PULL_FLAGS_MIRROR is used. So this commit changes
flatpak_dir_update() to avoid fetching the system remote summary fetch
when P2P support and collection IDs are being used.

Similar logic applies to flatpak_dir_install() and
flatpak_dir_update_appstream() (although P2P appstream updates don't
seem to be working yet).

This is a partial fix for https://github.com/flatpak/flatpak/issues/1388

Closes: #1397
Approved by: alexlarsson
2018-02-13 14:46:47 +00:00
Matthew Leeds
19413cb02e dir: Squash empty collection IDs into NULL ones
repo_get_remote_collection_id() already squashes empty ("") collection
IDs into NULL, and ignores the collection ID when P2P support isn't
enabled. So use that helper function in
flatpak_dir_get_remote_collection_id() for consistency. At the moment
that function is only used in tests, so this doesn't immediately affect
anything.

Closes: #1411
Approved by: alexlarsson
2018-02-13 14:38:11 +00:00
Alexander Larsson
237b8ca9ff commit-from: Also copy/convert existing static deltas
When copying a commit, also bring forward any static deltas.
This is particularly interesting for flathub where we can
then generate static deltas on the build machines and then import
and sign it on the repo machine.

Closes: #1409
Approved by: alexlarsson
2018-02-13 14:30:50 +00:00
Alexander Larsson
bf53d10f47 pulseaudio: Respect pulseaudio env vars and config file
Instead of just assuming the default pulseaudio socket we look
at the same environment and config files that pulseaudio does.

This does not currently look at the X11 properties.

This is a cleaned up and rebased version of https://github.com/flatpak/flatpak/pull/1208

Closes: #1410
Approved by: alexlarsson
2018-02-12 14:57:27 +00:00
Patrick Griffis
00e13ff0bd build-bundle: Add --from-commit option
This allows building smaller bundles that are deltas
from a specific commit.

Closes: #1394
Approved by: alexlarsson
2018-02-12 14:48:08 +00:00
Matthew Leeds
94c6223045 doc: Add --timestamp option to build-export docs
Closes: #1408
Approved by: alexlarsson
2018-02-12 13:54:29 +00:00
Matthew Leeds
6ed65fec8e build-export: Fix use of uninitialized memory
This fixes build-export so that it doesn't try to use uninitialized
memory in a timestamp object when creating appstream data. Before the
--timestamp option existed, a timestamp of 0 was used, so fall back to
that. Also, update a relevant comment.

Closes: #1408
Approved by: alexlarsson
2018-02-12 13:54:29 +00:00
Matthew Leeds
6e689bf06f search: Don't print anything when updating appstream data
For the "flatpak update" it makes sense to print a message when updating
the appstream data for each remote, but it makes less sense for the
search command, because it's output should just be the table of results.

Closes: #1352
Approved by: alexlarsson
2018-02-09 11:24:41 +00:00
Matthew Leeds
1b8c6e5ce9 app: Add more debug output
Closes: #1352
Approved by: alexlarsson
2018-02-09 11:24:41 +00:00
Matthew Leeds
5ec98e788f search: Only update appstream data if it's old
Updating the appstream data on every invocation of the search command
involves a lot of overhead, so instead only update it if it's at least a
day out of date. This is consistent with how tools like dnf work.

Closes: #1352
Approved by: alexlarsson
2018-02-09 11:24:41 +00:00
Matthew Leeds
ab53313713 search: Update appstream data before searching
This commit changes the search command to update appstream data from
each remote before searching it for the specified text. This way
users don't need to know to run "flatpak update --appstream".

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

Closes: #1352
Approved by: alexlarsson
2018-02-09 11:24:41 +00:00
Matthew Leeds
9d87ef794d app: Move update_appstream to flatpak-builtin-utils.c
Move the update command's update_appstream function to flatpak-utils.c
so other commands can use it.

Closes: #1352
Approved by: alexlarsson
2018-02-09 11:24:41 +00:00
Matthew Leeds
b80191fdcd app: Print a warning if xa.metadata doesn't exist
All flatpaks built using version 0.9.4 or newer should have the
xa.metadata field in the commit metadata, so warn if it doesn't exist.

This commit changes the info command to print a warning rather than
nothing and changes the info-remote command to print a warning rather
than error out.

Closes: #1351
Approved by: alexlarsson
2018-02-09 11:08:40 +00:00
Matthew Leeds
728bb4d02e info: Show collection ID if available
If flatpak is compiled with P2P support and the commit in question has a
collection ID in its metadata, show it.

Closes: #1351
Approved by: alexlarsson
2018-02-09 11:08:40 +00:00
Kalev Lember
3e16d4ef1e Update to latest libglnx
This fixes F28 FTBFS due to incorrect copy_file_range detection.

https://bugzilla.redhat.com/show_bug.cgi?id=1541105

Closes: #1389
Approved by: alexlarsson
2018-02-09 11:00:15 +00:00
Alexander Larsson
f2a6c1db8d Remove document portal
This is now in xdg-desktop-portal. We keep a version of the document
portal dbus XML so that we avoid weird build dependencies.

Flatpak itself is technically not dependent on the document portal,
but it is very much recommended that you use it.

Closes: #1398
Approved by: alexlarsson
2018-02-09 09:23:26 +00:00
Matthew Leeds
0c3c42d8db dir: Fix typos/grammar
Closes: #1392
Approved by: mwleeds
2018-02-08 21:22:24 +00:00
Kalev Lember
a9b6e31121 lib: Make gnome-software work with an empty /var/lib/flatpak
Similar to commit 6bb0196ffd that fixed
https://github.com/flatpak/flatpak/issues/113 for the flatpak CLI, this
fixes the library so that gnome-software works with an empty
/var/lib/flatpak.

Closes: #1368
Approved by: alexlarsson
2018-02-07 08:30:19 +00:00
Alexander Larsson
e90e8b99f3 Handle non-existing document portal nicer
The document portal is essentially optional, so avoid spewing errors
if it is not available, but also report this nicer with -v.

Closes: #1387
Approved by: alexlarsson
2018-02-07 08:06:34 +00:00
Alexander Larsson
41e38774c5 document-portal: No fallback if app needs read-write but access read-only
If you're exporting a path that the target app has access to but it is
read-only and the requested permissions include write access then
we create the document rather than reusing the path.

Closes: #1387
Approved by: alexlarsson
2018-02-07 08:06:34 +00:00
Alexander Larsson
4a369285a2 info: Add support for flatpak info --file-access
This allows you to see if a particular app has access
to a specific path.

Closes: #1387
Approved by: alexlarsson
2018-02-07 08:06:34 +00:00
Alexander Larsson
ff945320aa Add info --show-permissions
This shows the active permissions for the app, including any overrides.

Closes: #1387
Approved by: alexlarsson
2018-02-07 08:06:34 +00:00
Alexander Larsson
6e1819aef0 common: Add flatpak_exports_path_get_mode
This is similar to flatpak_exports_path_is_visible, but you also
know if the path is read-write or read-only.

Closes: #1387
Approved by: alexlarsson
2018-02-07 08:06:34 +00:00
Matthew Leeds
f53a738813 common/dir: Improve 'No such ref' error messages
If a ref can't be found in a remote it could be because it's truly not
there or it could be that the collection ID configured locally doesn't
match the one on the remote. This commit improves the "No such ref"
error message to include the collection ID in two more locations in
flatpak-dir.c to make it easier to debug "wrong collection ID" errors.

Closes: #1384
Approved by: pwithnall
2018-02-06 10:53:43 +00:00
Alexander Olofsson
3585651be7 Add semantic support for network installations
Closes: #1348
Approved by: alexlarsson
2018-02-06 09:19:34 +00:00
Matthew Leeds
32723a2b1d doc: Fix build-bundle docs
The build-bundle command takes a repository directory, not a build
directory.

Closes https://github.com/flatpak/flatpak/issues/1382

Closes: #1385
Approved by: alexlarsson
2018-02-06 09:10:42 +00:00
Piotr Drąg
12117e8820 Update POTFILES.in
Closes: #1383
Approved by: mwleeds
2018-02-06 06:30:16 +00:00
Matthew Leeds
3a14aef1d2 doc: Document -vv option
Closes: #1377
Approved by: alexlarsson
2018-02-05 15:58:29 +00:00
Matthew Leeds
fd94d07883 dir: Emit an error on non-root downgrade attempts
For security, only root can downgrade flatpaks in the system
installation. However, the error message explaining this when a normal
user attempts a downgrade was removed in commit 44cf5076f. This commit
adds back the error message.

Since the current behavior is for a downgrade by a non-root user to fail
with the message "No updates", this commit doesn't fix a security issue.
It's purely about usability.

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

Closes: #1366
Approved by: alexlarsson
2018-02-05 15:49:10 +00:00
Philip Withnall
fddf7506ec common/dir: Skip progress reporting while setting up extra-data
It’s somehow possible (I haven’t investigated how) for
flatpak_dir_setup_extra_data() to be called before the main keys (such
as `outstanding-fetches`) are set on a new OstreeAsyncProgress during a
flatpak_dir_pull() call with no OstreeAsyncProgress object provided by
the caller.

This means that an OstreeAsyncProgress with only the extra-data keys
would be passed through to
ostree_repo_pull_default_console_progress_changed(), which would cause
an assertion failure when it tried to read the `outstanding-fetches`
key.

Avoid that by not calling
ostree_repo_pull_default_console_progress_changed() until
`outstanding-fetches` is set.

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

Closes: #1361
Approved by: alexlarsson
2018-02-05 15:39:45 +00:00
Matthew Leeds
3e143faf6a doc: Fix docs for --update-appstream
We no longer run appstream-builder (see commit 455d3a7b2) so update the
documentation for the --update-appstream option.

Closes: #1360
Approved by: alexlarsson
2018-02-05 15:29:34 +00:00
Aaron Maynard
2126fa59dc Create CODE_OF_CONDUCT.md
Closes: #1349
Approved by: alexlarsson
2018-02-05 15:21:40 +00:00
Matthew Leeds
9ff37d2624 README: Add a Contributing section
Closes: #1381
Approved by: alexlarsson
2018-02-05 15:11:44 +00:00
Matthew Leeds
8d49b6d326 README: Add links to the IRC and mailing list
Closes: #1381
Approved by: alexlarsson
2018-02-05 15:11:44 +00:00
Alexander Larsson
d6911d9318 Remove unused variables
Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
3b1b9c65cd Move chunk of filesystem setup from flatpak-run.c to FlatpakContext
This way the filesystem setup is centralized in one place.

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
38e2a5decc Rename some FlatpakContext functions
Since flatpak_export_paths_export_context and flatpak_exports_from_context
are now in flatpak-context.c we make them begin with flatpak_context_

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
01156880dc Move flatpak_export_paths_export_context & flatpak_exports_from_context
These make more sense in flatpak-context.c, as they touch its FlatpakContext

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
1230ee85cc Move FlatpakExport to its own file
This is pure code motion

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
69d81df46f Add flatpak_exports_add_home_expose
This means we don't have to poke at exports internals

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
8ef735369d Break out FlatpakBwrap to its own file
This is pure code motion

Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00
Alexander Larsson
eb692a9bb8 Move buffer_to_sealed_memfd_or_tmpfile to flatpak-utils.h
Closes: #1374
Approved by: alexlarsson
2018-02-05 14:31:30 +00:00