Commit Graph

776 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
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
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
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
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
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
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
f5a8e2b856 logging: Use message_handler also for warnings 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
Alexander Larsson
0685649763 Transaction: Move update_metadata() into transaction_run()
There is no real need to have to manually call this, we just
want it to happen automatically.
2018-05-29 16:37:21 +02:00
Alexander Larsson
74114d947b Transaction: Move operation done to signal 2018-05-29 16:37:21 +02:00
Alexander Larsson
e9a3b5345c Transaction: Move the printing of new operations to a signal 2018-05-29 16:37:21 +02:00
Alexander Larsson
ed5e714d8f Transaction: Add remote to error signal
We're not using this atm, but it seems useful to have.
2018-05-29 16:37:21 +02:00
Alexander Larsson
e56b68e0e4 Transaction: Move eol warning to signal 2018-05-29 16:37:21 +02:00
Alexander Larsson
9b8024326b transaction: Move operation errors, aborting and skipping to CLI
We add an error signal to Transaction that the calle (cli) handles. It
decides what to do with the error and whether to continue or abort.

A new error ABORTED is returned from flatpak_run() to indicate
that it errored out because you chose to abort. We also add a new
error SKIPPED that we use to report that some operation is skipped
(due to earlier errors).

This also means we remote the stop_on_first_error argument
from flatpak_transaction_run() as this is now controlled by
the caller.
2018-05-29 16:37:21 +02:00
Alexander Larsson
fd846875a2 transaction: Move already-installed skip:ing to from FlatpakTransaction to CLI 2018-05-29 16:37:21 +02:00
Alexander Larsson
1d6b43f4d0 Transaction: Add signal for choosing a remote when needed
Also move the existing code for this into FlatpakCliTransaction
2018-05-29 16:37:21 +02:00
Alexander Larsson
cca9005a3a app: Add flatpak cli constructor
This lets us centralize in one place all setup needed for cli use
of FlatpakTransactions (like interaction and progress).
2018-05-29 16:37:21 +02:00
Alexander Larsson
be6cea486c Transaction: Split out constructor into private header 2018-05-29 16:37:21 +02:00
Alexander Larsson
10dc876323 Transaction Move code to common/ 2018-05-29 16:37:21 +02:00
Alexander Larsson
0cfcb627a8 Transaction: Turn booleans into setters. 2018-05-29 16:37:21 +02:00
Alexander Larsson
97fc039c34 Make FlatpakTransaction a GObject 2018-05-29 16:37:21 +02:00
Alexander Larsson
7206fa012b build-commit-from: Mention NOW in timestamp docs
This is very useful when you want to override the timestamp from the origin commit.

Closes: #1725
Approved by: alexlarsson
2018-05-29 07:53:55 +00:00
Alexander Larsson
dcca240bee run: Break out generation of run flags from context to helper
This also adds a call to this from flatpak build, although it is
not (yet) strictly necessary as all the flags it sets so far
are always set when building. This may change in the future though.

