Commit Graph

4201 Commits

Author SHA1 Message Date
Matthias Clasen
498870c3dd Add helpers for dealing with --columns
Since we will have multiple commands with this style
of option, lets establish some common utilities.

Closes: #2090
Approved by: alexlarsson
2018-10-05 15:19:43 +00:00
Matthias Clasen
789cc1ea60 repo: Update the docs
Mention --commits, and refer to build-update-repo
and ostree as alternative commands for repo management.

Closes: #2156
Approved by: alexlarsson
2018-10-05 13:49:52 +00:00
Matthias Clasen
ff91bcf007 repo: Add a --commits option
Show commits for a branch in a similar format
to ostree log. We also show static deltas when
they are available.

Closes: #2156
Approved by: alexlarsson
2018-10-05 13:49:52 +00:00
Matthias Clasen
6c6c279730 repo: Add some debug spew
It is useful to know where the wrong data I'm seeing
comes from.

Closes: #2156
Approved by: alexlarsson
2018-10-05 13:49:52 +00:00
Matthias Clasen
8509810171 repo: Default to --info
If no options are specified, print general info.
Otherwise, the command is a bit useless.

Closes: #2156
Approved by: alexlarsson
2018-10-05 13:49:52 +00:00
Matthias Clasen
f6b338286b repo: Add a newline after metadata
Without this, we can end up with the shell prompt
getting tucked behind the last line of the metadata,
which is confusing.

Closes: #2156
Approved by: alexlarsson
2018-10-05 13:49:52 +00:00
Matthias Clasen
79b7d436fe repo: Add repo mode to --info
This information is easily available, might as well show it.

Closes: #2156
Approved by: alexlarsson
2018-10-05 13:49:52 +00:00
Matthias Clasen
f3a3ea9c67 list: Add an option to filter by runtime
This lets you use list --app --app-runtime=org.gnome.Platform//3.24
to see which apps on your system still depend on this old runtime.

Closes: #2175
Approved by: alexlarsson
2018-10-05 13:36:33 +00:00
Matthias Clasen
a0744f1f80 Exercise all commands in test-basic.sh
We can test that every command has help output.

Closes: #2187
Approved by: alexlarsson
2018-10-05 13:34:49 +00:00
Matthias Clasen
6736c967aa Add a bigger transaction test
This test installs and uninstalls an app using
a transaction, and checks the signals that get
emitted are as expected.

Closes: #2187
Approved by: alexlarsson
2018-10-05 13:34:49 +00:00
Matthias Clasen
3f0eb7e481 transaction: Fix up a signal signature
We were emitting the ::operation-done signal with
different arguments than declared for the signal.
This showed up as test failure when comparing
the result argument.

Closes: #2187
Approved by: alexlarsson
2018-10-05 13:34:49 +00:00
Matthias Clasen
e72e0669ce Add some more simple library tests
Simple tests for simple things.

Closes: #2187
Approved by: alexlarsson
2018-10-05 13:34:49 +00:00
Matthias Clasen
bf58f648c9 transaction: Handle a corner case
Handle the case that flatpak_transaction_get_current_operation
is called before the transaction is started.

Closes: #2187
Approved by: alexlarsson
2018-10-05 13:34:49 +00:00
Matthias Clasen
1e5e57051d Add lcov support
This adds a --enable-coverage configure option and a
coverage target to generate coverage testing for
the testsuite. The generated html ends up in the
coverage/ directory.

Closes: #2187
Approved by: alexlarsson
2018-10-05 13:34:49 +00:00
Matthias Clasen
3ca21d2227 Add info about dependencies
I just set up a flatpak build from scratch on an F28
machine. This is what I had to install to get a build
going.

Closes: #2184
Approved by: alexlarsson
2018-10-05 11:44:13 +00:00
Alexander Larsson
b5d86fe90b tests: Only generate the test platform once
Rather than regenerating it over and over we generate the test
platform as check_DATA and refer to it from the individual tests.
This cuts down "time make check -j8" from 1:25 to 1:06 in user time on
my machine, which is nice in itself, but it is also a stepping stone
for splitting out our large test-scripts into smaller ones where it
will make even more difference.

For the installed-tests case we fall back to creating the platform
once per test.

Closes: #2188
Approved by: alexlarsson
2018-10-05 11:43:12 +00:00
Alexander Larsson
6af4d7d3fe tests: Move basic binary list into make-test-runtime.sh
Rather than specify this in multiple places we now list the most
core binaries needed for the tests inside the script.

