Commit Graph

7002 Commits

Author SHA1 Message Date
Phaedrus Leeds
1f7ff92c51 app: Improve end-of-life info message
I think the "app//branch" syntax is pretty ugly, and maybe not all users
understand it.

Helps: #3531
2022-06-15 16:44:17 -07:00
Phaedrus Leeds
cb90c919be transaction: Validate end-of-life-rebase ref 2022-06-15 16:44:17 -07:00
Phaedrus Leeds
4869437880 app: Fix typo in debug message 2022-06-15 16:44:17 -07:00
Alexander Larsson
0b4f1dadbf Bump glib requirement to 2.46 (from 2.44)
Since we switched to libappstream we really have an implicit dependency
on this, as there are no versions of it building with glib earlier
than 2.46.

This isn't dropping a lot of old code, but at least it is more truthful
about our actual dependencies.
2022-06-14 08:54:18 +02:00
Alexander Larsson
204abd772f main: Don't install polkit agent when running in tests, fixing slowness.
In the tests we don't use a systemwide helper anyway, so the polkit
stuff is unnecessary. Also, for some reason this was taking a very
long time for me, causing the tests to be super slow.
2022-06-13 20:02:04 +01:00
Simon McVittie
f8202512a9 Update xdg-dbus-proxy submodule to 0.1.4
This adds support for being used as a Meson subproject, and fixes some
minor bugs and compiler warnings.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-03 10:56:57 +02:00
Simon McVittie
091af2b481 Update bubblewrap subproject to v0.6.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-06-03 10:56:48 +02:00
Debarshi Ray
4965e5d076 selinux: Permit using systemd-userdbd
The systemd-userdbd service was added in systemd 245, which was
released in March 2020 and is available in RHEL 9.  Therefore, it's
safe to assume that the systemd_userdbd_stream_connect() SELinux
interface is also available on all relevant operating systems, unless
there's reason to believe otherwise.

https://bugzilla.redhat.com/show_bug.cgi?id=2071217
2022-06-03 10:56:12 +02:00
Sabri Ünal
0c9e7d139a Uptade Turkish translation
This commit updates Turkish translation.
2022-06-03 10:55:28 +02:00
Hugo Carvalho
03837c3c1e Add portuguese(pt) translation and sort LINGUAS file alphabetically 2022-06-03 10:54:44 +02:00
Debarshi Ray
ed3a1b5f45 build: Don't leak the destination prefix
Clearly, 'dest' can't be a 'const char *' when it's pointing at
g_strdup:ed strings.
2022-06-03 10:53:03 +02:00
Debarshi Ray
d70b82237d context, instance: Don't ignore errors when creating directories
Of the 19 instances where g_mkdir_with_parents() is used, these are
the only ones where the return value is ignored.  This triggers
Coverity.

It might not be strictly necessary to handle the errors, but doing so
can only help with debugging.
2022-06-03 10:53:03 +02:00
Debarshi Ray
8f92ca6198 dir: Don't ignore errors when deleting a file
Of the 16 instances where g_file_delete() is used, these are the only
ones where the return value is ignored.  This triggers Coverity.

It might not be strictly necessary to handle the errors, but doing so
can only help with debugging.
2022-06-03 10:53:03 +02:00
Debarshi Ray
50835cccfd utils: Avoid passing a potentially NULL pointer to strlen(3) 2022-06-03 10:53:03 +02:00
Debarshi Ray
dabc01c3f3 NEWS: Update for 1.13.3 so far 2022-06-03 10:48:31 +02:00
Anders Jonsson
6fd8517519 Update Swedish translation 2022-05-17 19:58:07 -07:00
Yuri Chornoivan
b58abcabac Update Ukrainian translation 2022-05-17 19:55:54 -07:00
Simon McVittie
5d12218591 Update libglnx submodule
This fixes some compiler warnings, and improves support for building as
a Meson subproject in preparation for adding a Meson build system to
Flatpak.

- https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/34
- https://gitlab.gnome.org/GNOME/libglnx/-/merge_requests/35

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-17 19:52:46 -07:00
Phaedrus Leeds
389e0fa2c2 common: Fix a parenthesis typo in an error message
Fixes #4878
2022-05-07 11:16:57 +01:00
Ryan Gonzalez
12305b2cae Add --include-sdk/debug to install SDK/debuginfo along with a ref
This makes it a lot easier to give guidance on using `flatpak run -d` or
`flatpak-coredumpctl`, because there's an easy way to install the
relevant refs.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2022-05-06 17:35:30 -07:00
Alexander Larsson
3a2755d7fd build-update: Only add the specified summary-arches to the compat summary
We support the "summary-arches" variable to limit which arches goes
into the compat summary file. However, its currently always adding in
the compat arches of whatever arches you list. This means we can't
e.g. keep compat summary support for aarch64, but not for armv7, which
is a problem as we're nearing the 10MB summary size limit of ostree
for old clients.

