5009 Commits

Author SHA1 Message Date
Alexander Larsson
7cde959b4e Update pofiles 1.3.3 2019-04-26 13:55:51 +02:00
Alexander Larsson
bb04fb4063 Bump version to 1.3.3 2019-04-26 12:22:24 +02:00
Alexander Larsson
68b4420502 Update NEWS for release 2019-04-26 12:22:08 +02:00
Alexander Larsson
0a66707b00 remote-ls: Add --cached option
This prefers cached data, even if stale.

Closes: #2859
Approved by: alexlarsson
2019-04-26 08:00:27 +00:00
Alexander Larsson
8057de20a8 remote-info: Add --cached support
This prefers any cached data if available, even if its stale.

Closes: #2859
Approved by: alexlarsson
2019-04-26 08:00:27 +00:00
Alexander Larsson
ad11954bf7 lib: Add a flag-using _full version of list/fetch_remote_ref
This adds the flag FLATPAK_QUERY_FLAGS_ONLY_CACHED to use the new
code for this.

Closes: #2859
Approved by: alexlarsson
2019-04-26 08:00:27 +00:00
Alexander Larsson
aa24754aa0 FlatpakError: Add more dbus error names
Closes: #2859
Approved by: alexlarsson
2019-04-26 08:00:27 +00:00
Alexander Larsson
34f463731d system-helper: respect no-interaction for more methods
Closes: #2859
Approved by: alexlarsson
2019-04-26 08:00:27 +00:00
Alexander Larsson
6088c7d0a1 dir: Add support for getting remote state using only caches
If only_cached is TRUE we never do any network i/o, instead
returning ERROR_NOT_CACHED if this is necessary.

Closes: #2859
Approved by: alexlarsson
2019-04-26 08:00:27 +00:00
Alexander Larsson
cf42364e23 dir: Keep track of the cache dir in FlatpakDir
We will need this later

Closes: #2859
Approved by: alexlarsson
2019-04-26 08:00:27 +00:00
Alexander Larsson
9c9efe19e0 tests: Properly pass -y to install
This bug was unearthed when we suddenly started to fail when you
answered no to the prompt.

Closes: #2858
Approved by: alexlarsson
2019-04-25 10:01:14 +00:00
Alexander Larsson
131ba30ea9 cli: Drop unnecessary "something failed" message with --noninteractive
We reported the error already, just report the exit status.

Closes: #2858
Approved by: alexlarsson
2019-04-25 10:01:14 +00:00
Alexander Larsson
e3db7a4461 cli: Make FLATPAK_ERROR_ABORTED return a failed exit code.
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
2019-04-25 10:01:14 +00:00
Alexander Larsson
7eb6467e4d main: Allow flatpak_run() to fail with NULL error
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
2019-04-25 10:01:14 +00:00
Alexander Larsson
c3f2fe3279 install/update: --noninteractive implies --yes
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
2019-04-25 10:01:14 +00:00
Alexander Larsson
e1f45a3878 Fix install --noninteractive not reporting errors
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, #2757

Closes: #2858
Approved by: alexlarsson
2019-04-25 10:01:14 +00:00
Simon McVittie
684b19e719 profile: Only alter XDG_DATA_DIRS if flatpak is still installed
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: #2840

Closes: #2849
Approved by: alexlarsson
2019-04-25 08:12:35 +00:00
Alexander Larsson
68d06f7896 api docs: Mention the umask(022) workaround.
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
2019-04-25 07:13:58 +00:00
Alexander Larsson
76898c4309 Enforce a more permissive umask
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
2019-04-25 07:13:58 +00:00
Alexander Larsson
9c2176e824 dir: Only reuse system cache dirs with permissions 0755
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
2019-04-25 07:13:58 +00:00
Alexander Larsson
3b060d6082 manpages: Add the new name column
Closes: #2852
Approved by: alexlarsson
2019-04-24 13:31:35 +00:00
Alexander Larsson
2ee4b87c55 remote-ls: Only show the origin column if non-unique
Most of the time it is the same because you specified the remote in
the command anyway.