Closes: #2188
Approved by: alexlarsson
2018-10-05 11:43:12 +00:00
Alexander Larsson
df93c9b563 tests: Make make-test-{app,runtime}.sh take repo, not repo name
Later we want to use these outside the test suite, and then we
might not use the same repo naming.

Closes: #2188
Approved by: alexlarsson
2018-10-05 11:43:12 +00:00
Alexander Larsson
bdf5c87429 tables: Avoid trailing spaces
In a table, if some row is wide then *all* rows will be that wide
with spaces at the end. This is not great in e.g. the remote-ls
case where one row has a long EOL message.

This commit strips all the trailing whitespace from each row to avoid
this.

Closes: #2189
Approved by: alexlarsson
2018-10-05 11:22:18 +00:00
Alexander Larsson
b6a8cab35f Update pofiles 1.0.3 2018-10-04 14:54:32 +02:00
Alexander Larsson
651785c974 tests: Don't dist the .wrap files (as they don't exist) 2018-10-04 11:22:50 +02:00
Alexander Larsson
1196ff54bf Update version to 1.0.3 2018-10-04 11:08:16 +02:00
Alexander Larsson
eb5ffeab77 Update NEWS for 1.0.3 2018-10-04 11:08:05 +02:00
Alexander Larsson
a94eea8cc7 build-update-repo: Add appstream2 to the metadata cache
The old "appstream" is there already, and this allows us to get
things like download size info for it.

Closes: #2182
Approved by: alexlarsson
2018-10-04 06:58:23 +00:00
Alexander Larsson
35b92d7237 Support --allow=canbus for AF_CAN access
This fixes https://github.com/flatpak/flatpak/issues/2176

Closes: #2179
Approved by: alexlarsson
2018-10-03 14:31:30 +00:00
Kalev Lember
1a827c0469 transaction: Return G_IO_ERROR_CANCELLED when cancelled
Instead of FLATPAK_ERROR_ABORTED, return G_IO_ERROR_CANCELLED when the
passed in GCancellable gets cancelled. This makes it possible to cancel
updates in gnome-software without getting a generic "Aborted due to
failure" error popup.

Closes: #2178
Approved by: alexlarsson
2018-10-03 13:56:49 +00:00
Alexander Larsson
89e2b6679c Don't expose host /dev/shm with --device=all (fixing debian problems)
--device=all really means the device nodes, we should not expose the host
shared memory objects.

