Add utilities to load an AsStore for a deployed app,
to get an AsApp for a ref, and to get various pieces
of information from an AsApp.
Closes: #2409
Approved by: alexlarsson
Optionally mark a column as ellipsizing.
Currently, this won't work correctly if more
than one column is ellipsizing.
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
When the --app-runtime option was added, we inadvertently
added a conflict between the short options for --all and
this new option. To fix this, remove the short option for
--app-runtime.
Closes: #2441Closes: #2442
Approved by: mwleeds
The terminal size can change between two redraws, and this will also
cause the cursor to move, so we read the window size and current
cursor position each time we redraw instead of at the end of last redraw.
Closes: #2371
Approved by: alexlarsson
This seems nicer. We say we're looking for updates,
so we should give an update on what we found before
we return.
Closes: #2371
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
Revamp the FlatpakCliTransaction output to be closer to this:
https://github.com/flatpak/flatpak/wiki/CLI-experimental-design
We only do this style of formatting when fancy output is possible.
For plain output, we don't redraw the table and only use '\r'
to rewrite the progress line in-place.
Closes: #2371
Approved by: alexlarsson
When we are given a with that is larger than the content we have,
expand the space between columns, within reason. We only make the
table at most 1.5 times as wide as it would be unexpanded.
Add a new API for setting individual columns to expand (or not).
For an expanding column, we'll grow the space between it and its
preceding column. The expand flag of the first column is ignored.
By default, columns do not expand.
Make flatpak_table_printer_print_full return not just the table
height, but also the width.
Update all callers.
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
The spew of verbose messages makes a mess of any
attempt at formatted output, so lets not try.
Just disable fancy output when --verbose or
--ostree-verbose is used.
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 way to change individual cells and a getter for the
current row. Also add a variation of the print() method that
returns the number of terminal rows that was generated
when formatting to given width, while skipping a number
of rows at the beginning. This method will be used in the
following commit to print a part of the table into a terminal
window of a given size.
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
Add a flatpak-spawn(1) man page. While it is not ideal
to have the docs live separately from the code, having
it here ensures that it will be available everywhere
all the other flatpak documentation is.
Closes: #2437
Approved by: alexlarsson
I could not work out at all how exposing files works,
until I looked at the code. Put enough details in the
docs to spare the next person this fate.
Closes: #2437
Approved by: alexlarsson
Portals need to validate all their arguments.
We were not validating flags at all, and were not
very careful with some of the other arguments
either.
Closes: #2439
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
When we're prompting the user to choose between a list of items but
there's only one item, use a yes/no prompt and different wording.
Closes: #2426
Approved by: matthiasclasen