Closes: #2852
Approved by: alexlarsson
2019-04-24 13:31:35 +00:00
Alexander Larsson
c84db7714e list/remote-ls/search: Split description field
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
2019-04-24 13:31:35 +00:00
Matthew Leeds
bd18eab6ce create-usb: Delete local repo summary if it exists
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
2019-04-24 13:28:21 +00:00
Alexander Larsson
0b05a502a7 remote-ls: Don't list eol:ed app unless -a
Closes: #2853
Approved by: matthiasclasen
2019-04-23 16:07:13 +00:00
Alexander Larsson
5abe002f25 list: Skip origin column if all origins are the same
Closes: #2850
Approved by: matthiasclasen
2019-04-23 13:05:14 +00:00
Alexander Larsson
277a443744 list: Skip arch column if all arches are the same
Closes: #2850
Approved by: matthiasclasen
2019-04-23 13:05:14 +00:00
Alexander Larsson
05ac7f4833 CLI: Add skip_unique_if_default to Column
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
2019-04-23 13:05:14 +00:00
Alexander Larsson
c25de61cd1 table-printer: Add support for skipping unique columns
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
2019-04-23 13:05:14 +00:00
Matthias Clasen
51fce8eee7 permission-reset: Add an --all option
This lets users do a 'factory reset' of the permission store.

Closes: #2830
Approved by: alexlarsson
2019-04-23 07:54:06 +00:00
Matthias Clasen
f28e62add1 oci: Handle cancellations for appstream
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/2835

Closes: #2836
Approved by: alexlarsson
2019-04-23 07:37:10 +00:00
Matthew Leeds
5e710cb995 doc/flatpak: Document FLATPAK_SYSTEM_CACHE_DIR
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
2019-04-20 17:41:34 +00:00
Matthew Leeds
b1d4e19646 doc/build-export: Fix a typo 2019-04-19 15:17:06 -07:00
Matthias Clasen
00dfce5283 Fix a system-helper crash
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
2019-04-15 14:21:37 +00:00
David Hewitt
d0842a1e4c flatpak_installation_update_appstream: mark arch as nullable
Closes: #2826
Approved by: matthiasclasen
2019-04-15 03:23:29 +00:00
Simon McVittie
b07b48e206 Skip some tests if we can't use FUSE
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
2019-04-15 03:09:00 +00:00
Simon McVittie
8115489116 Use system copy of xdg-dbus-proxy for build-time tests if configured
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
2019-04-15 02:54:51 +00:00
Kukuh Syafaat
fde0aa85d9 Update Indonesian translation
Closes: #2827
Approved by: matthiasclasen
2019-04-15 02:39:47 +00:00
Alexander Larsson
f9bf5fb5f9 utils: Add backport of g_clear_handle_id to pre 2.56 glib 2019-04-12 14:32:06 +02:00
Alexander Larsson
a5eebf73d2 distclean the selinux module 1.3.2 2019-04-12 13:18:15 +02:00
Alexander Larsson
774bd6656b Update pofiles 2019-04-12 13:17:54 +02:00
Alexander Larsson
fb4a8dda21 tests: Add gnutls valgrind suppression 2019-04-12 13:01:08 +02:00
Alexander Larsson
f904193a28 Update NEWS for release 2019-04-12 12:00:13 +02:00
Matthias Clasen
d65ebf19f3 list: Add a runtime column
This is useful information, so we should allow showing it.

Closes: #2815
Approved by: alexlarsson
2019-04-12 09:13:34 +00:00
Alexander Larsson
03492dfc28 tests: Add test of eol-rebase
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
2019-04-12 08:59:35 +00:00
Will Thompson
113ee117c0 tests: Test preserving previous-ids and X-Flatpak-RenamedFrom
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/T23845

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Umang Jain
e17b2635d6 run: Support migration from old app-ids to new app-id
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/T23532

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Umang Jain
3c55320539 context: Add support forexposing extra app id dirs
This will be used to export old app id dirs after a rebase.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
7357b2bc63 cli-transaction: Use the new rebase support
Switch to the new eol signal and call flatpak_transaction_add_rebase()
if a rebase was requested.

Closes: #2775
Approved by: alexlarsson
2019-04-12 08:59:35 +00:00
Ryan Gonzalez
7185a00c85 transaction: Add end-of-lifed-with-rebase signal and add_rebase()
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
2019-04-12 08:59:35 +00:00