Commit Graph

6543 Commits

Author SHA1 Message Date
Simon McVittie
4c8264fc0e tests: Add test coverage for a mock Fedora-like system
In particular this tests commit 3aaea7d2 "Expose /var/usrlocal if
"--filesystem=host" is specified" and checks that /var/usrlocal is
counted as part of --filesystem=host-usr.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-08-02 08:37:25 +02:00
gasinvein
0aa5ce45dd Update Russian translation 2021-08-02 08:18:53 +02:00
Phaedrus Leeds
a52c3e4fba .github: Add Sponsor button 2021-08-02 08:16:47 +02:00
Bruno Lopes
9819171709 Update Brazilian Portuguese translation 2021-08-02 08:16:20 +02:00
Yuri Chornoivan
9da4bc0c65 Update Ukrainian translation 2021-07-05 15:14:45 +02:00
Simon McVittie
6ebe33117c Update translation files for v1.11.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
1.11.2
2021-06-17 18:04:32 +01:00
Simon McVittie
b942b2c59c Prepare release 1.11.2
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-17 17:27:01 +01:00
Simon McVittie
0f4296b5b5 build: Don't include gdbus-codegen-generated files in tarball
To be excluded from tarball releases, generated files need to be in
nodist_ lists of sources every time they appear.

Fixes: 412c1577 "portal: Add some test coverage"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-17 09:39:21 +01:00
Philip Withnall
879b632c58 flatpak-transaction: Fix finding runtime with non-default remote+arch
Fix an “The application foo requires the runtime bla which was not
found” error when using libflatpak (not the CLI) to install an
application whose runtime is provided by a different repo, and which is
for a non-default architecture.

This is a follow-up to commit f2ff664ff.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-16 17:59:45 +02:00
Philip Withnall
a7af60f498 flatpak-transaction: Squash error propagation and fix return value
It doesn’t look like this error path is taken very often. Spotted while
reading through the code.

This function is opportunistically looking for dependencies, so a
failure in one remote shouldn’t make the whole operation fail.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-16 17:59:45 +02:00
Simon McVittie
f2b4edc558 Improve release checklist
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-15 14:09:21 +01:00
Simon McVittie
74be057864 portal: Fix a typo in D-Bus API documentation
The client-side proposed for flatpak-spawn uses --app-path, but the
actual implementation on D-Bus uses file descriptor passing and an
option named app-fd, so the documentation of the D-Bus interface should
be written in terms of app-fd.

Fixes: 3ebf371f "run: Allow caller to replace /app and/or /usr"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-06-15 14:51:54 +02:00
Dennis Schridde
1bdbb80ac5 Reword to make it clearer how (not) to invoke flatpak 2021-06-15 10:06:50 +01:00
Dennis Schridde
11d66b4587 Fix grammar 2021-06-15 10:06:50 +01:00
Dennis Schridde
1fa898202a Improve error message for sudo flatpak run
Closes: https://github.com/flatpak/flatpak/issues/3963
2021-06-15 10:06:50 +01:00
Philip Withnall
c8cbf26316 flatpak-installation: Fix some typos in documentation comments
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-06-14 15:30:59 +01:00
Alexander Larsson
b6d5e20857 CI: Add mono apt repo to fix build
For whatever reason parts of mono is installed, but the repo is not
configured so there is a version conflict on update:

libglib2.0-cil is already the newest version (2.12.45-0xamarin19+ubuntu1604b1).
libglib2.0-cil set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libglib2.0-cil-dev : Depends: libglib2.0-cil (= 2.12.10-6) but 2.12.45-0xamarin19+ubuntu1604b1 is to be installed
E: Unable to correct problems, you have held broken packages.
2021-06-01 10:54:53 +02:00
Philip Withnall
ce6fdcf077 transaction: Don’t abort on uninstall if deploy metadata is missing
If the deploy metadata is missing for the locale runtime of an app which
is being uninstalled, flatpak will currently abort on an assertion
failure.

