In some cases, when NULL was passed for an OstreeProgress,
the library code would instantate its own progress object
and write progress information out to the console. That
is not a good thing for a library to do - it has the
potential to mess up the cli tools output.
Stop doing this, and require that all callers pass
a non-NULL progress.
Closes: #2468
Approved by: alexlarsson
Ostree just gives us a generic G_IO_ERROR_FAILED (boo!),
so we need to scrape the message to infer that this was
out-of-space. Translate this to an explicit error code
that we handle in the UI.
Closes: #2477
Approved by: alexlarsson
Move this typedef to flatpak-complete.h, where it
belongs. Also add a autoptr definition for it and use
it to avoid leaking the completion in flatpak-main.c.
Closes: #2534
Approved by: alexlarsson
FlatpakInstance was not dealing well with sandboxes
that don't have an application. In this case, the
metadata does not have an Application group, but
a Runtime group instead.
Closes: #2482
Approved by: matthiasclasen
'flatpak install sdk' offers me 34 choices, so double digits
seem very realistic here. Make the numbers line up in this
case.
Closes: #2476
Approved by: matthiasclasen
Avoid unnecessary complications from accepting installation
IDs which won't work well on the commandline or in filenames.
Closes: #2514
Approved by: mwleeds
When pulling the ostree-metadata branch for p2p remotes we passed
NULL for progress which caused it to report with the default console
progress, which doesn't make any sense for the (small) ostree-metadata
branch.
Closes: #2456
Approved by: alexlarsson
This is copying code from the unstall command that
was added for the --unused option, and makes it
available as a library api.
Closes: #1747Closes: #2444
Approved by: alexlarsson
Now that we're moving away from a pure ASCII esthetic,
it looks odd to me to have a mixture of 3 dots and
proper ellipsis, so switch everything over to use
U+2026 instead of 3 dots.
Some minor other formatting and string changes
are included here as well.
Closes: #2454
Approved by: alexlarsson
Use only the last section in the id for origin remotes, to avoid
the origin column being really wide when listing stuff.
Closes: #2448
Approved by: alexlarsson
Bubblewrap has a --chdir option to control the directory
that the command is run in. Add an argument for this to
the flatpak_run_app function, update all callers, and add
a --cwd option to flatpak run that uses this new argument.
Closes: #2443
Approved by: alexlarsson
We load the per-app appstream xml.gz during deploy and inject name,
summary and version from it into the deploy data. For older deploys
that don't have this data we re-create it when needed (with the hope
that updates to app eventually makes this unnecessary due to new deploys).
Additionally this removes the support for generating deploy files where
they don't exist, as support for this predates xdg-app 0.6, so should not
exist in real life.
Closes: #2409
Approved by: alexlarsson
This adds a version to the deply data format, assuming that if
there is no version then it is 0. Also extends all loaders so that
it can specify a required version, with the goal that most users
are fine with old versions, but if you need more recent we have
a (costly) conversion process to upgrade (will be added later).
The library and the flatpak list/info commands require the most
current version for full info, all other users can use any version.
Also, as part of this we now pass the ref to flatpak_load_deploy_data()
as this will be needed later for the backwards compat support.
Closes: #2409
Approved by: alexlarsson
Differentiate sandbox shells by a custom prompt.
We set FLATPAK_ID to the app id, and PS1 to a prompt
using it. PS1 can be overridden by runtimes or --env.
Closes: #2447
Approved by: alexlarsson
It turns out a transaction can contain operations, and still
nothing happened after it ran - when all operations are skipped.
We only know this when the transaction is fully resolved, but
we may call is_empty from the ready signal or after run returns,
and it seems nice to tell the truth then.
Closes: #2371
Approved by: alexlarsson
Add a function to FlatpakTransactionProgress to get the
number of transferred bytes. This is useful information
to show during a long-running download.
Closes: #2371
Approved by: alexlarsson
This prints the common pattern of
Choices:
1) bla
2) bla
with consistent formatting, so we don't have
to worry about matching newlines and spaces
all over the codebase.
Closes: #2371
Approved by: alexlarsson
Add api to get the download and installed size
of resolved operations. This is useful information
to present to the user before running the transaction.
Closes: #2371
Approved by: alexlarsson
Make flatpak_dir_resolve_p2p_refs return the
download and installed sizes as well. This is
useful information to present to the user before
doing an install or update.
Closes: #2371
Approved by: alexlarsson
Add a function to query the window size and cursor position,
and definitions for some more ANSI escape sequences that we
will use in the following commits.
Closes: #2371
Approved by: alexlarsson
There are some use cases where apps might legitimately need
to know the host values of xdg variables. Since we use them
for our own purposes, we can't just propagate them as-is.
Instead, set HOST_XDG_{DATA,CONFIG,CACHE}_HOME if the corresponding
xdg variables are set on the host.
Closes: #2424Closes: #2440
Approved by: alexlarsson
It happens sometimes that the first processed total is 1, when this gets
downloaded we have 100% already and then the total changes making this
percentage faulty.
This makes the progress regress sometimes, but I'd say it's better than
a permanent, ficticious number.
Fixes#2428
Comparing the code in flatpak-utils.c:progress_cb,
we need to set bytes-transferred for the total amount
of data that has been transferred so far. The value
we were setting so far, fetched-delta-part-size, refers
to the size of the objects we already have locally, and
is subtracted from the total, which explains oci progress
running backwards.
Closes: #2392Closes: #2400
Approved by: matthiasclasen
This lets us respect the fancy output setting, and
it lets us do some other things that make it better
integrated.
Closes: #2379
Approved by: alexlarsson
gtk-doc complains if parameter names don't match between
headers and doc comments, so make them match, for a quieter build.
Closes: #2384
Approved by: alexlarsson
This is to avoid multiple polkit dialogs, regardless
of transaction ordering.
FlatpakTransaction calculates the 'strongest' op it has,
and passes the hints accordingly. FlatpakInstallation
doesn't pass hints, since it does individual operations.
The system helper uses the hints to determine which PolicyKit
permission to request. Since the policy typically has 'keep'
set, this mean that the following operations in the same
transaction will be able to reuse the permission obtained
for the first one.
Closes: #2384
Approved by: alexlarsson
Add flag that instructs the session-helper to kill
the spawned command when the caller drops off the bus.
Closes: #2326Closes: #2365
Approved by: alexlarsson
Allow to mark a FlatpakInstallation as no-interaction, which
will get passed to the system helper to prevent it from presenting
polkit dialogs.
We make this a property on the object, since not all relevant
methods have flags that would let us pass this information.
Closes: #2367
Approved by: alexlarsson
Allow to mark a FlatpakDir as no-interaction, which will
get passed to the system helper to prevent it from presenting
polkit dialogs.
We make this a property on the object since the alternative
would require plumbing the flag through tons of API all over
the code.
Closes: #2367
Approved by: alexlarsson
Add a new 'no-interaction' flag to all system-helper methods
that have flags, and don't allow polkit user interaction if
it is set. This will let tools like GNOME Software do automatic
updates in the background without interrupting the user with dialogs.
For methods that don't have flags, we always allow user interaction.
Closes: #2367
Approved by: alexlarsson