Commit Graph

4720 Commits

Author SHA1 Message Date
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
Emmanuele Bassi
4d79e2239a Fix non-srcdir builds
The generated DBus permission header is included by an header in under
app/ that we include from testcommon.c. We already added the app/
directory under the source directory, but we need to include the same
directory under the build directory in order for the compiler to find
the generated header.

Fixes the build in GNOME Continuous, which is failing with:

```
In file included from ../tests/testcommon.c:10:0:
../app/flatpak-builtins-utils.h:28:47: fatal error: flatpak-permission-dbus-generated.h: No such file or directory
compilation terminated.
```
2019-01-11 19:28:30 +00: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
ccd602dd19 Fix a compiler warning
The largest warning ever. Go clang!

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
0360fa84ef Adapt format_choices tests
The formatting has changed, and our tests catch that. Yay!
Also fix the build with glib master.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
9e27fc67fe testcommon: Add another table ellipsization test
This tests the situation when we can't accommodate
the requested width with the available shrinkage.

This used to cause an infinite loop in the table
printer.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
b095ca8ac6 datetime tests
Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:45 +00:00
Matthias Clasen
4ff95d94e8 build-export: Document that NOW is a valid timestamp
We may not want to guarantee all the formats that this
datetime parser accepts, but NOW seems useful enough and
is already mentioned in flatpak-build-commit-from(1).

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
a35030ab5e build-commit-from: Document missing options
Document --end-of-life, --timestamp and --disable-fsync.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
16cf081f97 tests: Add tests for app helpers
Link testcommon against libflatpak-app.la and
add tests for some utility functions.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
402e2020d8 Add a way to force fancy output on
This will be used for testing the table printer formatting.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +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
46e1f8f3b0 Add a test for some private utilities
Add another test that links against libflatpak-common.la
and tests functions that are not part of the public
library api.

Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
ed8fbbe6df testlibrary: Test a few new apis
Closes: #2498
Approved by: matthiasclasen
2019-01-11 18:32:44 +00:00
Matthias Clasen
490924c5f0 tests: Add appstream version to test app
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
Piotr Drąg
e7c95e75b1 Update POTFILES.in 2019-01-11 18:57:29 +01:00
Matthias Clasen
f39b5a2795 dir: Be more careful with self->repo
It is possible for self->repo to be NULL, therefore
call flatpak_dir_ensure_repo() in a bunch more places,
before accessing self->repo.

Closes: #2483

Closes: #2484
Approved by: matthiasclasen
2019-01-11 16:12:33 +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
9ff489519c Add a utility to prompty for multiple choices
This is a variant that allows to enter multiple numbers,
either individually, or as range. Parts can be separated
by space or comma. Examples:
1-3,5
1 2 4
6

Closes: #2559
Approved by: alexlarsson
2019-01-11 15:57:44 +00:00