Prevent that abort, at the expense of not uninstalling the locale
runtime. A better fix could be found for this in future.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #3943
2021-06-01 09:51:59 +02:00
Kukuh Syafaat
25a577810a Update Indonesian translation 2021-06-01 09:34:39 +02:00
gasinvein
dca4b79604 Update Russian translation 2021-06-01 09:34:21 +02:00
Phaedrus Leeds
6f86a8ff42 README: Update chat room link
We've moved from Freenode to Matrix, see:
https://discourse.flathub.org/t/should-flathub-flatpak-move-to-another-communication-channel-if-so-where-and-why/1443
https://lists.freedesktop.org/archives/flatpak/2021-May/002127.html
2021-05-28 17:31:20 +01:00
Simon McVittie
412c15772f portal: Add some test coverage
This exercises Spawn() and reproduces #4286.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
afd0cc4d18 portal: Add some design-for-test
During unit testing we don't have a complete Flatpak app or runtime
available, and `flatpak run` is not necessarily in FLATPAK_BINDIR yet;
but we can run the portal with this environment variable set, to
specify a mock implementation of Flatpak.

This helps to reproduce #4286.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
e196efbf6b portal: Add NONE values for flags sets
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
0a44aaff8d tests: Test environment block parsing
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
10a4cd7e08 context: Factor out functions to parse an environment block
This makes them easier to test, and easier to use in related tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
526dae9241 portal: Remap --env-fd into child process's fd space
Just because we can allocate a new, unused fd in the portal's fd space,
that doesn't mean that fd number is going to be unused in the child
process's fd space: we might need to remap it.

Resolves: flatpak/flatpak#4286
Fixes: aeb6a7ab "portal: Convert --env in extra-args into --env-fd"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
a09d07f085 portal: Use a GArray to store fds
This will allow us to add additional mapping entries for fds to be
used internally by `flatpak run`, in particular --env-fd.

Defer the second pass through the fd array until the last possible
moment, so that any extra fds we want to add (like the --env-fd) have
already been added by then.

Helps: flatpak/flatpak#4286
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
f2fbc75827 portal: Don't leak fd used for serialized environment
Otherwise we'll run out of file descriptors eventually, when starting
a sufficiently large number of subsandboxes.

