Commit Graph

735 Commits

Author SHA1 Message Date
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
Alexander Larsson
4da56c8c62 RemoteState: Drop cancallable from flatpak_remote_state_lookup_cache()
This is a no-i/o operation on immutable data, there is no need for
a cancellable.

Closes: #1594
Approved by: alexlarsson
2018-04-20 11:16:57 +00:00
Alexander Larsson
7a61658012 RemoteState: Don't unnecessary strdup the metadata
This makes flatpak_remote_state_lookup_cache() return the metadata
from the actual FlatpakRemoteState rather than duplicating it.
All callers are updated to not free anymore and to strdup if needed.

Closes: #1594
Approved by: alexlarsson
2018-04-20 11:16:57 +00:00
Alexander Larsson
7386485bea Fix unused variable warning
Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
7fd085acd7 appstream: Generate appstream2/$arch branches with uncompressed xml
These delta better, and the files will be downloaded as compressed
.filez objects anyway.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
33c8e29d3f appdata: Only pull appstream branch for main arch
Now that it also includes compat refs as needed we don't need to
pull other branches.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
4fbf50d7b7 appstream: Check appstream timestamp when updating single remote too
Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Alexander Larsson
096f7d4fb5 appstream: Drop flatpak_dir_check_for_appstream_update
This early bailout is not really needed, because noop updates is
pretty fast. Also, doing that breaks the timestamp updates.

Closes: #1585
Approved by: alexlarsson
2018-04-20 10:10:33 +00:00
Matthew Leeds
9afca51507 remote-ls: Allow a URI instead of remote name
This fixes the ability of the remote-ls command to take a file:// URI
instead of a remote name, which is especially useful for repos on USB
drives (created via `ostree create-usb`) which are temporary and don't
warrant being added to the repo config. This commit also updates
relevant documentation, adds a unit test, and updates a few variable
names to improve readability.

I can't find a commit in the history where this was working, but it's
working on the Endless fork of flatpak so I think there was agreement at
some point that it's desired behavior.

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

Closes: #1587
Approved by: mwleeds
2018-04-19 20:59:34 +00:00
Joaquim Rocha
508ceb74e3 doc: Mention the use of the URI for listing refs from remotes
When listing refs from remotes, a remote can be given by name or by URI.
This is an important distinction because dynamic remotes (USB/LAN) are
not internally mapped to a name, and thus their generated name cannot be
used for listing them. Thus, the solution is to use their URI in order
to list the refs directly from it.

Even though this feature has been around forever, the documentation
didn't really reflect it, so this patch mentions the described
alternative possibility.

Closes: #1587
Approved by: mwleeds
2018-04-19 20:59:34 +00:00
Joaquim Rocha
516e249e50 lib/installation: Use "collection refs" when listing refs
When listing refs installed or from a remote, only the refs matching the
main collection-id were being returned. However, it is very important to
have access to all refs, independently from their collection-id,
especially when trying to list remotes coming from a USB repository.

These changes add the mentioned refs and update the places that use
this list, both in the lib and in the CLI.

For the implementation to become easier, we introduce also a
FlatpakCollectionRef, that should be replaced by OstreeCollectionRef
once the latter becomes part of the general API (currently it is in the
experimental one).

Closes: #1587
Approved by: mwleeds
2018-04-19 20:59:34 +00:00
Sam Spilsbury
c7d4eeab71 build-finish: Allow exporting .service files that we are allowed to own
To implement this, we have a concept of a custom export filter
function which can be specified for each path to determine the
files that can be exported under that path.

Closes: #1589
Approved by: alexlarsson
2018-04-19 07:31:25 +00:00
Matthew Leeds
ac690c4a1e Merge pull request #1590 from alexlarsson/batch-prunes
Batch prunes of the local repo
2018-04-18 23:48:13 -07:00
Sam Spilsbury
ceeda9b16d run: Add --no-documents-portal option
This prevents flatpak from trying to talk to the documents portal
on startup.

Closes: #1584
Approved by: alexlarsson
2018-04-18 12:05:16 +00:00
Alexander Larsson
1355713db7 Batch prunes of the local repo
This moves the prune call out of flatpak_dir_update() and
flatpak_dir_uninstall() and instead does this manually at all call
sites. The advantage is that we now only call it *once* even if you
uninstall or update multiple apps.

