3623 Commits

Author SHA1 Message Date
Alexander Larsson
a93401479d Update pofiles 0.11.5 2018-04-30 14:38:25 +02:00
Alexander Larsson
509ffff9c5 Bump version to 0.10.5 2018-04-30 14:36:30 +02:00
Alexander Larsson
1d7ec5882a Update NEWS for release 2018-04-30 14:36:22 +02:00
Alexander Larsson
94ce9da571 dir: Fix saving of features in metadata
This fixes https://github.com/flatpak/flatpak/issues/1617
2018-04-30 14:33:38 +02:00
Alexander Larsson
5122766284 dir: Fix prefix matching to allow all you to own all org.App.Id.* names
Its always been allowed to own all subnames, but https://github.com/flatpak/flatpak/pull/1589 regressed
that as it meant apps were not allowed to export matching service files.

This fixes https://github.com/flatpak/flatpak/issues/1627
2018-04-30 14:33:13 +02:00
Matthew Leeds
2a9523b56a dir: Sometimes avoid summary use during local pulls
This commit changes flatpak_dir_pull_untrusted_local() to avoid using
the summary file in the source repo if a collection ID is set and use
ostree_repo_resolve_rev() instead in that case. Since summary signatures
are not part of the security model when collection IDs are used, this
doesn't change any security properties. But it does make pulls succeed
when there's nothing to do (i.e. the child repo has no refs because the
parent repo already has the desired commit). In that case, the summary
file will be empty if collection IDs are being used because of
child_repo_ensure_summary().

The end result of this is that "flatpak update --appstream" works when
there's a collection ID set on the remote and the appstream is already
up to date locally. This problem only recently became visible because
flatpak_dir_check_for_appstream_update() was removed in a recent commit.

This is a partial fix for https://github.com/flatpak/flatpak/issues/1615
2018-04-30 14:33:09 +02:00
Matthew Leeds
53c4a1054d app: Fix a memory leak of remote names 2018-04-30 14:33:09 +02:00
Matthew Leeds
74aa0130b0 dir: Fix a memory leak of checksum data 2018-04-30 14:33:09 +02:00
Matthew Leeds
102af70c0e dir: Properly get appstream checksum from child repo
In flatpak_dir_update_appstream(), we check for the appstream ref after
pulling it and before deploying it. When the system helper is not being
used we properly include the remote name in the refspec passed to
ostree_repo_resolve_rev(), so this commit does the same for the system
helper case. Otherwise we might end up with the checksum for an
appstream ref from another remote because of the relationship between
the child and parent repos. This doesn't have any user visible effect
except preventing a "false positive" of thinking an appstream pull was
successful when it wasn't.
2018-04-30 14:33:09 +02:00
Matthew Leeds
6e4d686f8e dir: Don't hide appstream update error messages
Currently we try to update the "appstream2" branch and if that fails try
to update the "appstream" branch. If that fails too we return the error
message from the appstream2 update, which can be misleading. So this
commit combines both error messages into one so you get something like
this:

$ flatpak update --appstream tamaulipas-apps
error: Error updating appstream2: No such ref 'appstream2/x86_64' in
remote tamaulipas-apps; Error updating appstream: Update is older than
current version

That should make debugging easier for
https://github.com/flatpak/flatpak/issues/1615.
2018-04-30 14:33:09 +02:00
Simon McVittie
23a51ffa7c Don't distribute generated GDBus bindings for Flatpak portal
Closes: #1618
Approved by: alexlarsson
2018-04-30 12:20:13 +00:00
Rafael Fontenelle
364c7225d4 Update Brazilian Portuguese translation
Closes: #1624
Approved by: alexlarsson
2018-04-30 12:10:55 +00:00
Matthias Clasen
18e9aae7a3 portal: Document the interface
Document the flatpak portal in the same style as
other portals are.

Closes: #1619
Approved by: alexlarsson
2018-04-27 11:03:34 +00:00
Matthew Leeds
ff93f89eb5 lib: Don't try to read uninitialized memory
Oddly this uninitialized memory read leads to a seg fault on ARM but
not on x86_64.

