| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
We were only handling the old single-value 'version' key, even though
we handled the 'versions' key when finding remote related refs.
The result of this was that some extensions, such as the 19.08 opengl
default one was installed by default (as it was found as remote related)
yet still removed with --unused (as it was not locally related).
Fixes https://github.com/flatpak/flatpak/issues/3004
|
|
|
|
|
| |
This puts the checksum autoptr in the inner scope of the loop where
it gets assigned to avoid leaking all but the last iteration value.
|
|
|
|
|
| |
Closes: #3067
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently if you delete a remote when it still has installed apps (using
--force), you're then unable to uninstall those orphaned apps (or
runtimes). This commit makes the uninstall operation succeed despite the
missing remote. Since we don't need a FlatpakRemoteState for an
uninstall operation, just avoid calling flatpak_ensure_remote_state().
Also, do some refactoring in flatpak_transaction_real_run() that should
improve readability and allows us to add a g_return_val_if_fail() in the
helper function, which ensures that only uninstall operations are
allowed to not have remote state.
This also includes a unit test for uninstalling with a missing remote.
Fixes https://github.com/flatpak/flatpak/issues/1982
Closes: #3067
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is similar to the last commit in that it's making
flatpak_dir_find_local_related_for_metadata() tolerant of a condition
that happens in the wake of the user running "flatpak remote-delete
--force ...". Since that command deletes refs tied to the remote being
deleted but leaves behind installed apps/runtimes, and
find_local_related_for_metadata() uses flatpak_repo_resolve_rev() to
check for extensions' existence, it misses any that are associated with
a deleted remote.
The effect of this is that if I run "flatpak remote-delete --force
kdeapps" followed by "flatpak uninstall org.kde.okular", org.kde.okular
is removed but org.kde.okular.Locale is left behind.
So this commit makes find_local_related_for_metadata() check for a
deploy of each extension if it can't find its ref, and finding either
one is reason enough to return it to the caller (which for an uninstall
operation means it will be deleted). We can't just check for the deploy,
because as evidenced by the "deployed" argument of
flatpak_dir_find_local_related(), the ref in question is not always
deployed (which presumably means the extension can't be expected to be
deployed either).
Closes: #3067
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a step toward the goal of making uninstalls work when the
corresponding remote is missing, this commit makes
flatpak_dir_find_local_related_for_metadata() tolerant of the specified
remote being missing. To do this we get the collection ID from the
commit metadata rather than the remote config, which is more robust
anyway since in some cases the commit's collection may not match that of
the remote (see https://github.com/flatpak/flatpak/issues/1477).
This commit also changes the call sites of
flatpak_dir_find_local_related_for_metadata() so they pass in the commit
to be used, which means resolving transaction operations to a commit
even for uninstall operations (just the current installed commit).
Closes: #3067
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
flatpak_dir_collect_deployed_refs() has the order of its "branch" and "arch"
arguments wrong, as does its only caller flatpak_list_deployed_refs().
When flatpak_list_deployed_refs() is called by add_extension() the arch
is put in the branch argument and vice versa. But then in the
implementation the arch is used as if it's the branch and vice versa, so
there's no functional bug here. Fix the order for readability.
Similarly, flatpak_list_unmaintained_refs() has the order wrong, but the
confusion is only within that function, since the order is correct in
its caller add_extension() and in the function it uses,
flatpak_dir_collect_unmaintained_refs(). So there's no functional bug
there either, but fix the order.
Closes: #3067
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently "flatpak --installation=default info ..." leads to an
assertion failure:
$ flatpak --installation=default info us.zoom.Zoom
(flatpak info:24593): GLib-GObject-CRITICAL **: 10:01:36.040: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
This is because in flatpak_find_installed_pref(), we set "dir =
installation_dir" but then installation_dir is freed by g_autoptr before
we try to return dir.
Fix the problem by stealing the pointer, and doing the same for the
other places dir is set.
Closes: #3077
Approved by: alexlarsson
|
|
|
|
|
|
|
| |
Just replace hardcoded strings with the macro, no functional change.
Closes: #3077
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the FlatpakDir object for the default system installation is
constructed differently depending on where the construction is
happening. In flatpak_dir_get_system_default() it's created with a NULL
DirExtraData object which means flatpak_dir_get_id() returns NULL when
called on it. But if constructed in
flatpak_get_system_base_dir_locations(), the FlatpakDir object gets a
DirExtraData object with the default values, including the id "default",
so flatpak_dir_get_id() returns "default" for it.
This commit changes flatpak_dir_get_system_default() so it constructs
the default object consistently with the other construction. This means
that in the places where the dir id is compared to "default" that check
will work correctly. Practically this means for CLI transactions the
"Proceed with these changes?" prompt will say "the system installation"
rather than "the Default system installation".
Also change flatpak_dir_get_system_by_id() so it returns the default dir
when id == "default", but continue to also return it if id == NULL. This
means the --installation=default CLI option will work correctly, but we
can avoid breaking any software that might currently be calling
flatpak_installation_new_system_with_id() with a NULL id.
And finally change flatpak_dir_get_display_name() so it continues to
return "Default system installation" for the default system
installation.
Closes: #3077
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #3088
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
| |
Attempt to fix the CI failure when running "yum -y install
@buildsys-build". This is copied from
https://github.com/ostreedev/ostree/commit/d85366d52
Closes: #3088
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need at least GLib 2.60.1 for this PR:
https://github.com/flatpak/flatpak/pull/2797
Don't update the host distro for the docker run, since F30 Atomic
doesn't exist yet. That's fine though, since the F30 container is
available.
Closes: #3088
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
| |
This was happening for the org.opencontainers.image.ref.name annotation
when we're in labels mode, but might as well be handled in a generic
way.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
| |
If we're using labels the annotations hashtable may be NULL, which
was causing a crash. Just do an early check.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
| |
When we export a manifest to the index, always pass the ref we're
targeting instead of relying on the org.opencontainers.image.ref.name
annotation, because that may not be set if we're using labels instead.
This is no big deal, because we know what ref we're handling anyway.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
| |
If repo uri has ?index=label then query for labels, otherwise
keep querying for annotations like before.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
| |
This allows the user to pick at runtime whether to use
annotations or labels as OCI metadata carrier. For historical
reasons annotations is the default, but some registries don't
support this and then you can use labels instead.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now pull the image config as well as the manifest and fall
back on the labels field if the keys we're looking for are not
in the annotations field.
This lets us support docker manifests too, which don't have
annotations (but do have labels).
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
| |
We can't use load_versioned() for images because in the docker
case there is no mediatype field.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
| |
This is not compatible with the old stuff, but works with registries
that only support the docker manifest format.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
|
|
|
| |
This doesn't change the behaviour, it just breaks out everything related
to flatpak-specific annotations into one place where it can be resued.
Closes: #2978
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #3068
Approved by: mwleeds
|
|
|
|
|
| |
Closes: #3068
Approved by: mwleeds
|
|
|
|
|
| |
Closes: #3063
Approved by: mwleeds
|
|
|
|
|
| |
...by moving everything selinux specific into the scope of the
if.
|
|
|
|
|
|
|
|
|
|
| |
This prevents a crash in flatpak_installation_list_remotes_by_type() if
the `FlatpakDir` can’t ensure it has a repo configured.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #3028
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The org.freedesktop.Flatpak user D-Bus service isn't just used by
flatpak(1) or applications running as Flatpaks. It's also used by
toolbox(1) for similar reasons:
* To keep various configuration files inside the container
synchronized with the host
* To let the container request certain commands to be run on the host
The org.freedesktop.Flatpak D-Bus service itself doesn't need much in
the way of dependencies, but inherits a lot of unused shared library
linkages through the libflatpak-common.la convenience library. Removing
these unused shared libraries reduces the footprint of toolbox(1) for
those who care about such things. eg., Fedora CoreOS.
This commit brings down the number of shared libraries to 19 from 62.
Closes: #3052
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
| |
... by moving the definition of FlatpakHostCommandFlags from the
'common' sub-directory to 'session-helper'. It hasn't been used by
anything else ever since flatpak-builder was moved to a separate
repository in commit 52bd14656151fe63.
Closes: #3052
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
| |
The libxml API is used in a relatively few places inside the 'common'
sub-directory. It's definitely not as widespread as GLib. A subsequent
commit will leverage this to prevent unused shared libraries from
being linked to the session helper.
Closes: #3052
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
| |
The libarchive API is used in a relatively few places inside the
'common' sub-directory. It's definitely not as widespread as GLib. A
subsequent commit will leverage this to prevent unused shared
libraries from being linked to the session helper.
Closes: #3052
Approved by: alexlarsson
|
|
|
|
|
| |
Closes: #3056
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the download URL for an icon was already cached locally, the HTTP
code returned FLATPAK_OCI_ERROR_NOT_CHANGED - this was treated as a real
error, and after downloading missing icons, all present icons were
deleted!
See https://bugzilla.redhat.com/show_bug.cgi?id=1683375
Closes: #3048
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unfortunately in commit 253fcc6e3 I broke the build-bundle command so
that it is unable to resolve remote refs (as opposed to local ones).
This means in the normal case of building a bundle for an app installed
from a remote it fails:
$ flatpak build-bundle /var/lib/flatpak/repo gnome-calculator.flatpak org.gnome.Calculator stable
error: Refspec 'app/org.gnome.Calculator/x86_64/stable' not found
This is because flatpak_repo_resolve_rev() interprets a NULL remote name
to mean the ref is local (in refs/heads/) but in this case we just don't
know which remote it's from. This commit fixes the issue by using
ostree_repo_resolve_rev() directly which searches refs/heads/ and
refs/remotes/, and if that fails falling back to iterating over refs
returned by ostree_repo_list_collection_refs() to catch collection-refs
that may be in refs/mirrors/.
Also, add a unit test that fails without this patch.
Fixes https://github.com/flatpak/flatpak/issues/3026
Closes: #3032
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's an error to call g_set_error() on an error that's already set, and
flatpak_dir_get_deploy_data() already sets FLATPAK_ERROR_NOT_INSTALLED
for us when necessary, so just pass on any errors to the caller of
flatpak_dir_get_origin(). In the case that the error is something else,
that should be treated as an error, because we never expect the deploy
directory to exist but not have a deploy file (see the implementations
of flatpak_dir_deploy() and flatpak_dir_undeploy()).
Closes: #3032
Approved by: alexlarsson
|
|
|
|
|
|
|
|
| |
Use the correct NONE flag, although both are 0 so this change won't make
any functional difference.
Closes: #3032
Approved by: alexlarsson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The docs for flatpak_is_valid_branch() say branch names can't start with
a digit but the implementation doesn't enforce this, and we have lots of
branches out in the wild that start with a digit (e.g. "3.32" and
"5.12"). So make the docs imply that branches can start with a digit.
The implementation also disallows "." as the leading character for a
branch, so add that to the docs. I'm just guessing that "." was intended
to be disallowed but it makes sense; otherwise the file we create named
with the branch would be hidden.
Closes: #3023
Approved by: alexlarsson
|
|
|
|
|
|
|
| |
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #3031
Approved by: mwleeds
|
|
|
|
|
|
|
| |
Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>
Closes: #3025
Approved by: matthiasclasen
|
|
|
|
|
|
|
|
|
| |
flatpak_transaction_add_install_bundle()
Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>
Closes: #3025
Approved by: matthiasclasen
|
| |
|
| |
|