This means update everything is much faster as we don't have to scan
over the entire local repo for each updated app.
2018-04-18 12:00:12 +02:00
Sam Spilsbury
fcb92b3ee3 builtins-build-init: Support --extension-tag to init build dir
Closes: #1531
Approved by: alexlarsson
2018-04-18 07:43:56 +00:00
Sam Spilsbury
0cfcb90ed8 builtins-build: Search for best matching tagged extension when building extension
Closes: #1531
Approved by: alexlarsson
2018-04-18 07:43:56 +00:00
Sam Spilsbury
bc5cfafb26 builtins: Support '@' tag in extension names
Closes: #1531
Approved by: alexlarsson
2018-04-18 07:43:56 +00:00
Alexander Larsson
4bf892a06f common: Rename FlatpakRemoteState->remote to remote_name
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
88edfda861 dir: Pass FlatpakRemoteState to flatpak_dir_pull/install/update
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
48796fb29d dir: Pass FlatpakRemoteState to flatpak_dir_list_remote_refs
Reusing the summary and metadata here helps us a lot as typically we
often want to look up the cache data again for every ref in the list.

Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
2db82391c0 dir: Use FlatpakRemoteState for flatpak_dir_check_for_update
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
1936d2daae dir: Pass FlatpakRemoteState to flatpak_dir_find_remote_related
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
d791625d77 transaction: Use FlatpakRemoteState to look up metadata
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
37cdfa1d1d Transaction: Track RemoteState for all used remotes.
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Matthew Leeds
0867fb5305 update: Don't do a full update given --appstream
Until recently, "flatpak update --appstream" caused flatpak to only
update appstream data. Then commit 20c842012 accidentally made flatpak
also do a full update after updating appstream data, so this commit
fixes the regression.

Closes: #1571
Approved by: alexlarsson
2018-04-12 14:09:57 +00:00
Alexander Larsson
cb103ff0d0 transaction: Warn about end-of-life apps
This is a minimum viable implementation that just prints a warning.
A more comprehensive handling is possible, especially wrt the
rebase case.

Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
cc3097ea27 info: Add end-of-life status
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
327ed39833 list: Show end-of-life status
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
469c4ae628 remote-ls: Display end-of-line status for remote refs
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
ea54fd0f68 repo: Show end-of-life info with branches
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
66ccf54c51 build-export/build-commit-from: Add --end-of-life option
This sets the ostree end of life marker for a commit, to mark
that this branch is no longer getting updates.

Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
d4dc4fac0b build-commit-from: Remove duplicated short options
Several options were using -s, so only the first worked. Remove
the others.

Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
e9c6f30177 run: Add instance-path to .flatpak-info
This is the instance ~/.var/app/$appid dir
2018-04-04 17:25:59 +02:00
Alexander Larsson
74c4006dbe run: Add --sandbox
This runs the app in a very tight sandbox, with no access to anything
except /app and /run and some read-only host things like fonts and icons.

You can additionally add explicit permissions on the commandline,
like --share=network to actually grant some access.

This also sets $FLATPAK_SANDBOX_DIR to ~/.var/app/$appid/sandbox in the
environment.
2018-04-04 17:25:59 +02:00
Alexander Larsson
8570dcab85 run: Allow specifying an exact commit and runtime-commit
This also looks for removed but live deploys so that an app
can be re-started as long as it is live.
2018-04-04 17:25:59 +02:00
Alexander Larsson
43bcf38105 flatpak-info: Add instance-specific extra args
So, if you run your instance with e.g. flatpak run --filesystem=/some/dir
you can now see this. This will be useful in the restart yourself
portal as we can then inherit such permissions.
2018-04-04 17:25:59 +02:00
Alexander Larsson
513c0c36f5 update: Don't print appstream errors when quiet 2018-04-04 17:25:37 +02:00
Alexander Larsson
20c8420128 update: Fix updates of non-primary arches
When updating with no arch is specified we now update
appdata for all supported arches, and we don't look for
updates only of the primary arch.
2018-04-04 17:25:37 +02:00
Alexander Larsson
394130793c uninstall: Pick installation automatically
When uninstalling, if no specific installation was specified with e.g.
--user or --system, automatically chose any unique match, or error
out if there are multiple alternatives.

Fixes #1321
2018-04-04 17:25:20 +02:00
Alexander Larsson
3184a011c3 build-commit-from: Add --timestamp
This lets you override the timestamp from the source commits

Closes: #1538
Approved by: alexlarsson
2018-04-04 15:08:49 +00:00
Alexander Larsson
b9d8aeb175 build-export: Use parse_datetime() for --timestamp
This allows you more flexibility for defining the timestamp and
makes it compatilb with ostree commit.

Closes: #1538
Approved by: alexlarsson
2018-04-04 15:08:49 +00:00