This commit ensures that flatpak_remote_state_save_summary()
initializes the passed GError pointer when returning FALSE. I found this
when looking into https://github.com/flatpak/flatpak/issues/1255 because
at the time of that bug report flatpak_dir_update_appstream() had this
g_file_replace_contents() code in it, which would have caused a seg
fault in update_appstream() after an unsuccessful call to
flatpak_dir_update_appstream().
Fixes https://github.com/flatpak/flatpak/issues/1255Closes: #1893
Approved by: alexlarsson
Since the create-usb command doesn't run as root (and if it did GNOME
Software wouldn't be able to call out to it), it can't update the
summary file in the source repo if the system installation is being
used. So the user is expected to run `ostree summary -u` before using
create-usb. But if the create-usb command then updates the appstream
data and repo metadata refs, the summary will no longer point to the
latest commits on those refs. As a short term fix, avoid updating the
appstream data and repo metadata, and mention in the manpage that the
user should do so. The better solution, not requiring any manual steps
on the user's part, will require a fix for
https://github.com/ostreedev/ostree/issues/1664.
If a remote is added or modified in the cloned FlatpakDir
we also drop caches in the one in the installation.
Fixes#1882Closes: #1883
Approved by: alexlarsson
If the system helper process exits due to being idle the
FlatpakSystemHelper dbus proxy will return errors on
all calls, because it resolves the well known name to
a unique name on creation, which means it will try
to talk to the old idle-exited instance.
The fix is to not use GDBusProxy, but instead manually
call g_dbus_connection_call_sync().
Fixes#1845Closes: #1873
Approved by: mwleeds
I don't think there is really an acceptable setting that does
the right thing always, so disable any adding/removing
of brackets.
Closes: #1870
Approved by: alexlarsson
Setting an error with second_error->message is going to work poorly
when second_error has never been set non-NULL.
Related to #1845, although not necessarily the full solution.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #1867
Approved by: alexlarsson
This adds the flatpak_transaction_add_install_flatpakref method
to easily install from flatpakref files. It additionally
adds a new signal called add-new-remote which is called in two
cases:
To ask if the user wants to add a "normal" remote for the url
specified by a flatpakref file.
When a new remote is required for the runtimes the application
depends on.
Closes: #1868
Approved by: alexlarsson
This will be used as the default when installing something that
doesn't specify a ref, such as a flatpakref file.
Closes: #1868
Approved by: alexlarsson
When you're looking at the Flatpak Command Reference on
docs.flatpak.org, it's not clear that it was generated from the flatpak
repo. So add a notice to the docbook that's used to generate the HTML.
This was pointed out by
https://github.com/flatpak/flatpak-docs/pull/134
This is used to create the /var/lib/flatpak repo if
needed so that other later operations work. We have
some partial support for it not working in various
operations (using the allow_empty argument) but
this is in no way complete. For example, this
can easily happen if you have a per-user installation
but no system one and then you run flatpak install
with no --user, then it will try to figure out
which one to use and die.
This is the equivalent of commit 86fd56dce for the commands added
in commit 2465cf4 to test #1587.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #1864
Approved by: alexlarsson
In the case that the collection ID configured on a remote is NULL the
repo metadata comes from the summary file. But if there's an error
fetching the summary in _flatpak_dir_get_remote_state() and then
flatpak_remote_state_ensure_metadata() is called, the
metadata_fetch_error variable will be NULL and "unknown error" will be
returned as the error message. This commit returns the
summary_fetch_error message in that case so the user gets a slightly
more helpful error message.
Some Endless computers in Africa have recently been hitting this code
path and printing "unknown error" messages.
Closes: #1844
Approved by: alexlarsson