Commit Graph

89 Commits

Author SHA1 Message Date
Alexander Larsson
b5a9903efc cli: Automatically install authenticator as needed 2020-06-22 10:51:36 +02:00
Alexander Larsson
bfa3b15435 Transaction: Add "previous-error" option to basic auth error
Also, send this for the oci authenticator.
2020-06-09 14:52:00 +02:00
Alexander Larsson
0978826c2e Add and use per-transaction no-interaction option
This is useful if to avoid changing the no-interaction of the whole
FlatpakInstallation. Also, having this per transaction lets us
clean up the code in FlatpakQuietTransaction a bit.
2020-06-09 10:38:25 +02:00
Léo Stefanesco
66dfb63075 Fix segfault when reporting error during install
flatpak_dir_install was returning FALSE but leaving error to NULL, which
would crash when printing the error.

Fixes #3646
2020-06-05 17:02:45 +02:00
Abderrahim Kitouni
a18db1d646 cli-transaction: properly format '1.0 kB'
it's irritating to have it this way when everything else uses a comma as
a decimal separator

use the same trick for the total too
2020-03-26 21:24:47 +01:00
Matthew Leeds
bbd4ee68b4 app: Don't print "< 0 bytes"
Don't imply a download or install uses a negative number of bytes.
2020-02-12 16:45:41 +01:00
Alexander Larsson
e645424e69 Cli-transaction: Fix leak
We didn't free the table printer used.
2019-12-17 14:55:13 +01:00
Alexander Larsson
e08cee0e82 authenticator: Use g_app_info_launch_default_for_uri() to launch browser
This way we get the system default. We still respect BROWSER if set
which is useful for e.g. the tests or scripts.
2019-12-12 14:27:59 +01:00
Alexander Larsson
474b0573e3 authentication: Remove accidental leftover debug spew 2019-12-12 14:27:59 +01:00
Alexander Larsson
38c86bdf0f Authenticator: Add extra a{sv} args for future use
These are not used atm, but make the APIs future proof.
2019-12-12 14:27:59 +01:00
Alexander Larsson
1ec4232fd5 CLI: Handle basic auth in transactions 2019-12-12 12:16:53 +01:00
Philip Chimento
923beec024 Change "update-frequency" to "update-interval"
An event happens more often as its frequency gets higher, so these
values were confusing me.

Rename the constants to include their unit (ms) as well, to avoid
confusion.

Anything that affects public API (such as
flatpak_transaction_progress_set_update_frequency()) or libostree's
options passed to ostree_repo_pull_with_options(), is left as is.
2019-12-06 13:26:49 -08:00
Matthias Clasen
653fce251f cli: Don't use \r in plain output
These show up as ^M in test logs, and that is irritating.
Just use \n when producing plain output.

Closes: https://github.com/flatpak/flatpak/issues/3226
2019-12-04 13:30:13 +01:00
Alexander Larsson
f420fad6a9 cli transaction: Handle webflow signals
This shows the url in the default browser. Currenly it just looks
at $BROWSER and falls back to xdg-open.
2019-11-26 16:37:01 +01:00
Alexander Larsson
3c74199549 Print errors on stderr in install/update
If we're not doing fancy ui, print errors on stderr. This was biting me
in some tests where I'd like to grep for some strings in the stderr
output.
2019-11-26 16:37:01 +01:00
Matthias Clasen
bb5b2de3f1 install: Always show the op column
Otherwise, it is not clear what changes the question below
the table refers to.

Fixes: https://github.com/flatpak/flatpak/issues/3075
2019-11-21 13:49:30 +01:00
Georgelemental
0772ab6c9f Make deprecation warning notice less confusing
Replace "in preference of" with "in favor of," as the former is not
widely used, but the latter is.

This problem was mentioned in issue #3139.
2019-11-01 23:49:45 -04:00
Matthias Clasen
ea8ecdbeb9 eol: Use the right ref in the confirmation message
We were using the old ref here, instead of the new
one, when asking whether to go ahead.

Closes: https://github.com/flatpak/flatpak/issues/3139
2019-10-02 14:56:44 +02:00
Matthew Leeds
f88a9d9585 Use defined macro SYSTEM_DIR_DEFAULT_ID more
Just replace hardcoded strings with the macro, no functional change.

