When the uninstall operation was moved to FlatpakCliTransaction the
prompting moved there. Unfortunately some prompting was left over
in the main code, this just deletes that.
This fixes#1928Closes: #2056
Approved by: alexlarsson
If some app uses a particular runtime as an sdk, consider it used.
This means if you once downloaded the sdk for some app you're debugging
it will not be removed until that app is uninstalled.
Its unclear exactly whether this is "used", but lets error on
the side of not deleting stuff.
Closes: #2057
Approved by: alexlarsson
This option shows the contents of an override file. If an appid
is given, it shows overrides for that app, otherwise
the global overrides.
Closes: #2041
Approved by: alexlarsson
This option removes an override file. If an appid
is given, it removes overrides for that app, otherwise
the global overrides.
Closes: #2041
Approved by: alexlarsson
The current pid column reports the pid of the bwrap
wrapper process running outside the sandbox. Add a
child-pid column that reports the pid of the main
sandbox process ("PID 1" on the inside).
Closes: #2039
Approved by: alexlarsson
This enumerates running Flatpak instances.
For now, we just print the app ID and the PID.
More details can be added in the future.
Closes: #2023
Approved by: alexlarsson
Store the pid of the bwrap process which gets spawned or exec'ed
by flatpak inside the instance directory. This can be useful
for others, such as gnome-software, or a future 'flatpak ps'
command.
We write the pid to a file named 'pid'. It will get cleaned
up together with the instance directory.
Closes: #2023
Approved by: alexlarsson
Currently the create-usb command reads the subpaths listed in the
flatpak deploy data and just passes those to the ostree pull operation
to copy them to the USB. But this is not the correct way to handle them,
and leads to installs from the USB failing in the case where the locale
is partial (more specifically the install of the main ref succeeds but
the install of the locale extension doesn't).
So this commit changes create-usb to handle subpaths the same way
flatpak_dir_pull() and flatpak_dir_deploy() do, which is to copy the
/metadata path along with a subdirectory of /files for each listed
subpath. So in the case of an English partial locale, /metadata and
/files/en will be copied to the USB drive, and those are the subpaths
that will be pulled during the install (if the installing computer also
uses English).
Closes: #1972
Approved by: alexlarsson
This only fixes the leak when we don't hit an error condition. To fix it
in that case we need an autoptr for deep lists.
Closes: #1966
Approved by: alexlarsson
It's a good idea to NULL initialize g_autoptr/g_autofree variables, so
we can be sure uninitialized memory isn't passed to g_free or similar.
Closes: #1968
Approved by: alexlarsson
The old pattern of using a separate 'OCI' flag was very ugly
internally in the code once it was extended to flatpak bundles and
flatpakrefs - using a different URI scheme means that the nature
of the remote can't be accidentally lost in some part of the code.
Probing would be possible as well, but would make it difficult to
add a remote when offline, and also doesn't deal well with the
fact that our data layout is different for the two types of remotes -
the type of remote could change at any point!
As a side effect this change enables flatpakrefs and flatpak bundles for OCI
registries.
This mirrors ostree commit --disable-fsync and is useful in some cases.
For instance, we'd like to use it when building the temporary import
repositories in flathub.
Closes: #1951
Approved by: alexlarsson
Now that appstream data and icons are retrievded from the index, the OCI
code is expected to be fully usable, and to work with registries as they
will actually be deployed.
Closes: #1910
Approved by: alexlarsson
Checking the registry against a previous etag is now handled inside
flatpak_cache_http_uri(), so remove the etag parameters that were
previously passed around in various places for simplicity.
Closes: #1910
Approved by: alexlarsson
Previously the code assumed that appstream data was stored in a separate
OCI image in the registry. Replace that with storing the appstream data
and icons as image annotations. When we download a new version of the
image index, the appstream data is combined, and icons are downloaded
as necessary.
Since there is no longer a content hash for the appstream data, it's
not practical for the user to download the appstream data and pass it
to the system helper, instead the system helper just downloads the
appstream data directly.
Closes: #1910
Approved by: alexlarsson
Copying refs from the system repo into a repo on a USB drive requires
the summary in the system repo to be up to date (and similarly for other
flatpak installations like a per-user one). At the moment we expect the
user to run `sudo ostree summary -u` before `flatpak create-usb` which
is a bad user experience. Another option is to set
`core.auto-update-summary` to true on the ostree repo config, but there
are significant performance concerns with that: it involves updating the
summary after every transaction rather than only when we need it. So
this commit changes the create-usb command to use the "UpdateSummary"
system-helper method to update the summary in the source repo before
copying to the destination. This strategy allows us to continue to let
non-root users use `flatpak create-usb`. This commit also tries to
update the remote repo metadata and appstream data for each remote
before copying to the USB, because we can now do that without
invalidating the summary.
Closes: #1945
Approved by: alexlarsson
We need all_collection_ids to be initialized outside the loop that
iterates over all the refs; otherwise it only has the collection IDs
from the last ref (and related).
This fixes a bug where flatpak only includes the ostree-metadata and
appstream data for the collection IDs associated with the last ref given
on the command line and its runtime and related refs. So flatpak now
includes ostree-metadata and appstream data for collection IDs
associated with all the refs given (and their runtimes and related
refs).
Closes: #1930
Approved by: treitter
Currently the create-usb command looks for a runtime for every ref
passed to it, whether it's an app or runtime. This leads to an error
when a runtime was specified because runtimes don't have runtimes.
Normally you shouldn't need to pass a runtime to create-usb because it
finds dependencies on its own, but you conceivably could (and in fact
the eos-updater-prepare-volume tool in Endless does in order to make
sure an icon theme "runtime" is included with OS updates).
This commit fixes the issue by only checking for runtimes for apps. The
way it's written takes extra care to ensure the FlatpakKinds value used
is based on the ref value used, to protect against the case where one ID
exists in multiple installations with a different kind in each one, even
though it's hard to imagine that happening in actual use.
It's difficult to add a unit test for this at the moment since the unit
test for create-usb is blocked in
https://github.com/flatpak/flatpak/pull/1877Closes: #1924
Approved by: treitter
Since the create-usb command doesn't run as root (and if it did GNOME
Software wouldn't be able to call out to it), it can't update the
summary file in the source repo if the system installation is being
used. So the user is expected to run `ostree summary -u` before using
create-usb. But if the create-usb command then updates the appstream
data and repo metadata refs, the summary will no longer point to the
latest commits on those refs. As a short term fix, avoid updating the
appstream data and repo metadata, and mention in the manpage that the
user should do so. The better solution, not requiring any manual steps
on the user's part, will require a fix for
https://github.com/ostreedev/ostree/issues/1664.
This adds the flatpak_transaction_add_install_flatpakref method
to easily install from flatpakref files. It additionally
adds a new signal called add-new-remote which is called in two
cases:
To ask if the user wants to add a "normal" remote for the url
specified by a flatpakref file.
When a new remote is required for the runtimes the application
depends on.
Closes: #1868
Approved by: alexlarsson
With the newly introduced generated sources in app/,
the (parallel) GNOME ci builds were failing. Add the
generated sources to BUILT_SOURCES to fix that. For
good measure, also add them to CLEAN_FILES.
Closes: #1843
Approved by: mwleeds