Commit Graph
4323 Commits
Author SHA1 Message Date
Cheng-Chia Tseng 7fc8fa0c31 add Chinese (Taiwan) translation
Closes: #2276
Approved by: matthiasclasen
2018-10-25 18:07:07 +00:00
Matthew Leeds a4683a4328 installation: Respect configured set of repo finders
OSTree now has a repo config option to set which repo finders (that is,
sources for refs) will be used, and API which exposes the default set
(which was either configured by the user or decided by libostree). So
this commit changes flatpak_installation_list_remotes_by_type() to
respect that configuration, since that's the only place flatpak passes a
set of OstreeRepoFinder instances to libostree.

See also https://github.com/ostreedev/ostree/pull/1758/

Closes: #2264
Approved by: pwithnall
2018-10-24 16:38:16 +00:00
Matthias Clasen 070e07c6f2 Merge pull request #2255 from matthiasclasen/cmdline-errors
Commandline errors
2018-10-24 13:25:29 +01:00
Umang Jain 34fd118bd9 system-helper: Rename variables for clarity
Closes: #2270
Approved by: matthiasclasen
2018-10-23 20:22:37 +00:00
Matthias Clasen bc04ccbe29 Add another transaction test
Test what happens when a runtime is not available.

Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen 70fdad9a89 Remove some unused FlatpakDir functions
Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen 77a6665c2f Add some tests for flatpak override
Also test that the overrides have the expected
effect in the sandbox, for some of them.

Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen 2d2f35056c Add a test for flatpak info
This exercises the various commandline options.

Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen 9da443f26f Remove another unused function
flatpak_context_load_for_app was not used.

Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen ea5e4c7b32 Add a test for the build-finish --sdk option
This runs a few otherwise unused functions.

Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen 2bbdd7712a Remove unused functions
Neither flatpak_variant_builder_init_from_variant nor
flatpak_gvariant_new_empty_string_dict are used anywhere.

Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen 4ef317c9ba session-helper: Properly report p11-kit exit status
Use the API that GLib offers for this.

Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen 6b0329bf2d Cosmetic
Closes: #2252
Approved by: matthiasclasen
2018-10-23 20:10:37 +00:00
Matthias Clasen daaac92aea tests: Improve the instance test
We now avoid sleeps in the test, instead use the proper
ways to deal with races: poll for the child pid after
launching the app, and use a child watch after killing
it.

This is using the new flatpak_installation_launch_full API.

Closes: #2221
Approved by: matthiasclasen
2018-10-23 07:15:39 +00:00
Matthias Clasen 6daf195e42 Instance: mitigate races, add new launch api
Avoid the 3-second 'afterlife' of instances by using
kill (pid, 0) instead of checking the file lock. We
trade pid for lock races, but this seems more reliable.

Also add flatpak_installation_launch_full that returns
a FlatpakInstance for the launched app, and lets us
avoid races around killing the app, by using a child
watch.

Closes: #2221
Approved by: matthiasclasen
2018-10-23 07:15:39 +00:00
Matthias Clasen 7b04db62b6 Merge pull request #2260 from alexlarsson/run-optional-repo
run: Make repos optional (again)
2018-10-20 09:19:29 +01:00
Matthias Clasen bad9e57a1c Merge pull request #2259 from mwleeds/fix-make-distcheck
tests/Makefile.am.inc: Fix distcheck error
2018-10-20 09:18:50 +01:00
Matthias Clasen 8212ad0253 Merge pull request #2263 from mwleeds/remove-old-ostree-version-checks
Remove old OSTree version checks
2018-10-20 09:13:00 +01:00
Matthew Leeds 80c4da4374 Remove old OSTree version checks
Flatpak depends on OSTree 2018.7 now, so we don't need these.
2018-10-19 17:54:02 -07:00
Matthew Leeds 6710e85d55 tests/Makefile.am.inc: Fix distcleancheck failure 2018-10-19 13:45:22 -07:00
Matthew Leeds cffc63ba3a tests: Skip two more tests when bwrap is missing
This adds the logic from test_install_launch_uninstall() to
test_instance() and test_overrides() so that all three are skipped in CI
environments where bwrap may not be working. This is necessary because
they all use flatpak_installation_launch().
2018-10-19 13:45:09 -07:00
Matthew Leeds dce3c700ef tests/Makefile.am.inc: Fix distcheck error
Currently `make distcheck` fails with:

PATH=$(cd . && pwd):${PATH} tests/make-test-runtime.sh
tests/runtime-repo org.test.Platform ""
/bin/bash: tests/make-test-runtime.sh: No such file or directory