Closes: #1621
Approved by: mwleeds
2018-04-26 23:22:32 +00:00
Matthew Leeds
460fb8e267 dir: Fix typo in error message 2018-04-26 14:02:52 -07:00
Alexander Larsson
b5571fa039 Update pofiles 0.11.4 2018-04-26 14:58:12 +02:00
Alexander Larsson
6bf17b729e Update to latest libglnx 2018-04-26 14:31:47 +02:00
Alexander Larsson
039b34945d Bump version to 0.11.4 2018-04-26 11:51:02 +02:00
Alexander Larsson
257040021e Update NEWS for release 2018-04-26 11:50:38 +02:00
Alexander Larsson
442c0be116 common: Move flatpak-portal-error.[ch] back to common code
A symbol from this (flatpak_portal_error_quark) was leaked to libflatpak
due to being marked FLATPAK_EXTERN, so to keep ABI we move it back.

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

Closes: #1616
Approved by: alexlarsson
2018-04-26 07:41:17 +00:00
Alexander Larsson
0be21395cb Transaction: Add operation dependencies
This means we track why an operation was queued. For example, that a runtime
installation/update was queued because an app needed it. We then mark operations
that failed, so that the app will not be installed if the runtime install failed.

There is one case where we do allow the installation to succeed, when an app
relies on a runtime which is installed, but the update of it failed. The
app should then still work, and we don't want to block installation/update
of an app if the runtime repository is down.

Closes: #1611
Approved by: alexlarsson
2018-04-26 07:16:30 +00:00
Matthew Leeds
b1dedd2f3f utils: Don't segfault on 32 bit ARM
On 32 bit ARM platforms, flatpak_get_compat_arch() returns NULL, so
handle that gracefully in flatpak_get_arches().

Closes: #1614
Approved by: alexlarsson
2018-04-26 07:16:15 +00:00
Sam Spilsbury
9665bb9a3f utils: Assert if the caller passes a NULL outparam
We write to it unconditionally

Closes: #1606
Approved by: alexlarsson
2018-04-25 11:09:41 +00:00
Kukuh Syafaat
593159a787 Update Indonesian translation
Closes: #1610
Approved by: alexlarsson
2018-04-25 11:01:05 +00:00
Sam Spilsbury
70bb192204 dir: Don't clobber out_matches_prefix_func
Closes: #1608
Approved by: mwleeds
2018-04-24 18:22:24 +00:00
Matthew Leeds
9dc880f70e dir: Fix return value in get_permissible_prefixes() 2018-04-24 11:18:09 -07:00
Alexander Larsson
955c8b3893 libflatpak: Support eol[-rebase] in FlatpakInstalledRef 2018-04-24 10:30:28 +02:00
Alexander Larsson
f4460bcf3f libflatpak: Fix leak in FlatpakRemoteRef 2018-04-24 10:30:28 +02:00
Alexander Larsson
f144c9fd52 portal: When spawning use the same runtime as the caller
Otherwise flatpak-spawn breaks when you e.g. `flatpak run -d`, because
the `--commit=` argument we use does not match the default runtime.
2018-04-24 10:30:06 +02:00
Alexander Larsson
7dd92d8a9b build-update-repo: Fix org.telegram.desktop icons
The telegram app id is org.telegram.desktop, and its appstream
component id is org.telegram.desktop.desktop, which we did not
properly handle (we special cased the app-id-ends-with-desktop case
and then did not remote .desktop). This replaces that with a more
approach that *always* matches the whole app id as prefix, and then
replaces a ".desktop" in the suffix part only.

Closes: #1593
Approved by: alexlarsson
2018-04-23 12:20:15 +00:00
Sam Spilsbury
099278a88a dir: Start rewrite exports source_path from "", not "export"
We start exploring the directory tree relative to export/, so
we don't want to include that component.

Closes: #1602
Approved by: alexlarsson
2018-04-23 12:10:14 +00:00
Alexander Larsson
882440b1d7 build-finish: Add --remove-extension
This allows you to remove extensions at the end of the build which were
only used during the build.

Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00
Alexander Larsson
b09059ca2c build-init: Add --extension support
This works just like in build-finish, but the main difference is
that the extension point is added early, so that the build itself can use it.

Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00
Alexander Larsson
4246a20393 build: Respect app extensions when building
Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00
Alexander Larsson
8ba59f093b build: Always allow multiarch when building stuff
This is similar to allowing devel.

Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00
Matthew Leeds
e1e64e4d25 lib: Make metadata optional in FlatpakRemoteRef
Sometimes we're not able to access the `xa.cache` data that's usually in
the summary and ostree-metadata, such as when the remote is a USB drive
that had `ostree summary -u` run on it. In that case, we don't want
flatpak_remote_ref_new() to fail, because the FlatpakRemoteRef instance
might still be useful enough without the metadata, such as in
flatpak_installation_list_remote_refs_sync. So this commit makes the
metadata property of FlatpakRemoteRef nullable which has the effect of
making the test_list_refs_in_remote() test pass with P2P enabled.