So, just keep the exact arches listed. If you want to keep compat
arches, you need to explicitly list them.
2022-05-05 15:55:33 +02:00
Simon McVittie
0b83fdb71f workflows: Take libostree from PPA instead of building it from scratch
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:56:14 +02:00
Simon McVittie
0a43e98c97 workflows: Use team-maintained Flatpak PPA for ostree dependency
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:56:14 +02:00
Simon McVittie
968169a774 workflows: Run distcheck
This lets us verify that our ability to do releases hasn't regressed.

Run this as part of the "valgrind" build, since we want to enable
gtk-doc for distcheck, and it's this build that already enables gtk-doc.
We don't want to do this in the main Autotools build, since
that enables AddressSanitizer, which often works badly with the
"scanner" tools in gtk-doc and GObject-Introspection - although this
is currently mitigated by --enable-asan not actually working as
intended (see #4844).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:56:14 +02:00
Simon McVittie
1e09311621 workflows: Explicitly enable/disable GObject-Introspection
For the build that uses --enable-asan, explicitly disable introspection,
since the GObject-Introspection scanner works poorly with libtool
and AddressSanitizer (see #4844); the only reason this worked until
now is that --enable-asan doesn't currently do anything (again,
see #4844).

For the build that runs tests under valgrind, we already can't use
AddressSanitizer, making this a good place to explicitly enable
introspection, so that we have at least one build with it enabled.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:56:14 +02:00
Simon McVittie
cb73e098ef workflows: Move gtk-doc enablement from clang to valgrind build
We want to have gtk-doc enabled in the build that will run
`make distcheck`, but the clang/CodeQL build seems like a poor fit for
that, since it runs twice (for C and Python) and has extra
instrumentation. Move it to the build where we will run tests under
valgrind, which is already somewhat slow.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:56:14 +02:00
Simon McVittie
cbb61761e7 workflows: Remove a TODO
We explicitly enable gtk-doc for one of our builds (the one that uses
clang on Ubuntu 18.04). There's no real need to enable it for more than
one build.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:56:14 +02:00
Simon McVittie
92ecb7d2d2 libtest.sh: Optionally be more careful what we print on stdout
Meson's TAP parser is more strict than the one in Automake, and will
not accept and ignore arbitrary output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
a6a1e37a8c tests: Avoid printing arbitrary text to stdout
Meson's TAP parser won't accept this, unlike Automake's. At the moment
libtest.sh directs stderr to stdout anyway, so there is no practical
effect for this change, but a subsequent commit will remove that merging.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
c652d538eb tests: Redirect stdout to stderr for flatpak_installation_launch
This avoids polluting stdout with the output of the launched app,
which would corrupt the test's TAP output. With Autotools, we get away
with it, because Automake's TAP parser is permissive, but Meson's TAP
parser is more strict.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
0728b97e22 test-history: Make it easier to debug on failure
If `flatpak history` fails, let's show the log file before failing
the test.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
3e8319c9b4 tests: Factor out generation of test runtime into a script
This will make it easier to invoke from Meson.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
1082201be9 tests/update-test-matrix: Move into a standalone script
This will allow the same script to be used to generate
Makefile-test-matrix.am.inc and its Meson equivalent.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
f090f1a1f3 tests: Wrap EXTRA_DIST, one file per line
This will reduce conflicts when adding more files.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
aef1442d54 icon-validator: Don't make flatpak_get_bwrap() extern
The Meson build files that I'm working on enable more compiler warnings
by default than Autotools does, and in particular -Wmissing-declarations
complains about global functions that are not predeclared. There's no
need for this one to be global.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
2bfd373d6d selinux: Factor out build steps into a script
This will make them easier to share between Autotools and Meson.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
91b38f64c2 utils: Put an Auto prefix on locally-defined autoptr cleanups
As with commit de9fe1cb "common: Work around new glib codegen
autogenerating g_autoptr support", this avoids colliding with newer
versions of gdbus-codegen generating their own autocleanups. This is
helpful when using Meson, in which the gdbus-codegen integration
generates more autocleanups by default.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Simon McVittie
134950e337 .gitignore: Be more specific about what we ignore
When we add a Meson build system, we will need to add a meson.build in the
subdirectories that were ignored by these rules. Ignore individual files
instead of entire subdirectories.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-03 13:54:23 +02:00
Debarshi Ray
8617ab0ad0 selinux: Permit read access to /var/lib/flatpak
It's clearly quite important to have read access to /var/lib/flatpak
and it's contents.  This explicitly permits that to avoid running
into SELinux denials.

https://bugzilla.redhat.com/show_bug.cgi?id=2070741
2022-04-23 16:13:00 +01:00
Debarshi Ray
f8a9153d0e selinux: Let the system helper watch files inside $libexecdir
The system-helper (ie., the `flatpak-system-helper` process) is
labelled with flatpak_helper_exec_t and runs in the flatpak_helper_t
domain, and tries to set up an inotify(7) watch on it's own binary so
that it can exit when the binary is replaced.  This explicitly permits
it to do so to avoid running into SELinux denials.

The corecmd_watch_bin_dirs SELinux interface is a recent addition [1],
and is therefore used conditionally when defined.

[1] https://github.com/fedora-selinux/selinux-policy/commit/88072fd293
    https://github.com/fedora-selinux/selinux-policy/pull/1133

https://bugzilla.redhat.com/show_bug.cgi?id=2053634
2022-04-23 16:13:00 +01:00
Phaedrus Leeds
45d86effce tests: Remove a pointless test
Typo correction has nothing to do with --no-pull or --no-deploy so it
doesn't make sense to test them together when we already test each
separately.

[smcv: Resolve conflict with #4858]
2022-04-23 16:12:53 +01:00
Phaedrus Leeds
b95525eae2 doc/flatpak-run: Update docs about env vars 2022-04-23 14:54:58 +01:00
Phaedrus Leeds
f4727eacb6 doc/flatpak-run: Add more info 2022-04-23 14:54:58 +01:00
Phaedrus Leeds
239706c9c1 uninstall: Make help message more accurate 2022-04-23 14:54:58 +01:00
Debarshi Ray
002e4455d8 selinux: Let the system helper have read access to /etc/passwd
The system-helper (ie., the `flatpak-system-helper` process) is
labelled with flatpak_helper_exec_t and runs in the flatpak_helper_t
domain, and needs to be able to read /etc/passwd.  This explicitly
permits it to do so to avoid running into SELinux denials.

https://bugzilla.redhat.com/show_bug.cgi?id=2070350
2022-04-21 20:57:52 +01:00
Phaedrus Leeds
c7d262b375 app: Disable fuzzy matching if not on a tty
As discussed in #4848, this disables fuzzy matching entirely if stdin or
stdout is not a tty, meaning that something like "flatpak install
firefox" would be treated as incorrect syntax, since this syntax is
intended for interactive CLI use. Even before this commit, "flatpak
install firefox" would error out if run without a tty, since we don't
automatically choose a matching app ID even if there is only one match.
However "flatpak install -y firefox" could work before, but won't any
more. People should be specifying the full app ID in any context other
than a tty.

This commit also introduces a new env var so the unit tests can continue
to check the fuzzy matching behavior, despite them being run without a
tty.
2022-04-21 20:53:46 +01:00
Phaedrus Leeds
5acb4ee7e4 app: Disable fuzzy ref matching when id has a period
As discussed in #4848, this disables fuzzy matching when the string
given has a period in it. So for example "flatpak install org.mozilla"
would not offer "org.mozilla.firefox" even though the string given is a
substring of the app ID. This is desirable because it helps ensure fuzzy
matching is only used when the user intended to use it.

As with the previous commit that fixed #4829, this does technically
break backwards compatibility, but only in an interface intended for
interactive use by a human, not an interface that's used
programmatically, so it seems okay.
2022-04-21 20:53:46 +01:00
Phaedrus Leeds
23926b7090 app: Disable fuzzy ref matching when id has a slash
Fixes https://github.com/flatpak/flatpak/issues/4829
2022-04-21 20:53:46 +01:00
Phaedrus Leeds
9e6b28daf5 uninstall: Make error message prettier
The "*unspecified*" bits are ugly, and the ref/arch/branch syntax is
especially confusing when we're doing fuzzy matching, since it implies
the id was searched for exactly.
2022-04-19 15:38:44 +01:00
Phaedrus Leeds
a30ef8f007 uninstall: Error out when all refs are invalid
Currently if you specify one non-existent ref to the uninstall command,
it exits with a non-zero status:

$ flatpak uninstall notaflatpak
error: notaflatpak/*unspecified*/*unspecified* not installed

...but if you specify more than one non-existent ref you get warnings
for each and a zero exit status:

$ flatpak uninstall notaflatpak alsonot
Warning: notaflatpak is not installed
Warning: alsonot is not installed

So make the latter case error out like the former.
2022-04-19 15:38:44 +01:00