Closes: #1721
Approved by: alexlarsson
2018-05-28 13:06:50 +00:00
Alexander Larsson
9a0a2e0d50 Remove files that accidentally got commited
Closes: #1707
Approved by: alexlarsson
2018-05-24 12:18:42 +00:00
Alexander Larsson
efb92704fe Merge lib/* into common
This moves all the files from lib into common, and it also adds all the libflatpak
sources into libflatpak-common, making libflatpak just a wrapper around the common
helper library.

This move allows the CLI to use all the code from libflatpak. We were already doing
this with a few things like flatpak-error*.[ch], and we want to do it even more
when sharing FlatpakTransaction. This also allows use to slowly move
the CLI to using the libflatpak apis for some things.

Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00
Alexander Larsson
1ad3b8c30b Move FlatpakCompletion to app/flatpak-complete.[ch]
Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00
Alexander Larsson
c570e09ac9 common: Rename all generated files to *-dbus-generated.[ch]
Easier to spot them this way

Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00
Alexander Larsson
7c17e77e84 Move FlatpakTablePrinter to app/
This is only used by the CLI

Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00
Alexander Larsson
960d20448c common: Rename all private headers to *-private.h
This is the start of the merging of lib/* into common/*

Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00
Alexander Larsson
421b1a953c build: Bundle bwrap arguments when building too
Closes: #1680
Approved by: alexlarsson
2018-05-16 14:43:53 +00:00
Alexander Larsson
6a2fe7d3e8 Revert "build: Bundle bwrap arguments when building too"
This reverts commit b0eaae2f51.
2018-05-16 16:11:55 +02:00
Alexander Larsson
b0eaae2f51 build: Bundle bwrap arguments when building too 2018-05-16 15:56:05 +02:00
Matthew Leeds
f110da0019 app: Fix a typo 2018-05-15 21:07:16 -07:00
Alexander Larsson
2bc301261e Its end-of-life, not end-of-line
Closes: #1643
Approved by: alexlarsson
2018-05-03 11:07:33 +00:00
Alexander Larsson
8f428fd768 Re-fix export filename checks, this time also for build-finish
The fix in 5122766284 was not right.
First of all it didn't changethe regressing behaviour for
build-finish, just install.

Secondly, it changed the prefix matches to always use
flatpak_name_matches_one_wildcard_prefix() which had slight
differences in behaviour that the previously used
flatpak_name_matches_one_prefix. For example, it always removed
the extension, no matter what it was.

This has all been replaced with a shared (between install and
build-finish) version that is more strict with extensions, and with
what names can be exported as service files (these have to match
exactly, with the wildcard and cannot have suffixes).

To test this i tried to install these apps from flathub that has
some more complex exports:

 org.sparkleshare.SparkleShare:
  org.sparkleshare.SparkleShare.Invites.desktop
  org.sparkleshare.SparkleShare-symbolic.svg

 org.libreoffice.LibreOffice:
  org.libreoffice.LibreOffice.desktop
  org.libreoffice.LibreOffice-impress.desktop
  org.libreoffice.LibreOffice-writer.png
  org.libreoffice.LibreOffice-calc.png

 com.github.bajoja.indicator-kdeconnect:
   com.github.bajoja.indicator-kdeconnect.desktop
   com.github.bajoja.indicator-kdeconnect.settings.desktop
   com.github.bajoja.indicator-kdeconnect.tablettrusted.svg

 com.github.philip_scott.spice-up:
   com.github.philip_scott.spice-up.svg
   com.github.philip_scott.spice-up-mime.svg
   com.github.philip_scott.spice-up.mime.xml

 org.gnome.Recipes:
   org.gnome.Recipes.desktop
   org.gnome.Recipes.service
   org.gnome.Recipes-search-provider.ini
   org.gnome.Recipes.png
   org.gnome.Recipes-symbolic.symbolic.png
   org.gnome.Recipes-mime.xml

 org.gnome.Characters:
   org.gnome.Characters.desktop
   org.gnome.Characters.BackgroundService.service
   org.gnome.Characters.service
   org.gnome.Characters.search-provider.ini
   org.gnome.Characters.png
   org.gnome.Characters-symbolic.svg

 org.gnome.Weather
   org.gnome.Weather.Application.desktop
   org.gnome.Weather.Application.service
   org.gnome.Weather.BackgroundService.service
   org.gnome.Weather.Application.search-provider.ini

 org.gpodder.gpodder:
   org.gpodder.gpodder.desktop
   org.gpodder.gpodder.gpodder-url-handler.desktop
2018-05-02 14:55:20 +02:00
Simon McVittie
24b67b7040 parse-datetime: Build YACC parser from source
This requires bison.

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

Closes: #1631
Approved by: alexlarsson
2018-05-02 12:13:11 +00:00
Matthew Leeds
53c4a1054d app: Fix a memory leak of remote names 2018-04-30 14:33:09 +02:00
Alexander Larsson
0be21395cb Transaction: Add operation dependencies
This means we track why an operation was queued. For example, that a runtime
installation/update was queued because an app needed it. We then mark operations
that failed, so that the app will not be installed if the runtime install failed.

There is one case where we do allow the installation to succeed, when an app
relies on a runtime which is installed, but the update of it failed. The
app should then still work, and we don't want to block installation/update
of an app if the runtime repository is down.

Closes: #1611
Approved by: alexlarsson
2018-04-26 07:16:30 +00:00
Alexander Larsson
882440b1d7 build-finish: Add --remove-extension
This allows you to remove extensions at the end of the build which were
only used during the build.

Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00
Alexander Larsson
b09059ca2c build-init: Add --extension support
This works just like in build-finish, but the main difference is
that the extension point is added early, so that the build itself can use it.

Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00
Alexander Larsson
4246a20393 build: Respect app extensions when building
Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00
Alexander Larsson
8ba59f093b build: Always allow multiarch when building stuff
This is similar to allowing devel.

Closes: #1598
Approved by: alexlarsson
2018-04-23 06:34:14 +00:00