Resolves: flatpak/flatpak#4285
Fixes: aeb6a7ab "portal: Convert --env in extra-args into --env-fd"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 11:11:03 +02:00
Simon McVittie
d13f489e63 Don't disable -Wformat-nonliteral unnecessarily
These functions were already annotated with G_GNUC_PRINTF, so gcc
can assume that the format string and arguments match up.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 10:33:18 +02:00
Simon McVittie
17b6c31c7c Add missing G_GNUC_PRINTF attributes
This allows callers to be checked for mismatches between format string
and arguments, and also means gcc can assume that the format string and
the arguments match up correctly when forwarding them to functions
like g_strdup_vprintf, removing the need to suppress -Wformat-nonliteral
warnings.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 10:33:18 +02:00
Simon McVittie
0592caca8a completion: Always pass a format string to flatpak_completion_debug
In principle this could have been subject to a format string attack
via an argument containing %n, although in practice the code that uses
this format string is #if 0.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 10:33:18 +02:00
Simon McVittie
3d5725f9d3 testcommon: Use unusual architectures where it doesn't matter
If we use x86_64 and i386 in places where any architecture would do,
it's harder to recognise whether the test is assuming every machine
is x86 and would fail elsewhere (e.g. as fixed in #4142). When just
parsing abstract strings where any syntactically valid architecture
would do, let's use rare/niche architectures that none of the maintainers
are running on, so that hard-coding x86_64 or i386 stands out more.

I've used mips64 and m68k because they happen to be the same length as
x86_64 and i386, avoiding re-indentation.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-25 10:31:38 +02:00
scootergrisen
2bb9a8a198 Update Danish translation 2021-05-25 10:30:48 +02:00
Phaedrus Leeds
4f04f92e6f Merge pull request #4256 from flatpak/remote-ls-all-arches
Add FLATPAK_QUERY_FLAGS_ALL_ARCHES for list_remote_refs()
2021-05-19 16:26:29 -07:00
Alexander Larsson
515ae5e5df CLI: List arch if it is not the primary arch (even if unique)
Currenly we only list arch in the list of things to install from a
transaction if not all the refs are the same arch. It makes more sense
to show the arch even if its unique if they are not the primary arch.
2021-05-19 09:54:59 +02:00
Alexander Larsson
0a9d5ac7f2 Include more architectures when listing installed refs.
It turns out that we can't currently uninstall a ref from a
non-standard arch without specifying the arch even if there is no similar
ref installed for the main arch. (#4264)

The fundamental reason for this that `flatpak_dir_find_installed_ref(s)`
currently only returns refs with standard arches unless you explicitly
specify an arch.

This changes flatpak_dir_find_installed_refs() to always return
all the refs for all installed arches. This is generally what
we want anyway, except in the case of "flatpak run org.some.Platform" where
we don't want to prompt if there are multiple arches installed, so that
is manually changed.

This changes find_matching_ref() to look for refs in all arches, but
always prefer (without prompting) the default arch if that is installed.
This also matches what all current callers want.

Fixes #4264
2021-05-19 09:54:52 +02:00
Alexander Larsson
51ac8e1590 builtin-utils: Use shared helper
This uses the new flatpak_remote_state_ensure_subsummary_all_arches() helper
in ensure_remote_state_all_arches().
2021-05-19 09:49:30 +02:00
Alexander Larsson
540bcda3bd Transaction: Ensure we download the subsummary for the arch of added refs
By default we only download the main arch subsummary, so if you added
a ref for some other arch it failed to find the ref. This works with the
CLI, because it explicilty loads the subsummary when its trying to expand
the parial ref to the full ref. However apps using libflatpak don't do that
so they failed.
2021-05-19 09:49:30 +02:00
Alexander Larsson
ce9a1c4f6c Add FLATPAK_QUERY_FLAGS_ALL_ARCHES for list_remote_refs()
This allows flatpak_installation_list_remote_refs_sync_full() to list
refs for all arches on remotes that use the new subsummary format.

Fixes #4252
2021-05-19 09:49:25 +02:00
Simon McVittie
4c7d74ac57 doc: Add a release checklist for maintainers
Signed-off-by: Simon McVittie <smcv@collabora.com>
2021-05-17 10:02:51 +02:00
Philip Withnall
d5daaa537d tests: Fix test-summaries.sh when running tests as root
If the tests are run as root, the system helper is not used even when
commands are run with `--system`. This means a different cache path is
used (see `_flatpak_dir_ensure_repo()`). The tests did not accommodate
for that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-05-17 10:00:33 +02:00
Philip Withnall
087dfe6630 Merge pull request #4269 from pwithnall/strcmp-crash
dir: Avoid a crash when looking up summary for a ref without an arch
2021-05-11 23:18:45 +01:00
Philip Withnall
a65e97c380 dir: Avoid a crash when looking up summary for a ref without an arch
If looking up the summary for a ref without an arch (for example,
`ostree-metadata`, which the Endless OS version of flatpak uses in some
backwards-compatibility code), avoid passing `NULL` to `strcmp()` and
hence crashing.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2021-05-11 15:12:15 +01:00
Phaedrus Leeds
404d7c6941 Fix several memory leaks 2021-05-04 10:23:13 +02:00
Phaedrus Leeds
4562627b04 utils: Add missing check for empty string collection id 2021-05-04 10:23:13 +02:00
Phaedrus Leeds
66d00e1c47 list: Add a g_assert() for a coverity warning 2021-05-04 10:23:13 +02:00
Phaedrus Leeds
a0188dee79 dir: Fix a GString leak 2021-05-04 10:23:13 +02:00
Phaedrus Leeds
284510eabb remote-info: Fix memory leak of branch 2021-05-04 10:23:13 +02:00
Phaedrus Leeds
75e60c5d8e remote-info: Fix printing of branch 2021-05-04 10:23:13 +02:00