Commit Graph

2070 Commits

Author SHA1 Message Date
Alexander Larsson
d4dd663c88 flatpak-dir-private.h: re-indent function declarations 2020-11-10 14:32:13 +01:00
Alexander Larsson
7ab62ac3fb decomposed: Convert some more FlatpakDir apis to FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
674cc1a60a decomposed: Convert more FlatpakDir APIs to use FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
b111965640 decomposed: Convert flatpak_dir_read/set_active() 2020-11-10 14:32:13 +01:00
Alexander Larsson
3d29c6ee5c decomposed: Convert flatpak_load_deploy_data() to FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
8a32656380 Remove unused flatpak_[de]compose_ref functions
We now all use the FlatpakDecompose versions.
2020-11-10 14:32:13 +01:00
Alexander Larsson
adb3b61f0a decomposed: Return FlatpakDecomposed from flatpak_dir_find_remote_ref() 2020-11-10 14:32:13 +01:00
Alexander Larsson
ed6ea2c97d decomposed: Remove last users of flatpak_compose_ref() 2020-11-10 14:32:13 +01:00
Alexander Larsson
f7593cd7b6 appstream: Use FlatpakDecomposed when generating 2020-11-10 14:32:13 +01:00
Alexander Larsson
1159004dc8 Add len argument to flatpak_decomposed_is_arches()
This allows this to be used both with strv (len=-1) and other arrays.
2020-11-10 14:32:13 +01:00
Alexander Larsson
b70151dabe dir: Don't crash in get_summary_for_ref() if arch has not non-compat arch 2020-11-10 14:32:13 +01:00
Alexander Larsson
c5b2c60609 decompose: Convert more FlatpakDir functions to use FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
409fa1eafc decomposed: Use FlatpakDecomposed in flatpak_run_* 2020-11-10 14:32:13 +01:00
Alexander Larsson
e9806fac8b decomposed: Use decomposed in flatpak_ref_parse() 2020-11-10 14:32:13 +01:00
Alexander Larsson
48b11b3d3d lib: Add flatpak_transaction_operation_get_subpaths()
This returns the actual subpath that will be fetched during the operation,
not just what was passed in.

