Commit Graph

3789 Commits

Author SHA1 Message Date
Simon McVittie
ea73d96e02 testlibrary: Correct a wrong string in a debug message
This always printed "setting HOME=(null)" because we didn't set
datadir yet, but it should have been looking at homedir anyway.

Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #1760
Approved by: alexlarsson
2018-06-11 07:38:21 +00:00
Simon McVittie
2471f0552c testlibrary: Let the test web server's stderr go to the test's stderr
Signed-off-by: Simon McVittie <smcv@collabora.com>

Closes: #1760
Approved by: alexlarsson
2018-06-11 07:38:21 +00:00
Alexander Larsson
16f9b7322a Update pofiles 0.11.8.1 2018-06-08 14:46:04 +02:00
Alexander Larsson
c7f2095413 Update version and NEWS for 0.11.8.1 2018-06-08 14:41:22 +02:00
Alexander Larsson
7311eff800 Fix regression with --own=name
We deleted the "filtered" policy, but forgot to delete it in one place.

This fixes https://github.com/flatpak/flatpak/issues/1761
2018-06-08 14:39:35 +02:00
Alexander Larsson
c86ad3125b Update pofiles 0.11.8 2018-06-07 16:47:02 +02:00
Alexander Larsson
d3a66bc414 Update NEWS for release 2018-06-07 16:37:47 +02:00
Alexander Larsson
68b14e3512 Bump version to 0.11.8 2018-06-07 16:14:04 +02:00
Alexander Larsson
66b2ff40f7 run: Support accessing host trusted certificates
If p11-kit server is installed on the host, we spawn a copy of this, forwarding the access to the
p11-kit trust module in a read-only way.

We then (if the above worked) bind mount the socket as /run/user/$UID/p11-kit/pkcs11 in the sandbox,
which is the default socket path for the p11-kit-client module.

We also add a configuration file in /etc/pkcs11/modules/p11-kit-trust.module that makes the trust
module actually load the client module instead. This means applications automatically switch
to using the host certs for trust if possible, and use the runtime ca-certificates otherwise.

Additionally we add a config file that always disables pkcs user
config merging, because pkcs11 modules on the host are unlikely to work in a random runtime.

Closes: #1757
Approved by: alexlarsson
2018-06-07 12:25:21 +00:00
Alexander Larsson
b4bb890516 session-helper: Add new more generic helper start method
This does the same as RequestMonitor, but returns the status via a
a{sv} so that its more extensible.

Closes: #1757
Approved by: alexlarsson
2018-06-07 12:25:21 +00:00
Alexander Larsson
c6ccf26eec configure: Bump system bwrap requirement to 0.2.1
There are some fixes in this, like the /dev/fd symlinks that
are important.

See e.g. https://github.com/flatpak/flatpak-builder/issues/160 for an example.

Closes: #1758
Approved by: alexlarsson
2018-06-07 12:24:33 +00:00
Alexander Larsson
df3a0c444b deploy: Do required-version check on deploy too
We only checked this in transaction. This is now the recommended way to installation
via libflatpak too, but if you use the old API this check also ensures that
installation fails if the required version is too old.

Also, we add a specific error code for this so callers can check for it.

Fixes https://github.com/flatpak/flatpak/issues/881

Closes: #1755
Approved by: alexlarsson
2018-06-04 13:30:00 +00:00
Philip Withnall
ebb9baaeac common/installation: Fix indentation in a block
This introduces no functional changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1736
Approved by: alexlarsson
2018-06-04 12:22:30 +00:00
Philip Withnall
441fe25255 all: Use GMainContextPopDefault when handling thread defaults
Simplify some of the return logic when handling pushing/popping the
thread default main context by using g_autoptr(GMainContextPopDefault).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1736
Approved by: alexlarsson
2018-06-04 12:22:30 +00:00
Alexander Larsson
cefe0a2e41 uninstall: Add --unused
This removes all runtimes that are not used by some app, or any sdk
used by a runtime that some app uses.

Closes: #1754
Approved by: alexlarsson
2018-06-04 12:08:59 +00:00
Alexander Larsson
a7ea6844d8 Add new extension key autoprune-unless and propagate it to related refs
The idea is for e.g. the gl extension to have
 download-if=active-gl-driver
 autoprune-unless=active-gl-driver

And then we can automatically find and uninstall unused gl drivers.

Closes: #1754
Approved by: alexlarsson
2018-06-04 12:08:59 +00:00
Alexander Larsson
e3559ddd41 flatpak_dir_find_local_related: Fix handling of subdir extensions
We were not correctly handling the partial refs that ostree_repo_list_refs()
returned, instead assuming they were full refs.

