Commit Graph

4712 Commits

Author SHA1 Message Date
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
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
b4e68422bf dir: Don't write to the console
In some cases, when NULL was passed for an OstreeProgress,
the library code would instantate its own progress object
and write progress information out to the console. That
is not a good thing for a library to do - it has the
potential to mess up the cli tools output.

Stop doing this, and require that all callers pass
a non-NULL progress.

Closes: #2468
Approved by: alexlarsson
2019-01-11 14:16:37 +00:00
Matthias Clasen
69d5692529 system-helper: Don't pass NULL for progress
When calling into FlatpakDir apis that take an
OstreeProgress, always pass a no-op instance,
never NULL.

Closes: #2468
Approved by: alexlarsson
2019-01-11 14:16:37 +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