Commit Graph

14 Commits

Author SHA1 Message Date
Phaedrus Leeds
600e18567c Add a vim modeline and .editorconfig
To make indentation work with less effort. The modeline was copied from
libostree with minor modification and the .editorconfig from GLib.

The advantage of having both a modeline and an editorconfig is we can
work out of the box on more editor setups, and the modeline allows us to
specify the style with a lot more fine grained control.
2022-08-22 19:48:10 -07:00
Phaedrus Leeds
0920e959b5 common: Update FlatpakRef docs with respect to uniqueness
See these links for context on this change:
- https://lists.freedesktop.org/archives/flatpak/2021-January/002087.html
- https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/583#note_1006763
2021-02-09 09:34:47 +01:00
Alexander Larsson
e9806fac8b decomposed: Use decomposed in flatpak_ref_parse() 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
3642f59ea8 Fix some clang warnings for FlatpakRefPrivate atomic use 2020-10-08 09:14:51 +02:00
Alexander Larsson
b6bd4472c5 flatpak_ref_format_ref_cached: Don't unnecessarily use g_object_set_data 2020-10-02 15:30:58 +02:00
Phaedrus Leeds
55f6abe578 Avoid string duplication in FlatpakRef
Allocate a full ref string once per object rather than once per call.
This is similar to what we do in flatpak_dir_get_name_cached().
2020-10-02 15:30:58 +02:00
Phaedrus Leeds
929fe68f55 flatpak-ref: Don't free immutable struct members
These are only set at object construction time not after.
2020-10-02 15:30:58 +02:00
Kalev Lember
18a1622755 ref: Fix a memory leak
Closes: #2964
Approved by: mwleeds
2019-06-14 22:44:27 +00:00
Philip Withnall
9e9b8b75fc ref: Fix a typo in a documentation string
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #2317
Approved by: matthiasclasen
2018-11-14 12:34:30 +00:00
Matthias Clasen
2d331a84a3 ref: Remove some dead code
flatpak_decompose_ref guarantees that parts[0] is either
"app" or "runtime".

Closes: #2245
Approved by: alexlarsson
2018-10-15 13:39:36 +00:00
Matthias Clasen
24d70fee0a ref: Document thread-safety
State that FlatpakRef objects are immutable and
can thus be used freely across threads.

Closes: #2141
Approved by: alexlarsson
2018-09-27 07:29:18 +00:00
Alexander Larsson
3f4518b15c Run uncrustify
Closes: #1870
Approved by: alexlarsson
2018-07-08 10:05:37 +00:00
Alexander Larsson
efb92704fe Merge lib/* into common
This moves all the files from lib into common, and it also adds all the libflatpak
sources into libflatpak-common, making libflatpak just a wrapper around the common
helper library.

This move allows the CLI to use all the code from libflatpak. We were already doing
this with a few things like flatpak-error*.[ch], and we want to do it even more
when sharing FlatpakTransaction. This also allows use to slowly move
the CLI to using the libflatpak apis for some things.

Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00