Commit Graph

723 Commits

Author SHA1 Message Date
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
Alexander Larsson
222d7e2382 Import parse_timestamp() from ostree
Closes: #1538
Approved by: alexlarsson
2018-04-04 15:08:49 +00:00
Alexander Larsson
bad8cc27f1 update: Complete from all installations
We currently auto-pick installation for update when you didn't pick
any specific one, so we should complete from all of them too.

Closes: #1537
Approved by: mwleeds
2018-04-02 20:33:09 +00:00
Alexander Larsson
b223590b6e Make flatpak remove an alias to flatpak uninstall
Yum, dnf and apt all use "remove" as the opposite of install, so
to make it easier for people coming from these.

Closes: #1536
Approved by: mwleeds
2018-03-30 07:06:00 +00:00
Alexander Larsson
1840a7189c build-commit-from: Don't critical if commit has no commitmeta
Closes: #1524
Approved by: alexlarsson
2018-03-27 10:48:49 +00:00
Corentin Noël
9bc5b72457 app: Do not share the Error object in all completion tasks
Completion on my system was triggering an assertion error:
`ostree_repo_open: assertion 'error == NULL || *error == NULL' failed`

command:
`flatpak build-init build-dir bar.foo.Baz org.freedesktop.Sdk//1.6 org.freedesktop.Platform//1.6

Closes: #1491
Approved by: alexlarsson
2018-03-16 16:08:08 +00:00
Matthew Leeds
2051c77d27 remote-ls: Skip disabled remotes
The remote-ls command should skip remotes that have "xa.disable" set to
true or have no URL set, which can happen for remotes added for flatpak
bundle files.

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

Closes: #1457
Approved by: alexlarsson
2018-03-15 10:20:11 +00:00
Matthew Leeds
03387a7b58 remotes: Show the collection ID for each remote
If the --show-details option is passed to the remotes command, show the
collection ID for each remote, which the user might need to know if
they're using flatpak's P2P support.

Closes: #1458
Approved by: alexlarsson
2018-03-15 10:12:50 +00:00
Sam Spilsbury
817f020db3 run: Add option to disallow a11y bus proxying
This isn't needed for servers and starting the a11y bus on a
fresh session bus takes upwards of 15 seconds.

Fixes #1471

Closes: #1486
Approved by: alexlarsson
2018-03-15 09:43:00 +00:00
Patrick Griffis
45d1caa4cd search: Don't duplicate apps with different arches
Closes: #1430
Approved by: alexlarsson
2018-02-19 08:21:39 +00:00
Patrick Griffis
80d53028ba search: Minor cleanups
We don't need to duplicate the store for each arch only each
remote.

Closes: #1430
Approved by: alexlarsson
2018-02-19 08:21:39 +00:00
Matthew Leeds
d5b4443ef3 search: Search all supported architectures
Currently the search command only searches remotes for apps and runtimes
that match the host architecture. This commit makes flatpak include all
supported architectures so for example you can see a 32-bit app on a
64-bit computer.

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

Closes: #1430
Approved by: alexlarsson
2018-02-19 08:21:39 +00:00
Alexander Larsson
6a6e25623a Fix flatpak build on atomic
On atomic, /home is a symlink to /var/home, which caused
problems in flatpak build when granting access to the homedir.
Due to a previous workaround (in 1aadc3ee40) we
make /var in the flatpak build sandbox be completely overridden
with $builddir/var so that the above symlink would not cause problems
in the persisted directory.

However, when we actually *want* to give access to that symlink this
causes problem.

In general, exposing /var in the sandbox has two uses:

 * Allowing persisting tmpfiles in /var/tmp between individual
   flatpak build commands (/tmp is per-build-command).
 * Creating flatpaks from packages, such as rpms, where
   we want to keep the rpm database (/var/lib/rpm) around during
   the entire build so that dependencies can be resolved.

In order to handle these /var/home issues while still allowing
the above issues we instead persist only /var/tmp and /var/lib.

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

Closes: #1421
Approved by: alexlarsson
2018-02-16 08:07:55 +00:00