Commit Graph

4745 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
71411ee88c repair: Document --reinstall-all
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
b293562ae9 repair: Document --dry-run
Also mention the need to run flatpak repair as root
when operating on system repositories.

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
Alexander Larsson
cb30e7ef4e Add deploy refs for currently deployed commit.
When we deploy e.g. app/org.foo.bar/x86_64/stable, then we
also create a deploy/app/org.foo.bar/x86_64/stable ref pointing to
the latest deployed commit. We also remove it when an app is uninstalled.

This means that a prune operation will not delete objects that are deployed
(which would not save any space anyway). This is nice because this can
happen for instance when you flatpak update --no-deploy.

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

Closes: #2563
Approved by: alexlarsson
2019-01-14 11:55:12 +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
3598cce951 Add utilities for showing/hiding the cursor
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
22a375fc8e tests: Fix a typo
Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthew Leeds
dd5b798428 dir: Delete some outdated comments
It's no longer true that it's the pull code's job to resolve a ref to a
specific commit. Ever since commit 66eee3c2c this is the job of the
resolve_ops() function used by FlatpakTransaction (at least, when a
transaction is being used). So update a couple comments to avoid
confusion.

Closes: #2587
Approved by: alexlarsson
2019-01-14 10:34:34 +00:00
Matthias Clasen
6a7b074946 Merge pull request #2584 from matthiasclasen/doc-typo
list: Fix a typo in the docs
2019-01-13 11:18:07 -05:00
Matthias Clasen
042c1f7174 list: Fix a typo in the docs
Its --columns, not --column.

Closes: #2568
2019-01-13 11:15:18 -05:00
Matthias Clasen
53cd86e291 Add tests for column completion
Closes: #2579
Approved by: matthiasclasen
2019-01-12 02:17:44 +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
4f6f9dda1c Add tests for number parsing
Closes: #2578
Approved by: matthiasclasen
2019-01-12 02:05:05 +00:00
Matthias Clasen
e8e31edea2 Make number parsing more robust
We were parsing 2-6 with an out-of-range end value
as 2. Fix that.

Closes: #2578
Approved by: matthiasclasen
2019-01-12 02:05:05 +00:00
Matthias Clasen
b098d683e5 Export flatpak_parse_numbers
Export this function privately, so we can test it.

Closes: #2578
Approved by: matthiasclasen
2019-01-12 02:05:05 +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
4f6fef6d82 Don't return NULL without setting an error
Set the expected error when returning NULL from
flatpak_dir_get_config due to an empty repo.

Closes: #2576

Closes: #2577
Approved by: mwleeds
2019-01-12 00:40:14 +00:00
Matthias Clasen
b6e19db7be Update tests
Our test are now good enough to detect that install
is no longer a one-dir command. Yay. Update them.
2019-01-11 19:19:54 -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
Matthew Leeds
9aae124ca3 transaction: Fix gtk-doc warning
Closes: #2574
Approved by: matthiasclasen
2019-01-11 22:57:15 +00: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
006ecb4543 Merge pull request #2567 from piotrdrag/potfiles-update-190111
Update POTFILES.in
2019-01-11 15:24:47 -05:00
Matthias Clasen
ecc4659cdb Merge pull request #2569 from ebassi/test-build-fix
Fix non-srcdir builds
2019-01-11 15:24:31 -05:00