Closes: #3077
Approved by: alexlarsson
2019-09-09 10:01:15 +00:00
Bartłomiej Piotrowski
8f7c96f408 Default end-of-life-rebase prompt to yes
Closes: #3063
Approved by: mwleeds
2019-08-20 21:15:21 +00:00
Andre Moreira Magalhaes
eaec3a8203 cli-transaction: Fix some leaks
Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>

Closes: #3025
Approved by: matthiasclasen
2019-07-23 14:54:59 +00:00
Matthew Leeds
3af605dd39 app: Don't show arch column if it's not interesting
Flatpak already doesn't show the architecture column in the output of
"flatpak list" if every flatpak has the same architecture. This commit
does the same for the table printed for install/update/uninstall
operations, except if the user specifies an arch on the command line.

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

Closes: #2930
Approved by: matthiasclasen
2019-05-30 12:12:12 +00:00
Ryan Gonzalez
7357b2bc63 cli-transaction: Use the new rebase support
Switch to the new eol signal and call flatpak_transaction_add_rebase()
if a rebase was requested.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Rafael Fontenelle
95e692794b Fix misspellings
Closes: #2807
Approved by: matthiasclasen
2019-04-08 12:50:42 +00:00
Matthew Leeds
d690497549 cli transaction: Fix "required runtime found" prompt
On the next lines after this prompt we list each remote so it doesn't
make much sense to mention the first one in the prompt.

Closes: #2761
Approved by: alexlarsson
2019-03-19 13:44:29 +00:00
AsciiWolf
75690a08bb Fix missing translatable string
Closes: #2724
Approved by: mwleeds
2019-02-25 22:10:10 +00:00
Matthew Leeds
e8816b7663 Remove extra newlines in variable definiton blocks
Uncrustify has an option "nl_func_var_def_blk" which is supposed to
ensure there's a newline character between the block of variable
definitions and the rest of the function body, but it gets confused and
thinks that the first instance of "g_autoptr" or "g_auto" being used on
a variable is the start of the function body. So this commit removes
those extra newline characters and removes that option in uncrustify.cfg
so they don't get re-added the next time uncrustify is run.

Here's the command I used:

perl -0777 -i -pe 's/\n(\n\s*g_auto\()/\1/g' `git ls-tree --name-only
-r HEAD | grep \\\.[ch]$ | grep -v common/valgrind-private.h |
grep -v app/flatpak-polkit-agent-text-listener\\\.[ch]`

I ran it again with "g_autoptr" in place of "g_auto", and made a few
manual edits to add back the newline when the g_auto* was in the middle
of a function body rather than at the top.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthew Leeds
a0d3d65476 Remove extra newlines near curly braces
Edit uncrustify.cfg to add options to remove extra newlines near opening
and closing braces, and run uncrustify again.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthew Leeds
8d962a686f Run uncrustify
I had to make a few manual edits but other than those the changes look
reasonable.

Closes: #2715
Approved by: matthiasclasen
2019-02-25 18:12:30 +00:00
Matthias Clasen
e9382b34bd cli transaction: Make the checks green
Success ought to be green.

Related: #2671

Closes: #2676
Approved by: mwleeds

Closes: #2689
Approved by: alexlarsson
2019-02-14 09:12:40 +00:00
Alexander Larsson
2ea428a541 Revert "cli transaction: Make the checks green"
This reverts commit e209ac9e10.

We're counting thee escape sequences as width, until we fix
this we disable this.

Closes: #2686
Approved by: alexlarsson
2019-02-06 09:17:49 +00:00
Alexander Larsson
06a2f4d82d Actually always return non-null from flatpak_dir_get_display_name()
This also changes this to a non-const as we need to generate it.

Closes: #2683
Approved by: alexlarsson
2019-02-05 11:45:54 +00:00
Matthias Clasen
e209ac9e10 cli transaction: Make the checks green
Success ought to be green.

Related: #2671

Closes: #2676
Approved by: mwleeds
2019-02-02 01:38:32 +00:00
Matthias Clasen
d5e2970725 cli transaction: Adapt to an api change
In f7a566e2ab, the flatpak_installation_get_display_name()
api was changed to (almost) always return a non-NULL string. Adapt
to this change, in order to use the preferred messages here.

Closes: #2655