The metadata property wasn't added to FlatpakRemoteRef until commit
c33f842b7 so presumably no one is depending on it.

Closes: #1600
Approved by: alexlarsson
2018-04-23 06:33:28 +00:00
Alexander Larsson
4da56c8c62 RemoteState: Drop cancallable from flatpak_remote_state_lookup_cache()
This is a no-i/o operation on immutable data, there is no need for
a cancellable.

Closes: #1594
Approved by: alexlarsson
2018-04-20 11:16:57 +00:00
Alexander Larsson
7a61658012 RemoteState: Don't unnecessary strdup the metadata
This makes flatpak_remote_state_lookup_cache() return the metadata
from the actual FlatpakRemoteState rather than duplicating it.
All callers are updated to not free anymore and to strdup if needed.

Closes: #1594
Approved by: alexlarsson
2018-04-20 11:16:57 +00:00
Alexander Larsson
7386485bea Fix unused variable warning
Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
30bfc901d5 appstream: Allow system-helper update for local non-gpg remotes
This is safe as we do the pull locally, and root configured the local
path. We already do the same for regular installs, so its weird that
its not done for appstream.

Should fix https://github.com/flatpak/flatpak/issues/1580

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
ef80dd9947 appstream: Update appstream2 branch by default
By default we use the new appstream2 branch if it exists in the remote,
also in this case we compress the xml when deploying to be backwards
compat with the old deploys.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
7fd085acd7 appstream: Generate appstream2/$arch branches with uncompressed xml
These delta better, and the files will be downloaded as compressed
.filez objects anyway.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
5102a19d22 appdata: Sort by ref-order to make appdata stable
This is nice for e.g. doing deltas of them.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
33c8e29d3f appdata: Only pull appstream branch for main arch
Now that it also includes compat refs as needed we don't need to
pull other branches.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
484c743e4a appdata: Include compatible arches in main arch when unique
For example, if a i386 build is in the repo but no x86-64 version then
also add the i386 build to the x86-64 appstream data.  However, don't
add it if that would cause a duplicate (i.e. both the x86-64 and i386
version).

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
4fbf50d7b7 appstream: Check appstream timestamp when updating single remote too
Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
096f7d4fb5 appstream: Drop flatpak_dir_check_for_appstream_update
This early bailout is not really needed, because noop updates is
pretty fast. Also, doing that breaks the timestamp updates.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Matthew Leeds
9afca51507 remote-ls: Allow a URI instead of remote name
This fixes the ability of the remote-ls command to take a file:// URI
instead of a remote name, which is especially useful for repos on USB
drives (created via `ostree create-usb`) which are temporary and don't
warrant being added to the repo config. This commit also updates
relevant documentation, adds a unit test, and updates a few variable
names to improve readability.

I can't find a commit in the history where this was working, but it's
working on the Endless fork of flatpak so I think there was agreement at
some point that it's desired behavior.

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

Closes: #1587
Approved by: mwleeds
2018-04-19 20:59:34 +00:00
Matthew Leeds
79907f4236 dir: Fetch ostree-metadata independently of summary
Currently _flatpak_dir_get_remote_state() only fetches the
ostree-metadata ref if it was able to fetch the remote summary, but this
is unnecessary because we don't need to know the checksum just to fetch
it, and this is especially problematic in the offline use case when the
remote summary can't be fetched. So this commit makes flatpak fetch
ostree-metadata even if the summary fetch failed, which is consistent
with how things worked before commit fedb0e5bd.

Closes: #1587
Approved by: mwleeds
2018-04-19 20:59:34 +00:00
Joaquim Rocha
0bb024869a lib/installation: Don't try to find dynamic remotes when not needed
When getting the dynamic remotes for the installed refs, if no refs
with a collection ID are found, then the ostree_repo_find_remotes_async
is given an array with just NULL, which makes it early return and thus
it would result in an infinite loop in
flatpak_installation_list_installed_refs_for_update.

This patch only tries to find the dynamic remotes when there are such
refs, thus preventing the mentioned error and any extra unnecessary
processing.

Closes: #1587
Approved by: mwleeds
2018-04-19 20:59:34 +00:00