Commit Graph

3528 Commits

Author SHA1 Message Date
Alexander Larsson
4b73e7fc2e dir: Use FlatpakRemoteState in flatpak_dir_find_remote_related()
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
f16f8b1d8b dir: Change update_remote_configuration to use RemoteState
This means we only look up the summary once for the entire operation.

Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
245c605828 dir: Add FlatpakRemoteState object
This is an object that contains the state of a particular remote
at a point in time, such as the summary and the metadata. Storing
this in an object means we can reuse these data instead of constantly
looking them up.

This is more efficient, but also avoids possible inconsistencies if
the state changes during an operation.

There is also an "optional" mode for the state where we don't fail in
the p2p/collection-id case if it fails to load the summary or metadata.
This is useful in order to support certain operations "offline" (i.e.
with no network connection to the main repo).

Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
60270000c8 dir: Remove unused methods fetch_remote_default_branch and fetch_remote_title
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
fedb0e5bd9 dir: Pass summary and collection_id to fetch_remote_repo_metadata()
All callers need to get this anyway, so lets only do it once.

Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
25c9b0a4a1 dir: Break out flatpak_dir_get_remote_metadata
Split out the remote metadata loader, so you can do multiple lookups
on it if needed.

Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
23256d6d3f dir: Fix handling of empty dirs when listing installed refs
Before, we would list a ref as installed if the directory for the
ref was in the installation. However, if that was empty then we
would still consider that as installed. We also now require
there to be an active symlink with a deploy file in it.

This caused issues for me on update, because we listed some app
as installed, but then failed to update it.

Closes: #1573
Approved by: alexlarsson
2018-04-16 06:26:59 +00:00
Matthew Leeds
ee28165141 tests: Limit use of installation monitor
The GFileMonitor returned by flatpak_installation_create_monitor() is
already tested in test_install_launch_uninstall(), so there's not much
point in testing it again in test_list_updates, and for some reason it
is causing a test failure on OBS.

Closes: #1567
Approved by: alexlarsson
2018-04-12 17:50:30 +00:00
Matthew Leeds
8e861a854f doc: Add a hint about how to use update --commit
Closes: #1568
Approved by: alexlarsson
2018-04-12 14:30:53 +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
fabe1e5ff4 Add tests for end-of-line
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +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
66699c0774 deploy: Store end-of-life data in deploy
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
8d7f888bf1 build-update-repo: Add end-of-line metadata to summary
This adds a "sparse-cache" metadata dict to the summary, where
we can add additional per-ref information that we don't expect
to be there for most refs. Initially we add the eol and
eol-rebase info to it so that we can see which remote refs
are end-of-line.

Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
42335c74a0 appstream: Don't include end-of-line refs in appdata
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
0303433c7b table-printer: Add append_with_comma_printf
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
7a238f1860 tests/test-repo.sh: Ensure that appdata branch is built correctly
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
8e992e04ad flatpak-utils.c: Remove leftover spew
Closes: #1566
Approved by: alexlarsson
2018-04-12 12:36:49 +00:00
Alexander Larsson
957544ca30 flatpak-utils: Mark strings for translation
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
Matthew Leeds
0695128d4b doc: Fix a few mistakes and inaccuracies
The flatpak-uninstall command now automatically chooses which
installation to use, so document that in the man page, and fix a few
other minor mistakes.

Closes: #1558
Approved by: alexlarsson
2018-04-09 07:44:07 +00:00
Kukuh Syafaat
fb574fecd1 Update Indonesian translation
Closes: #1561
Approved by: alexlarsson
2018-04-09 07:33:06 +00:00
Alexander Larsson
0a778dd7e2 Update to latest bubblewrap (0.2.1)
This has the NFS fix https://github.com/projectatomic/bubblewrap/pull/258
which means flatpak works on NFS.

Closes: #1559
Approved by: alexlarsson
2018-04-06 21:02:23 +00:00
Matthew Leeds
09e9d6896d README: Add an Oxford comma 2018-04-06 12:09:31 -05:00
Matthew Leeds
78199b066a lib: Add P2P support to list_installed_refs_for_update()
Currently flatpak_insallation_list_installed_refs_for_update() only
checks the configured remotes for updates. This means that updates from
peer sources such as USB drives or computers on the LAN are never seen,
which is especially problematic when the computer is offline. The end
result is that GNOME Software doesn't show an "Update" button to let you
update an app from a USB drive when you're offline.

This commit uses ostree API, primarily ostree_repo_find_remotes_async(),
to check peer sources for updates from any remotes that have a
collection ID configured. We're using an ostree 2018.5 feature from
https://github.com/ostreedev/ostree/pull/1518, but I used a version
check for that (it hasn't been released yet). Without it you can't tell
if an offered commit is an update or a downgrade, but that behavior is
still better than the status quo (no updates from P2P sources at all).

Closes: #1542
Approved by: alexlarsson
2018-04-06 15:38:21 +00:00
Matthew Leeds
73d1725bf2 testlibrary: Conditionally use a collection ID
Use a collection ID on the test repo if P2P support is enabled. This
will allow for testing of more API that makes use of collection IDs.

Closes: #1542
Approved by: alexlarsson
2018-04-06 15:38:21 +00:00
Matthew Leeds
c8fa36fca6 lib: Fix grammar in gtk-doc comments
Closes: #1542
Approved by: alexlarsson
2018-04-06 15:38:21 +00:00
Matthew Leeds
3f4f1f59b3 lib: Minor cleanups in list_installed_refs_for_updates
Closes: #1542
Approved by: alexlarsson
2018-04-06 15:38:21 +00:00
Piotr Drąg
a7d5b5a274 Update POTFILES.skip
Closes: #1552
Approved by: alexlarsson
2018-04-05 06:57:15 +00:00
Alexander Larsson
d3dee9f052 Better build fix 2018-04-04 17:50:06 +02:00
Alexander Larsson
c0862fcbb8 Fix builddir != srcdir build 2018-04-04 17:42:24 +02:00
Alexander Larsson
2cdb099ab3 Verify that the system cache directory supports user xattrs
Installation will fail with some weird error later if this is not true.
2018-04-04 17:31:31 +02:00
Alexander Larsson
a6ec434aed run: Escape : as \: in --filesystem= paths
This way we never get confused about which part of the argument
is the permission suffix, which could be exploitable if you can
control the --filesystem calls such as with sandboxed Spawns.
2018-04-04 17:25:59 +02:00
Alexander Larsson
11ef9999b6 Add flatpak portal
This listens to org.freedesktop.portal.Flatpak and lets flatpak
sandboxes do flatpak specific things.

Initially this only allows access to "Spawn", which lets you start a
new copy of the current or latest version of the calling app,
optionally with sandboxing.

This allows the app to re-start itself with the latest version after
an update, and the sandboxing is useful for apps that want to manually
sandbox part of themselves.

You can also expose one or more subdirectories of
~/.var/app/$appid/sandbox/ to the app, read-write or read-only. This is
useful to communicate with the sandbox.
2018-04-04 17:25:59 +02: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
21b9f3151b undeploy: Use predictable names for removed directories
This means if we undeploy something, but its still in use, then
we can find it later. This is interesting because it lets
us re-find it for spawning an instance of the same version.
2018-04-04 17:25:59 +02:00
Alexander Larsson
819a134506 flatpak-info: Add arch info 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