We now return a NULL error meaning nothing is printed as before
but a FALSE result which means the exist code marks the failure.
Closes: #2858
Approved by: alexlarsson
This is very useful for the CLI where you want to fail the operation and
return a failure exit code, but the user actively chose to do so on
a prompt, so you don't need to print out anything.
Semantics are: if return FALSE => print error if non-null, then exit
with failure code.
Closes: #2858
Approved by: alexlarsson
This mostly worked because QuietTransaction doesn't ask anything, but
some early checks in the commands itself only checked opt_yes.
Closes: #2858
Approved by: alexlarsson
We need to handle operation_error and report errors, and for
fatal errors remember this and report a failure in run(), because
otherwise it returns ABORTED, which is treated as a failure (because
generally that meant the user chose "no" on some question).
Fixes#2839, #2757Closes: #2858
Approved by: alexlarsson
In some OSs, removing a package does not immediately remove its
configuration files in /etc. In particular, `dpkg --remove` or
`apt-get remove` in Debian derivatives leaves configuration files intact
so that the package can be reinstalled later without having to
reconfigure it, with `dpkg --purge` or `apt-get purge` used to remove
the configuration files too.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #2840Closes: #2849
Approved by: alexlarsson
There is no great place for this, but the transaction api is
the primary place affected by this problem so I put the note there.
Closes: #2856
Approved by: alexlarsson
We enforce an umask of 022 (no world/group writable) in the cli and
the system helper. This is necessary, because we need to create
ostree repositories shared between the helper and the client, and
a more strict umask breaks this.
It would be nice if we could just set this in a thread-local way when
needed, but unfortunately umask() is not threadsafe or overridable in
any local way.
This unfortunately means this it will not automatically work for
libflatpak users...
Closes: #2856
Approved by: alexlarsson
We need this to ensure that the dir can be shared with the new
system-helper flatpak user. Old dirs can happen to get less
permissions if there was a umask set when it was created.
Closes: #2856
Approved by: alexlarsson
Instead of combining name and comment we split them into two columns.
We also disable the comment column by default for list and remote-ls
as it is very poor in long tables. However, it is still there for search
where it seems more useful.
Also, the Application column title changed to Application ID to make
it clearer what it is compared to the "Name" column.
Closes: #2852
Approved by: alexlarsson
Old versions of the create-usb command created a summary file in the
local repo being pulled from (e.g. /var/lib/flatpak/repo) but this
summary generation turned out not to be necessary and was removed. So
any computer which used the create-usb command before commit 7c5751a4f
will have a leftover /var/lib/flatpak/repo/summary file which becomes
outdated as apps are updated and installed. This causes problems for the
next invocation of (a recent version of) the create-usb command which
will use the outdated summary during the pull and fail with an error
message like:
error: Importing 3b1293596e9aa67f6fd0daeae477cb94603a4e8ca9e825f446d3dd04a2b5d5ec.commit:
fstatat(3b/1293596e9aa67f6fd0daeae477cb94603a4e8ca9e825f446d3dd04a2b5d5ec.commit): No such file or directory
So this commit makes the create-usb command delete the summary if it
exists before pulling onto the repo on the USB drive. This means USB
copies will work again for any users that used the USB app copy feature
in Endless OS 3.4.7.
Closes: #2854
Approved by: alexlarsson
Additionally flatpak_table_printer_set_columns now takes a boolean
to say whether the arguments in use are the default.
Closes: #2850
Approved by: matthiasclasen
If a column is marked skip_unique it will be entierly skipped
if all the rows have the same unique value for it. This is
useful for example to skip the arch column if all arches are
the same.
Closes: #2850
Approved by: matthiasclasen
When an appstream update is cancelled while downloading
icons, properly fail. Otherwise, the next update attempt
will see an up-to-date timestamp, think everyhing is ok
and not download the missing icons.
Closes: https://github.com/flatpak/flatpak/issues/2835Closes: #2836
Approved by: alexlarsson
This environment variable has been used for a while; it's just
undocumented. Copy some information from a comment in flatpak-dir.c.
Closes: #2841
Approved by: matthiasclasen
As seen in https://github.com/flatpak/flatpak/issues/2829,
the system-helper crashes while trying to access an as
parameter as s. Looking at the likely culprits for this,
I find that the permission check for Deploy has an off-by-one
error where it tries to get the installation, but
passes the offset for the previous_ids parameter.
Closes: #2831
Approved by: matthiasclasen
On some systems we can't make use of FUSE, especially on the same
locked-down systems where distribution packages are typically built.
For example, official Debian autobuilders (buildds) are configured to
disallow module loading after boot has finished as a form of security
hardening, some build chroots don't have a valid /etc/mtab, and Docker
containers give us uid 0 but not CAP_SYS_ADMIN.
These checks are taken from libostree.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #2824
Approved by: matthiasclasen
This follows the same logic as the system bwrap.
Otherwise, build-time tests will fail when we are using a system
xdg-dbus-proxy and not compiling our own (the symptom is that testlibrary
hangs).
Signed-off-by: Simon McVittie <smcv@collabora.com>
Closes: #2823
Approved by: matthiasclasen
This tests that we pick a new version, that the old is uninstalled
and that when running it old data is migrated.
Closes: #2775
Approved by: alexlarsson
This copy-pastes a lot of internal code from flatpak-dir.c to mess with
the deploy file. It could be made a lot shorter...
https://phabricator.endlessm.com/T23845Closes: #2775
Approved by: alexlarsson
flatpak run checks if there is any previous-ids for the app and
sees if there is a corresponding app-dir in ~/.var/app/ .
If so, it renames that app-dir to the new app-id and provides
a symlink from old app-id dir to new app-id dir, and exposes
these symlinks to the sandbox. The symlink is needed because even
though the XDG_DATA_DIR and other environment variables are set
to the new ID by flatpak run, the app itself could've stored
(eg in GSettings, or other files) paths which contained the old ID.
https://phabricator.endlessm.com/T23532Closes: #2775
Approved by: alexlarsson
end-of-lifed-with-rebase runs earlier in the transaction system than end-of-lifed, meaning it can modify the transaction for rebasing.
The new flatpak_transaction_add_rebase() function can then be used to apply the rebase if wanted.
Closes: #2775
Approved by: alexlarsson