Closes: #1754
Approved by: alexlarsson
2018-06-04 12:08:59 +00:00
Alexander Larsson
4b119c41f0 info: Add show-runtime and show-sdk
Also show sdk in regular output

Closes: #1753
Approved by: alexlarsson
2018-06-04 11:46:07 +00:00
Alexander Larsson
798e8adfee remote-info: Add show-runtime and show-sdk
Also, print sdk in regular output

Closes: #1753
Approved by: alexlarsson
2018-06-04 11:46:07 +00:00
Alexander Larsson
1463c468e2 flatpak info: Add --show-location
This shows the location the ref is deployed to

Closes: #1753
Approved by: alexlarsson
2018-06-04 11:46:07 +00:00
Alexander Larsson
376a325eda tests: Test uninstall fail due to dependencies
Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
3134512111 transaction: Reorder uninstalls so apps come before the runtimes they depend on
Otherwise we will fail if we uninstall "runtime app".

Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
de5a713336 uninstall: Don't allow uninstalling a runtime with apps that need it
Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
518da832ee Deploy: Store runtime dependencies in deploy data
For applications, we extract the name of the runtime it uses
so that we quickly can look up dependencies.

Closes: #1750
Approved by: alexlarsson
2018-06-01 15:45:08 +00:00
Alexander Larsson
3e47247425 Batch running triggers
This moves the triggers from out of flatpak_install/update/uninstall
and instead calls them manually at all the sites that call this.

This allows FlatpakTransaction to only run the triggers once for the
entire operation.

Closes: #1743
Approved by: alexlarsson
2018-06-01 11:41:56 +00:00
Alexander Larsson
bc4a2d8dbf uninstall: Add --all
Closes: #1744
Approved by: alexlarsson
2018-06-01 10:59:14 +00:00
Alexander Larsson
715cc173ef Transactions: Add uninstall operation and handle no-pull correctly
In the no-pull case and when uninstalling, we never want to do any network
i/o for e.g. detecting depenedencies.

Closes: #1744
Approved by: alexlarsson
2018-06-01 10:59:14 +00:00
Alexander Larsson
f93886cb65 dir: Add flatpak_dir_get_remote_state_local_only
This does no network i/o and just keeps track of remote name
and collection id. This can be used for no-pull transactions.

Closes: #1744
Approved by: alexlarsson
2018-06-01 10:59:14 +00:00
Alexander Larsson
e7c9347b49 dir: Add flatpak_dir_read_latest_commit
This reads the current commit for a ref in the local repo.
This can be used e.g. to get at the metadata for an already pulled ref.

Closes: #1744
Approved by: alexlarsson
2018-06-01 10:59:14 +00:00
Alexander Larsson
f52d90635e dir: flatpak_dir_search_for_local_dependency
This is the same as flatpak_dir_search_for_dependency, but it looks only in the local
repo for already pulled dependencies. This is useful if you're in no-pull mode.

Closes: #1744
Approved by: alexlarsson
2018-06-01 10:59:14 +00:00
Piotr Drąg
d174a6d604 Update POTFILES.in
Closes: #1748
Approved by: alexlarsson
2018-06-01 10:21:33 +00:00
Alexander Larsson
ffe1b7e349 Make various operation work without a system installation
This makes info, list, remotes, and search work if there is no
system flatpak repo. Before it failed with EPERM.

Closes: #1742
Approved by: alexlarsson
2018-05-31 19:28:16 +00:00
Alexander Larsson
aff4c1f4fc tests: Fix some unused variable errors in non-p2p builds
Closes: #1745
Approved by: alexlarsson
2018-05-31 19:16:15 +00:00
Alexander Larsson
586f754eca repair: Remove refs that are not deployed
Closes: #1739
Approved by: alexlarsson
2018-05-31 15:37:09 +00:00
Alexander Larsson
15d2918255 repair: Update copyright year to 2018
LIVE IN THE NOW!

Closes: #1739
Approved by: alexlarsson
2018-05-31 15:37:09 +00:00
Alexander Larsson
552ac1351a Require ostree 2017.15 for ostree_repo_fsck_object().
Closes: #1739
Approved by: alexlarsson
2018-05-31 15:37:09 +00:00
Alexander Larsson
f239a6e6a4 Add flatpak repair command
This is a fsck-like command that tries to automatically repair your
flatpak installations. It works by running an fsck on all the refs in
the local repo, and removing all refs that has an unexpectedly missing
(or deleted) object.

Then it runs a prune, which will remove all the object that were
referenced by these removed refs (that were not references by anything
else), so that any non-detected invalid objects are also removed.

Then it looks at all the deployed refs, and if they lack a ref in
the local repo, we `install --reinstall $origin $ref` them.

