Commit Graph

1105 Commits

Author SHA1 Message Date
Matthias Clasen
f28fa5aefd Fix remote-ls ellipsizing
We were inadvertedly adding extra columns when
trying to set existing columns as ellipsizable.
Oops.

Closes: #2460
Approved by: alexlarsson
2019-01-14 13:35:56 +00:00
Matthias Clasen
e7d6d0147e remote-ls: Fix a regression
We were trying to be smart about showing origin,
but recent rearrangement of columns made us show
refs instead.

Closes: #2460
Approved by: alexlarsson
2019-01-14 13:35:55 +00:00
Matthias Clasen
7ade0d07fe repair: Do some basic check for remotes
We should point out if refs in the repo refer
to missing or disabled remotes, this is useful
information.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
c68bcac795 repair: Reinstall appstream too
--reinstall-all means to the re-create all checkouts,
so lets recreate appstream checkouts as well.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
b92751afa1 repair: Add a reinstall-all option
When --reinstall-all is given, re-deploy all refs,
regardless whether they were removed from the repo
or not. This can be used to ensure that directories
in the checkout have the right mode, which does not
otherwise get corrected.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
8bce4b2a49 repair: Try erasing .removed
If a .removed directory is left behind, that can
cause things to behave in confusing ways. Try to
remove it and report an error if it fails.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
79c8099881 repair: Fall back to dry-run
When operating on a system installation as non-root,
making changes will fail, and the experience is a
bit confusing. Be explicit about it.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
7dfec63d3f repair: Add an informative message
It helps to know which installation we're working on.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
5e112c8398 repair: Add a --dry-run option
This will just report inconsistencies it finds,
but not make changes.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
d0f7ca6a30 repair: Improve reporting
Don't say we have missing objects when they
are in fact invalid.

Closes: #2473
Approved by: alexlarsson
2019-01-14 13:21:12 +00:00
Matthias Clasen
e2f0a91067 remote-delete: Ask to remove refs
When --force is not given, ask the user for confirmation
whether he wants to remove refs that are installed from
the remote, and if he agrees, uninstall them.

Note that this is different from --force, which just
leaves the apps behind.

Closes: #577

Closes: #2518
Approved by: alexlarsson
2019-01-14 13:07:50 +00:00
Matthias Clasen
379e6145e8 main: Always show the cursor
When a running cli transaction is interupted by Ctrl-C,
we exit with a hidden cursor. Add a signal handler which
shows the cursor before exiting.

Closes: #2561

Closes: #2570
Approved by: alexlarsson
2019-01-14 11:41:42 +00:00
Matthias Clasen
a9388c7801 cli transaction: Use the cursor utiltiies
Closes: #2570
Approved by: alexlarsson
2019-01-14 11:41:42 +00:00
Matthias Clasen
6aa3faadfe search: Use ALL_DIRS
There is no good reason to leave out custom installations
here.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
9a1d7b8b92 update: Don't fail completion on empty repos
This lets completion keep working for the run command
despite an empty custom installation.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
64133a0c9b run: Don't fail completion on empty repos
This lets completion keep working for the run command
despite an empty custom installation.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
7c97271958 repair: Improve completion
Use OPTIONAL_REPO since an empty repo seems repairable,
and also dont stop completing options after the second.
This is a copy-paste error from other completion functions.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
eb48268d1b remote-add: Don't fail completion on empty repos
This lets completion keep working after you type
flatpak remote-add --installation=empty
We already use OPTIONAL_REPO in the command, so there
is really no reason to not do the same for completion.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
bb92a7abff override: Don't fail completion on empty repos
This lets completion keep working after you type
flatpak override --installation=empty

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
31c7325382 make-current: Don't fail completion on empty repos
This lets completion keep working after you type
flatpak make-current --installation=empty
It is somewhat cosmetic since there's nothing to
install on an empty repo, but no need to silently
disappear the remaining options.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
fe52e323a6 install: Don't fail completion on empty repos
This lets completion keep working after you type
flatpak install --installation=empty
It is somewhat cosmetic since there's nothing to
install on an empty repo, but no need to silently
disappear the remaining options.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
dd63d39da2 ps: Simplify completion
There are no non-option arguments here, so need
to parse. We can just complete from the available
options.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
15f9bbf8c6 config: Make --list and --get work on empty repos
The --list and --get implementations work just fine
on empty repos (reporting the default values). So
don't err out prematurely during option parsing.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
a76227e2a2 Move the handling of empty options
Move the code that is handling the empty options
(--version, etc) to the one place where we parse them.

This gets this code out of the completion path and
make flatpak_option_context_parse easier to understand.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
5b818433fc completion: Don't let --help interrupt us
We never want g_option_context_parse to produce help
output when we are in the middle of completion.
But we still want to see --help, -h, -? among the
completions.