NOTE: We were previously doing the final resolve of this in the update
case during the pull operation, but this commit changes that to do it
up-front in order to be able to return the right value for this.
2020-11-10 14:32:13 +01:00
Alexander Larsson
f2cfd53bd1 transaction: Add private getter for the FlatpakDecomposed of the op 2020-11-10 14:32:13 +01:00
Alexander Larsson
3fd710b5f4 Remove some unused flatpak_dir_resolve_* functions
These are not used since we changed the p2p code a while ago.
2020-11-10 14:32:13 +01:00
Alexander Larsson
b6a1eb8d48 Delete some unused variables 2020-11-10 14:32:13 +01:00
Alexander Larsson
9b9c2f0a93 decomposed: Pass FlatpakDecomposed to find_*_related functions 2020-11-10 14:32:13 +01:00
Alexander Larsson
a988ee19d8 decompose: Use FlatpakDecomposed for bundles 2020-11-10 14:32:13 +01:00
Alexander Larsson
a3a2dcb2c5 decomposed: Remove _decomposed prefix on functions
We now converted most of these and removed the non-prefixed functions,
so rename them back.
2020-11-10 14:32:13 +01:00
Alexander Larsson
c14486f935 Use decomposed in flatpak_summary_match_subrefs() 2020-11-10 14:32:13 +01:00
Alexander Larsson
109cac60f6 decomposed: Store a FlatpakDecomposed in FlatpakRelated 2020-11-10 14:32:13 +01:00
Alexander Larsson
59509fd82d Add flatpak_decomposed_id_has_prefix() 2020-11-10 14:32:13 +01:00
Alexander Larsson
38a0706e76 decomposed: Return decomposed from find_installed_pref/ref 2020-11-10 14:32:13 +01:00
Alexander Larsson
97767f1a69 decomposed: Pass decomposed to flatpak_dir_deploy_install/update 2020-11-10 14:32:13 +01:00
Alexander Larsson
28f1ce3d62 Remove unused (non-decomposed) flatpak_dir_list_refs 2020-11-10 14:32:13 +01:00
Alexander Larsson
1402128f22 decomposed: Convert flatpak_dir_deploy() to take decomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
7e40dbfb74 Convert flatpak_dir_deploy() to use FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
e98376bdf1 decomposed: Add flatpak_decomposed_equal_except_branch ()
This is used in flatpak_dir_deploy()
2020-11-10 14:32:13 +01:00
Alexander Larsson
6897b8e2ff decomposed: Take decomposed arg in flatpak_dir_load_deployed()
Then convert all callers
2020-11-10 14:32:13 +01:00
Alexander Larsson
5a858230dd decomposed: Add flatpak_decomposed_get_kind_metadata_group()
This is a useful helper.
2020-11-10 14:32:13 +01:00
Alexander Larsson
3b7f31350e dir: Use FlatpakDecomposed in apply_extra_data()
Just replaces flatpak_decompose_ref + GStrv
2020-11-10 14:32:13 +01:00
Alexander Larsson
5ea43736d9 flatpak_dir_list_refs_decomposed: Support kinds as a flag
This lets you get both apps and runtimes in one call.
2020-11-10 14:32:13 +01:00
Alexander Larsson
a65eb29faf dir: Use decomposed in flatpak_dir_list_unused_refs() 2020-11-10 14:32:13 +01:00
Alexander Larsson
3544e907c3 dir: Remove flatpak_dir_get_all_installed_refs()
This is now made unused by the _decomposed versions
2020-11-10 14:32:13 +01:00
Alexander Larsson
784fc00c0c dir: Replace one user of flatpak_dir_list_refs with _decomposed version 2020-11-10 14:32:13 +01:00
Alexander Larsson
fa1a494566 decomposed: Convert various "current ref" functions to use FlatpakDecomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
fbcef76a37 Add flatpak_dir_list_refs_for_name_decomposed 2020-11-10 14:32:13 +01:00
Alexander Larsson
d7377f33bd transaction: Use flatpak_decomposed_new_from_pref() 2020-11-10 14:32:13 +01:00
Alexander Larsson
105edb64f5 decomposed: Add flatpak_decomposed_new_from_pref()
This is useful as we have partial refs in the metadata files, like
the app runtime dependency.
2020-11-10 14:32:13 +01:00
Alexander Larsson
08dc7cb2aa dir: Remove unused non-_decomposed() helpers
This removes flatpak_dir_list_remote_refs() and
flatpak_dir_list_all_remote_refs() which have no more users, as everything
migrated to the _decomposed() versions.
2020-11-10 14:32:13 +01:00
Alexander Larsson
877cede50b decomposed: Store ref data inline if possible.
When we're not taking the string from elsewhere, store the string data
inline.
2020-11-10 14:32:13 +01:00
Alexander Larsson
cd34088969 Transaction: Convert internal refs to FlatpakDecomposed
We convert early in the API so that we can rely on the format everywhere
and use the faster getters for the parts of the refs.
2020-11-10 14:32:13 +01:00
Alexander Larsson
840cb2ed3d decomposed: Add id_has_suffix() helper 2020-11-10 14:32:13 +01:00
Alexander Larsson
db11607016 installation: Use the FlatpakDecomposed APIs to create FlatpakRef:s
This means we do a bit less string operations, but it also allows us
to pick up the collection-id when listing refs from a file: uri, fixing
the issues described in https://github.com/flatpak/flatpak/pull/3909

This slightly changes the behaviour of collection ids and remotes.
When listing regular remotes we only ever return the refs with the
collection id specified by the configuration of that remote. However,
when specifying a file: uri for the remote name we return all the refs
in the repo, with their corresponding collection id.

This means the test suite has to change a bit as before we returned
all the collrefs from the remote, not just the one matching the configured
collection id.
2020-11-05 10:43:10 +01:00
Alexander Larsson
247fed25ff remote-state: For local repos, set collection id for main ref table too
If you're listing a file: uri we (as before) add the collection-ref
tables, but we now also set the proper collection-id for the main ref
table if the ostree.summary.collection-id key is set.
2020-11-05 10:43:10 +01:00
Alexander Larsson
bd5029e72a dir: Add flatpak_dir_list_refs_decomposed() 2020-11-05 10:43:10 +01:00
Alexander Larsson
abb097f812 decomposed: Support defaults in flatpak_decomposed_new_from_parts
This allows NULL for arch and branch, similar to
e.g. flatpak_build_runtime_ref().
2020-11-05 10:43:10 +01:00
Alexander Larsson
3b63c51ce6 decomposed: Add support for FlatpakRefKind 2020-11-05 10:43:10 +01:00