This was caused by commit b5d86fe90 and is fixed by this commit.
2018-10-19 11:09:34 -07:00
Alexander Larsson d6eba6732f run: Make repos optional (again)
If some installation is empty (or otherwise broken) we fail the
entire run command, even though the app might exist in e.g. the
user installation. This is a regression from
651c86d3c6 which also ended up in 1.0.4.
2018-10-19 12:56:37 +02:00
Matthias Clasen 71143138b7 Merge pull request #2250 from alexlarsson/test-required-version
tests: Add a test for multi-updates and required version
2018-10-17 14:58:07 -07:00
Matthias Clasen 4b85aa7859 Merge pull request #2254 from mwleeds/instance-element-type-annotation
instance: Fix gtk-doc warning
2018-10-17 14:56:01 -07:00
Matthias Clasen 12950d80d6 build-import-bundle: Improve error handling
Don't throw assertions if FILENAME looks odd.
2018-10-17 17:54:03 -04:00
Matthias Clasen ebe1403cd8 build-commit-from: Shorten usage text
The usage text should really fit on one line.
Reword the blurb to make that true at least for English.
2018-10-17 17:54:03 -04:00
Matthias Clasen a99502a620 build-init: Improve error handling
Don't segfault if DIRECTORY does not look like a local path.
2018-10-17 17:54:03 -04:00
Matthias Clasen aacc649158 build-bundle: Improve error handling
Don't fail in obscure ways if commandline options don't
look like files.

Closes: #2191
2018-10-17 17:53:50 -04:00
Matthew Leeds d5b8266a09 instance: Fix gtk-doc warning 2018-10-17 14:23:20 -07:00
Alexander Larsson 0e36042fdf tests: Add a test for multi-updates and required version
I had a report of (and old version of) flatpak stopping
an entire "flatpak update" because one app had a new required
version. This adds a test of this (and it seems fixed now).
2018-10-17 09:30:13 +02:00
Matthias Clasen dcd912b463 Merge pull request #2249 from mwleeds/use-g-key-file-macro
dir: use G_KEY_FILE_DESKTOP_GROUP constant
2018-10-16 16:04:14 -07:00
Will Thompson 0d6b979212 dir: use G_KEY_FILE_DESKTOP_GROUP constant
This and all the other standard Desktop Entry Specification keys are
defined in gkeyfile.h. Who knew?
2018-10-16 14:40:55 -07:00
Matthias Clasen fd60bfc96c Add a test for transaction with local install
Here we pass a file url instead of a remote name.

Closes: #2245
Approved by: alexlarsson
2018-10-15 13:39:36 +00:00
Matthias Clasen a46527d9e1 transaction: Improve the docs
Explain that it is possible to install from a
local repo by passing the location.

Closes: #2245
Approved by: alexlarsson
2018-10-15 13:39:36 +00:00
Matthias Clasen dc5d78fa33 Add more tests
The tests added here include checks for expected types in
the library (including enum types that are needed for
introspection), and for error handling around names.

Closes: #2245
Approved by: alexlarsson
2018-10-15 13:39:36 +00:00
Matthias Clasen 12b5c36ec9 Remove an unused function
There were no calls to flatpak_zero_mtime anywhere.

Closes: #2245
Approved by: alexlarsson
2018-10-15 13:39:36 +00:00
Matthias Clasen 2d331a84a3 ref: Remove some dead code
flatpak_decompose_ref guarantees that parts[0] is either
"app" or "runtime".

Closes: #2245
Approved by: alexlarsson
2018-10-15 13:39:36 +00:00
Matthias Clasen 2d70866fa8 transaction: Don't call g_object_ref on a GBytes
This won't go well.

Spotted while writing tests.

Closes: #2245
Approved by: alexlarsson
2018-10-15 13:39:36 +00:00
Matthias Clasen acd8cfd6bb Add a test for bad remote names
These were not handled gracefully so far.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 8462a093e7 remote: Be robust against bad names
If we use a remote name containing questionable characters
such as newlines or '[', we will run into assertions in
GKeyFile. To avoid that, check that the group name we
pass is valid, and throw an error otherwise.

Found while writing tests.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 8f5c43a784 history: Always handle --columns=help
The test for --columns was failing in ci because flatpak
gets built without libsystemd there. Avoid this by always
handling --columns=help nicely, even if libsystemd is not
used.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 6d696b74f5 Test more overrides
Test some of the socket settings.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 5454707464 Add more tests
Test some more instlalation apis, and some error conditions.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 34851f99d6 Add some more tests
Test more options of build-update-repo.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 37f0284467 transaction: Add a missing error return
When trying to uninstall a non-installed app, we run
into an assertion, because the code forgets to return
after setting the expected error.

Found while writing tests.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 263a2e5663 Add some more basic tests
Some tests for commandline error handling.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 9f7ddaf678 Add a test for --columns=help
Check that this produces the expected output.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 4009466913 document-list: Handle --columns=help properly
In this case, the columns helper function returns an
empty array of columns. Exit cleanly without trying
to contact the documents service, in this case.

Found while writing tests.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00
Matthias Clasen 2ce626b069 Add various new tests
Just driving up coverage incrementally, and finding
bugs along the way.

Closes: #2244
Approved by: alexlarsson
2018-10-15 06:51:58 +00:00