Commit Graph

3771 Commits

Author SHA1 Message Date
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
Matthew Leeds
34212ef249 Fix P2P build against ostree 2018.6
ostree 2018.6 made the P2P API public that was previously experimental,
and added a "p2p" feature flag to replace "experimental". So this commit
updates the logic in flatpak's configure.ac so that we always enable P2P
support if ostree 2018.6 is available, and don't bother checking for a
feature flag or defining OSTREE_ENABLE_EXPERIMENTAL_API. 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.
2018-05-29 18:36:44 +02:00
Alexander Larsson
8df5a6af11 Fix up gtk-doc warnings 2018-05-29 16:49:44 +02:00
Alexander Larsson
91957b5c61 transaction: strdup progress status in getter
This way we're safe from reentrant use of the progress
2018-05-29 16:37:21 +02:00
Alexander Larsson
9fe81aaf90 Transaction: Add (and use) vfuncs for signals 2018-05-29 16:37:21 +02:00
Alexander Larsson
75ba77712a transaction: Derive FlatpakCliTransaction from FlatpakTransaction 2018-05-29 16:37:21 +02:00
Alexander Larsson
d2e419418b transaction: Change from installation_create_transaction() to transaction_new_for_installation()
This way is nicer because then the user can derive from FlatpakTransaction
2018-05-29 16:37:21 +02:00
Alexander Larsson
143e24f3bd Transaction: Convert to derivable type 2018-05-29 16:37:21 +02:00
Alexander Larsson
9672782694 libflatpak: Update docs for library 2018-05-29 16:37:21 +02:00
Alexander Larsson
2642b55e91 libflatpak: Guard public headers for individual includes 2018-05-29 16:37:21 +02:00
Alexander Larsson
89e673ff70 Rename FlatpakTransactionError to FlatpakTransactionErrorDetails
This makes it more obvious that this is not a GError enum
2018-05-29 16:37:21 +02:00
Alexander Larsson
bd94fa48ed dir: Add remote_name to the GPG failure error messages
This makes it easier to figure out which one goes wrong.
2018-05-29 16:37:21 +02:00
Alexander Larsson
f5a8e2b856 logging: Use message_handler also for warnings 2018-05-29 16:37:21 +02:00
Alexander Larsson
a84e6195a8 Remove newlines from GError messages
These are not supposed to be in the message, but by the person printing the error.
2018-05-29 16:37:21 +02:00
Alexander Larsson
ab514062d9 transaction: Add remote name to some error messages
This makes it more obvious where these errors come from
2018-05-29 16:37:21 +02:00
Alexander Larsson
867d8f4007 tests: We need to update repo with flatpak build-update-repo, not just ostree summary -U
If not, there will not be the flatpak cache in the summary and we'll create a g_warning that
aborts the tests.
2018-05-29 16:37:21 +02:00
Alexander Larsson
d5fe82d44b update POTFILES.in 2018-05-29 16:37:21 +02:00
Alexander Larsson
0e4948722c Installation: Add flatpak_installation_create_transaction ()
This is the libflatpak entry point for doing transactions.
2018-05-29 16:37:21 +02:00
Alexander Larsson
bb62296785 Transaction: Move progress to FlatpakTransactionProgress object 2018-05-29 16:37:21 +02:00