This change incidentally fixes issues with --device=all on debian (#2136)
where /dev/shm is a symlink to /run/shm, which doesn't exist in the sandbox.

Closes: #2160
Approved by: alexlarsson
2018-10-03 13:56:44 +00:00
Alexander Larsson
43c7e7eeec tests: Don't generate the .wrap tests, launch them via test-wrapper.sh
There is no need for these files to be generated on disk

Closes: #2170
Approved by: alexlarsson
2018-10-03 13:19:35 +00:00
Alexander Larsson
5ab1b99d62 tests: Run in /tmp
These days we don't really need xattrs for the tests to run,
so move the test runs to /tmp, which brings down make check time
from 5 to 3.5 minutes on my machine.

Closes: #2170
Approved by: alexlarsson
2018-10-03 13:19:35 +00:00
Alexander Larsson
5fa3fbf19e tests: Autogenerate test matrix
Several tests have alternative wrappers that just set some feature
flags. For instance to switch between user and system and with or
without deltas. This change makes those wrappers automatically
generated from a simple description of the features.

For example the test-run.sh test goes from:
-       tests/test-run.sh \
-       tests/test-run-system.sh \
-       tests/test-run-deltas.sh \
-       tests/test-run-system-deltas.sh \
to
+       tests/test-run.sh{{user+system},{nodeltas+deltas}} \

There is some complexity here because the TESTS variable in automake
can't be runtime generated, so we rewrite it during "make
update-test-matrix" and commit the result to git.

The way it works is that make update-test-matrix takes the
TEST_MATRIX_SOURCE list, passes it to tests/expand-test-matrix.sh
which generates all the combinations in tests/Makefile-test-matrix.am.inc
where a test like tests/test-foo.sh{user+system} will get
converted to tests/test-foo.sh@user.wrap and tests/test-foo.sh@system.wrap.

We then have a pattern rule matchin tests/*.wrap which will generate
a wrapper that sets the right environment flags based on $0 and then
spawns the wrapper.

Closes: #2170
Approved by: alexlarsson
2018-10-03 13:19:35 +00:00
Piotr Drąg
58c1b9c46d Update POTFILES.in
Closes: #2172
Approved by: alexlarsson
2018-10-03 09:15:26 +00:00
Umang Jain
8da2c64fa1 dir: Fix parameter naming for consistency
Closes: #2173
Approved by: alexlarsson
2018-10-03 09:02:13 +00:00
Matthew Leeds
7c5751a4f9 create-usb: Avoid updating the source repo summary
This commit removes the call to flatpak_dir_update_summary() in the
create-usb implementation. It turns out that libostree does not rely on
a summary being present when a pull is local (meaning it uses a file://
URI). I'm not sure where I got the idea that create-usb depends on a
summary in the source repo. I went back to the first commit that
introduced the "ostree create-usb" command and even using that a summary
isn't required, so it seems unlikely that this changed recently.

One important benefit of removing the summary update is that currently
summary generation takes an exclusive lock, and we've seen on Endless
the attempt to acquire that lock time out (possibly due to a prune
happening in another process).

We could also remove the system-helper method UpdateSummary since it
doesn't have any users after this commit, but maybe someone will need it
in the future, and technically removing it would be an API break.

Closes: #2166
Approved by: alexlarsson
2018-10-02 06:32:54 +00:00
Robert McQueen
8bd22682f7 installation: nitpicks
Make the new _run_triggers function appear correctly in GtkDoc and cross-link.

Closes: #2164
Approved by: alexlarsson
2018-10-02 06:22:27 +00:00
Matthias Clasen
823511b87a Update tests for changed errors
Great that we're actually testing these.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
868552cb1f Fix localization
On the library side, we need to include gi18n-lib in order
to use dgettext for _().

Closes: #2163

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
e9bf1c3f75 Replace a warning with an error
It is not really nice to have g_warnings pop out of
the library left and right, they should be replaced
by proper errors as far as possible. This is a small
start.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
56d975f8c4 Add a few more error codes
Add FLATPAK_ERROR_INVALID_DATA and use if for cases where
the incoming data for an update or install is faulty, and
add FLATPAK_ERROR_UNTRUSTED, FLATPAK_ERROR_SETUP_FAILED and
FLATPAK_ERROR_EXPORT_FAILED to cover more error conditions.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
5b9d8e5ab8 Translate more error messages
As a rule of thumb, if we use a FlatpakError, the message
is probably worth translating.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
38eebef90c Avoid flatpak_fail in ref parsing
Add an error code for invalid refs, and use it when
composing or decomposing refs.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
9d0fbdd0b4 FlatpakContext: Avoid flatpak_fail
flatpak_fail is a convenient shortcut, but falls short
for actual error reporting. Use proper G_OPTION_ERROR
error codes here.

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Matthias Clasen
df4df62d04 Fix a typo
Its bwrapinfo.json, not brwapinfo.json

Closes: #2150
Approved by: alexlarsson
2018-10-02 06:21:49 +00:00
Robert McQueen
33cfa59af6 installation: tidy doc comments on new API additions
Closes: #2162
Approved by: alexlarsson
2018-10-01 14:43:09 +00:00
Robert McQueen
00fcc65157 installation: fix inverted logic in new _NO_TRIGGERS flag
Philip Withnall wins today's gold star.

Closes: #2162
Approved by: alexlarsson
2018-10-01 14:43:09 +00:00
Matthias Clasen
dd7a163a28 run: Document new options
Document --user, --system nd --installation.

Closes: #2158
Approved by: alexlarsson
2018-10-01 13:05:12 +00:00
Matthias Clasen
651c86d3c6 run: Allow selecting an installation
It may be an unlikely case, but if the same app
is installed in multiple installations, there was
no way to select which one to run, so far.

Closes: #2146

Closes: #2158
Approved by: alexlarsson
2018-10-01 13:05:12 +00:00
Matthias Clasen
2290099ead Add a new utility function for finding deploys
flatpak_find_deploy_for_ref_in is a variation of
flatpak_find_deploy_for_ref that allows to restrict
what installations to search in.

Closes: #2158
Approved by: alexlarsson
2018-10-01 13:05:12 +00:00
Robert McQueen
041ae7bd99 installation: add _run_triggers function
Closes: #2161
Approved by: alexlarsson
2018-10-01 12:29:50 +00:00
Robert McQueen
3dea58b53b installation: add _NO_TRIGGERS flags to install/update/uninstall ops
Closes: #2161
Approved by: alexlarsson
2018-10-01 12:29:50 +00:00
Robert McQueen
b881d9576f dir: use g_utime in flatpak_dir_mark_changed
Avoids an un-necessary fsync() call of an empty file.

Closes: #2161
Approved by: alexlarsson
2018-10-01 12:29:50 +00:00