To achieve that, disable the built-in help and add
(ignored) help entries to our option context when
we are completing.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
48b9067d7b completion: Avoid stray empty completion for --columns=
Closes: #2579
Approved by: matthiasclasen
2019-01-12 02:17:44 +00:00
Matthias Clasen
10505b817c Merge pull request #2507 from matthiasclasen/uninstall-all-dirs
uninstall: Look through all installations
2019-01-11 19:52:28 -05:00
Matthias Clasen
c9e40c8f03 Merge pull request #2562 from ramcq/upgrade-harder
app/flatpak-builtins-update: skip refs from unreachable remotes
2019-01-11 19:09:29 -05:00
Matthias Clasen
6c728f9b8e uninstall: Use the OPTIONAL_REPO flag
It works fine, all users of ALL_DIRS should use this flag,
to prevent empty or broken custom installations interfering
with completion or operation.
2019-01-11 18:52:10 -05:00
Matthias Clasen
83c6bae079 install, uninstall: Look through all installations
This makes more sense.

Closes: #2505
2019-01-11 18:52:09 -05:00
Matthias Clasen
f645c670c5 polkit: Ignore deprecations
This code is copied from polkit, and will hopefully
go away eventually. Until then, ignore deprecations.

Closes: #2573
Approved by: mwleeds
2019-01-11 22:34:24 +00:00
Matthias Clasen
61da4b9331 remote-info: Remove unused variables
Closes: #2573
Approved by: mwleeds
2019-01-11 22:34:24 +00:00
Matthias Clasen
01b3d58ac5 Merge pull request #2542 from matthiasclasen/first-run-warning
Add a first-run warning
2019-01-11 16:12:46 -05:00
Matthias Clasen
7639149a6c remote-info: Show eol messages too
Keep the information in sync with what info and remote-ls show.

Closes: #2495

Closes: #2499
Approved by: matthiasclasen
2019-01-11 18:33:52 +00:00
Matthias Clasen
7022291045 info: Ellipsize end-of-life messages
These can be long, so ellipsize them.

Closes: #2499
Approved by: matthiasclasen
2019-01-11 18:33:52 +00:00
Matthias Clasen
b095ca8ac6 datetime tests
Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
8391e4ac6f Build a convenience library for app helpers
This will let us write tests for some of these
functions.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
9375872c82 Plug a small memleak
If we hit an unknown column, we were leaking
an already-allocated column array.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
7ce3eda5b5 build-finish: Validate --require-version argument
Use the same function that flatpak uses to parse this
field from metadata to ensure that we don't accept
invalid data.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
204a3377ac fixup! Add a first-run warning
Avoid warning when not in a user session, by looking for DBUS_SESSION_BUS_ADDRESS
2019-01-11 10:59:05 -05:00
Matthias Clasen
3ea95a34e6 fixup! Add a first-run warning
Wording tweaks and typo fixes
2019-01-11 10:59:05 -05:00
Matthias Clasen
688c834cf6 Add a first-run warning
When you install flatpak and don't restart your session,
the environment will not be set up properly for the desktop
to find installed flatpak apps. Warn if we detect this situation.
2019-01-11 10:59:05 -05:00
Matthias Clasen
6c733ddc6a Add a utility for printing lines wrapped
This is a variant of g_print that word-wraps lines
to a given width, while respecting pre-existing
line breaks.
2019-01-11 10:59:05 -05:00
Matthias Clasen
354bdc8955 Allow multiple choice when resolving installed refs
This is a bit more flexible than "All of the above",
in that it allows to select a subset of the available
choices.

Closes: #2559
Approved by: alexlarsson
2019-01-11 15:57:44 +00:00
Matthias Clasen
5e6a6b6564 uninstall: Allow selecting all matches
Add a "All of the above" choice.
Might come in handy sometimes.

Closes: #2559
Approved by: alexlarsson
2019-01-11 15:57:44 +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
Robert McQueen
148db9eb5a app/flatpak-builtins-update: skip refs from unreachable remotes
Allow refs to be added to the update operation in "flatpak update" even if some
of the matching group have a missing remote. In the case this leaves the
transaction empty, the "nothing to do" error will be printed after the
transaction is run.
2019-01-11 14:46:04 +00:00
Matthias Clasen
77bfe8493e Add column completion to all commands
Call flatpak_complete_columns for every command
that understands --columns.

Closes: #2445
Approved by: alexlarsson
2019-01-11 14:00:59 +00:00
Matthias Clasen
ff118dfbc6 completion: Add an api to complete columns
The new function, flatpak_compete_columns, takes an array
of Column structs and completes a --columns= option.

Unfortunately, bash completion does not let us do better
than repeating the entire list of columns for every
possible completion. This is not ideal, but at least
it gives good results for the first column.

Closes: #2445
Approved by: alexlarsson
2019-01-11 14:00:59 +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