Closes: #1739
Approved by: alexlarsson
2018-05-31 15:37:09 +00:00
Alexander Larsson
3035ff410b CI: Disable introspection when building with clang
f28 default cflags are picked up by g-ir-scanner and they don't work with clang as per:
 https://bugzilla.redhat.com/show_bug.cgi?id=1543295

Closes: #1741
Approved by: alexlarsson
2018-05-31 14:34:49 +00:00
Alexander Larsson
2d9865d1d8 CI: Install python2
This is needed for the tests

Closes: #1741
Approved by: alexlarsson
2018-05-31 14:34:49 +00:00
Alexander Larsson
371dcf382e CI: Update annobin to maybe fix build
I was getting this:

annobin: Flatpak_1.0.c: Error: plugin built for compiler version (8.0.1) but run with compiler version (8.1.1)
cc1: error: fail to initialize plugin /usr/lib/gcc/x86_64-redhat-linux/8/plugin/annobin.so

Closes: #1741
Approved by: alexlarsson
2018-05-31 14:34:49 +00:00
Alexander Larsson
10bab99ac7 CI: --nodeps remove flatpak
Otherwise this fails with:

$ rpm -e flatpak
error: Failed dependencies:
	flatpak >= 0.11.1 is needed by (installed) xdg-desktop-portal-0.11-1.fc28.x86_64

Closes: #1741
Approved by: alexlarsson
2018-05-31 14:34:49 +00:00
Alexander Larsson
7fcee796c9 Update CI to f28
Closes: #1741
Approved by: alexlarsson
2018-05-31 14:34:49 +00:00
Alexander Larsson
9757e4883e tests: Hacks to handle coreutils-single
In the Fedora 28 base container, `coreutils-single` is used and so
`/usr/bin/ls` is actually a "script":

```
$ file /usr/bin/ls
/usr/bin/ls: a /usr/bin/coreutils --coreutils-prog-shebang=ls script, ASCII text executable
```

We handle this by detecting shebangs in dependencies and recursively adding them.

Closes: #1741
Approved by: alexlarsson
2018-05-31 14:34:49 +00:00
Matthew Leeds
516c0f40b6 common: Update flatpakinclude_HEADERS
These headers were recently added to flatpak.h, so they need to be in
flatpakinclude_HEADERS so they are installed.
2018-05-31 08:33:30 +02:00
Matthew Leeds
c47b4619d7 .gitmodules: Update libglnx URL
Closes: #1734
Approved by: mwleeds
2018-05-30 02:01:07 +00:00
Matthew Leeds
13f0ee5d5b Fix P2P build against ostree 2018.6 (again)
ostree 2018.6 will make the P2P API public that was previously
experimental, and add a "p2p" feature flag to replace "experimental". So
this commit updates the logic in flatpak's configure.ac so that we check
for either feature flag and only define OSTREE_ENABLE_EXPERIMENTAL_API
if necessary. This way we can do the right thing against development
builds of 2018.6 that might not have the P2P API public yet.

This commit also changes the behavior when flatpak is built against
ostree < 2018.6. Specifically, P2P support is enabled if and only if
we're building against an ostree that has the relevant API, rather than
depending on the user to use `--enable-p2p` or `--disable-p2p`. This way
we can enable P2P by default (which will make it easier for Flathub to
enable P2P support) without breaking builds of flatpak against versions
of ostree without the experimental API.

In the near future we should remove all the ifdefs so that the P2P
functionality becomes unconditional, but if we wait for flatpak to take
a dependency on ostree 2018.6 we can avoid breaking any builds.

(This is a redo of commit 34212ef24 that doesn't break builds of flatpak
against current ostree master, which doesn't yet have
https://github.com/ostreedev/ostree/pull/1596)
2018-05-29 16:22:21 -07:00
Alexander Larsson
90bed3f461 Remove unused variable 2018-05-29 21:54:07 +02:00
Philip Withnall
d325be85f1 common: Pop the thread default main context in find_latest_rev()
The pop was missing, meaning that calling flatpak_dir_find_latest_rev()
corrupted the thread default main context stack of the caller.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-05-29 21:52:13 +02:00
Alexander Larsson
fbb8200059 Revert "Fix P2P build against ostree 2018.6"
This reverts commit 34212ef249.

We need to wait until the p2p pr
(https://github.com/ostreedev/ostree/pull/1596) has landed, because otherwise
a git master build of ostree reports version 2018.6 and we assume it has
the p2p API.
2018-05-29 21:46:55 +02:00
Piotr Drąg
0e2ed0058b Update POTFILES.in 2018-05-29 18:40:27 +02:00