Closes: #2668
Approved by: alexlarsson
2019-02-01 16:30:17 +00:00
Matthias Clasen
c9430b15f8 cli transaction: Use raw mode
We don't want line editing to interfere with our
formatting, so we turn on raw mode while we do
fancy progress reporting. We use raw mode at the
same times as we hide the cursor.

This should prevent partial Escape sequences from
showing up in the output.

Closes: #2638
Approved by: alexlarsson
2019-01-25 12:03:47 +00:00
Matthew Leeds
ec61e6aac6 cli-transaction: Fix a typo
Closes: #2575
Approved by: alexlarsson
2019-01-17 07:40:29 +00:00
Matthias Clasen
a9388c7801 cli transaction: Use the cursor utiltiies
Closes: #2570
Approved by: alexlarsson
2019-01-14 11:41:42 +00:00
Alexander Larsson
a3d109de8f cli-transaction: Use Op instead of Change for title
This uses less horizontal space, given that all the elements in the
column is one-character strings. Also, Op seems to better describe this
than Change.

Closes: #2560
Approved by: alexlarsson
2019-01-11 14:51:44 +00:00
Matthias Clasen
92b0ad5f7e Handle out-of-space errors nicer
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
2019-01-11 13:46:31 +00:00
Matthias Clasen
0f2c45be4d Drop flatpak_cli_transaction_was_aborted
We can look at the error that is returned
by flatpak_transaction_run, no need for this
cli-transaction specific api.

Note that we need to be a little careful to
return the expected error: when there is
an operation error, we need to return that,
instead of an ABORTED error.

Update all users.

Closes: #2556
Approved by: alexlarsson
2019-01-11 11:42:13 +00:00
Matthias Clasen
a4ea1dc653 Fix a typo
I wonder how the compiler made sense of this.

Closes: #2556
Approved by: alexlarsson
2019-01-11 11:42:13 +00:00
Matthias Clasen
e1d634c0dd cli transaction: Drop flatpak_cli_transaction_run
We can just implement the run vfunc now, and chain up.

Update all callers to use flatpak_transaction_run.

Closes: #2556
Approved by: alexlarsson
2019-01-11 11:42:13 +00:00
Matthias Clasen
fd44da76e3 Drop flatpak_cli_transaction_install
Move this minor convenience api into its only user.
Using only generic FlatpakTransaction apis lets us
switch out transaction instances easily.

Closes: #2556
Approved by: alexlarsson
2019-01-11 11:42:13 +00:00
Matthias Clasen
6e11cf85b1 Make progress bar faint
The solid blocks are very prominent when used
at full intensity. Lets tone them down.

Closes: #2469
Approved by: mwleeds
2019-01-08 06:08:56 +00:00
Matthias Clasen
9884b056fd Fully translate a prompt
We were not translating the strings 'user' and 'system'
here, although we should.

Closes: #1984

Closes: #2520
Approved by: matthiasclasen
2019-01-08 01:56:25 +00:00
Matthias Clasen
2c794c5d82 Don't let g_warnings disrupt us
Some code paths deep inside flatpak-dir.c use
g_warning to report non-fatal errors. This disrupts
our table formatting without showing up visibly
in the output (since it gets wiped out by the next
redraw). Improve things by installing our own
message handler and showing these messages properly
inside our table, like other errors.

Closes: #2472
Approved by: matthiasclasen
2019-01-08 00:40:57 +00:00
Matthias Clasen
a2e2068f67 Fix a copy-paste error
There was a copy-paste error causing us to show
system bus ownership wrongly in the permission
table, and causing the footnote numbering to be
out of sync.

Closes: #2535
Approved by: mwleeds
2019-01-03 20:51:13 +00:00
Matthias Clasen
a5154d610f Cleaner progress display
With the new solid Unicode progress bar, we no
longer need the [] around it.  Drop it.

Closes: #2453
Approved by: alexlarsson
2018-12-21 08:29:33 +00:00
Matthias Clasen
6b59406e80 Consistently use Unicode ellipsis
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
2018-12-21 08:07:25 +00:00
Matthias Clasen
c2e9dc2832 Hide the cursor while displaying progress
The cursor interferes with our fancy redraw
and progress, so hide it while we are doing that.

Closes: #2455
Approved by: alexlarsson
2018-12-21 08:06:49 +00:00