Commit Graph

3548 Commits

Author SHA1 Message Date
Sam Spilsbury
bc5cfafb26 builtins: Support '@' tag in extension names
Closes: #1531
Approved by: alexlarsson
2018-04-18 07:43:56 +00:00
Sam Spilsbury
b6d1a20223 flatpak-utils: Remove tag from extension name before adding it
Closes: #1531
Approved by: alexlarsson
2018-04-18 07:43:56 +00:00
Matthew Leeds
14dde8a37d dir: Use child_repo_ensure_summary() more
This introduces no functional change; it just makes use of a helper
function and updates a comment.
2018-04-17 11:46:02 -07:00
Matthew Leeds
1e1ed6911e dir: Tweak an outdated comment 2018-04-17 11:31:41 -07:00
Sam Spilsbury
66e343fcb8 dir: Add support for X-Flatpak-RunOptions in exported desktop files
A desktop file can specify this key to add additional arguments
to flatpak run. Right now, only 'no-a11y-bus' is supported.

Closes: #1579
Approved by: alexlarsson
2018-04-17 08:50: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
534c7a2fc8 tests: Fix unused variable warning in non-p2p case
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
482b494d9f Fix unused function warning in non-p2p case
_flatpak_dir_fetch_remote_state_metadata_branch is only used when building
with p2p, so #ifdef the entire function.

Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
9646f42ba8 dir: Remove unused function flatpak_dir_lookup_ref_from_summary
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
0e5baf3837 dir: Remove unused functions
flatpak_dir_get_remote_metadata and flatpak_dir_lookup_repo_metadata are now
not used anymore.

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
Alexander Larsson
346dcc04c1 dir: Use FlatpakRemoteState in flatpak_dir_remote_list_refs
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
78de3ba384 dir: Use FlatpakRemoteState in flatpak_dir_fetch_remote_commit
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
76bf02cb74 dir: Use FlatpakRemoteState in flatpak_dir_remote_has_ref
Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
Alexander Larsson
38df7f823b dir: Use FlatpakRemoteState in flatpak_dir_find_latest_rev()
This also makes this function static, as its not needed anywhere else.

Closes: #1575
Approved by: alexlarsson
2018-04-16 15:44:06 +00:00
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