22 Commits

Author SHA1 Message Date
bbhtt
0bf531f44a dir: Add basic OS info to Flatpak-Os-Info header when pulling objects
Fixes https://github.com/flatpak/flatpak/issues/5549
2025-10-13 18:52:55 +00:00
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
Simon McVittie
c68f31d86a build: Consistently include libglnx header as "libglnx.h"
Recent Meson versions have warnings if you add the subprojects
directory as an include path, because the way Meson wants to consume
subprojects is by the subproject's build system producing a Meson
dependency object that encapsulates its include directory. Flatpak
doesn't have a Meson build system yet, but I'm working on that.

libglnx seems to be set up to have the libglnx directory be its include
path instead: for example, ostree (by the author of libglnx) already
uses "libglnx.h" or <libglnx.h> everywhere. Do the same here.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-04-11 10:32:34 +02:00
Alexander Larsson
76be5db46d Revert "config: Support setting sideload-repos option"
This reverts commit 1d1819840e01285eb39daf3f289e89e58caef3c8.
2020-03-26 10:10:45 +01:00
Alexander Larsson
1d1819840e config: Support setting sideload-repos option 2020-03-23 17:58:04 +01:00
Philip Withnall
cc7474d0e9 config: Rework handling of extra-languages to change locale format
Accept the locale format as documented by `setlocale(3)`, rather than
another arbitrary format.

This reworks the validation code, and was tested to accept all the
locales on my F30 system using:
```
flatpak config --user --set extra-languages $(locale -a | tr -s '\n' ';' | head -c -1)
```

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-24 13:54:05 +01:00
Philip Withnall
a3a7f3214c config: Accept bokmal as a language
It’s listed in `locale -a` output, even though it should canonically be
represented as `nb`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-24 13:54:05 +01:00
Philip Withnall
e78a53fede config: Accept C and POSIX as languages
They are listed as languages in `locale -a` output.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-10-24 13:54:05 +01:00
Mazen Asef
65912f27fe app: Allow locales to be stored in the extra-languages key
In order to configure gnome-software to show specific apps in one region
without showing to all language speakers, we allow the storage of full
locales on the extra-languages key. However, these locales are ignored when
calling flatpak_installation_get_default_languages, so locales will be reduced
to their language identifier (eg. en_IN locale will be returned as 'en', and
az_Latn_AZ will be returned as 'az'). In order to get the full locales, we can
call flatpak_installation_get_default_locales instead, which can return languages
and locales.
2019-10-16 16:25:06 -03:00
Mazen Asef
a0666034db app: Add new extra-languages key
If xa.languages is set, use these, and no others. Otherwise, take the union
of xa.extra-languages, and the system default locales for system repos;
xa.extra-languages for user repo and the langs based on the user's locale

Fixes https://github.com/flatpak/flatpak/issues/3043
2019-09-13 15:31:14 -03:00
Matthias Clasen
15f9bbf8c6 config: Make --list and --get work on empty repos
The --list and --get implementations work just fine
on empty repos (reporting the default values). So
don't err out prematurely during option parsing.

Closes: #2585
Approved by: alexlarsson
2019-01-14 11:10:17 +00:00
Matthias Clasen
6877dc4ff7 config: Fix a copy-paste error
The set handler was talking about --get.

Closes: #2531
Approved by: mwleeds
2019-01-03 20:52:46 +00:00
Matthias Clasen
3a01ca36cf config: Parse languages better
Do some actual checking on the value to prevent nonsense
from getting into the config.
2018-10-10 12:21:33 +02:00
Matthias Clasen
22c5664f10 config: Improve error handling
Use usage_error for commandline-related errors,
as we do elsewhere. And be more specific in the
error messages.

Closes: #2203
Approved by: alexlarsson
2018-10-10 08:32:52 +00:00
Matthias Clasen
c269460ef9 config: Default to --list
When no option is specified, just do the reasonable thing.

Closes: #2203
Approved by: alexlarsson
2018-10-10 08:32:52 +00:00
Alexander Larsson
3f4518b15c Run uncrustify
Closes: #1870
Approved by: alexlarsson
2018-07-08 10:05:37 +00:00
Alexander Larsson
960d20448c common: Rename all private headers to *-private.h
This is the start of the merging of lib/* into common/*

Closes: #1706
Approved by: alexlarsson
2018-05-24 11:59:52 +00:00
Matthew Leeds
8a59927fde app: Move installation management to flatpak-main.c
Some builtin flatpak commands work on a single installation, and others
work on multiple installations (such as the remotes command that lists
both system and user remotes). Currently flatpak_option_context_parse()
only supports returning one installation to its caller, and any commands
that want to support multiple installations have to implement that
themselves which leads to a lot of code duplication.

This commit changes flatpak_option_context_parse() to take three new
flags:

    * FLATPAK_BUILTIN_FLAG_ONE_DIR maintains the old behavior by
returning one installation (i.e. user if --user was passed, system if
--system, etc.).

    * FLATPAK_BUILTIN_FLAG_STANDARD_DIRS will get all the installations
specified by the options, or the user and system ones if none were.

    * FLATPAK_BUILTIN_FLAG_ALL_DIRS includes non-default system
installations along with the user and system ones if none were
specified.

These flags also affect what options are parsed and whether the
directories are ensured to exist, so it makes sense in some
circumstances for callers to pass a NULL out_dirs even when not using
FLATPAK_BUILTIN_FLAG_NO_DIR.

This commit also changes all the callers of
flatpak_option_context_parse() so they maintain their behavior. The only
functional change introduced by this is that using --installation
multiple times for commands that only support one now leads to an
error emitted by flatpak rather than by g_option_context_parse().

A follow-up commit will use this refactoring to make many commands
behave more intelligently in determining which installation to use.

Closes: #1205
Approved by: alexlarsson
2017-12-12 15:26:41 +00:00
Matthew Leeds
bae681d0a9 app: Fix typo in error message
Fixes https://github.com/flatpak/flatpak/issues/1225
2017-12-11 16:18:26 +01:00
Matthew Leeds
8ab3394a9b config: Fix comment in flatpak_complete_config 2017-11-25 15:47:03 -08:00
Alexander Larsson
e61071cb7b config: Move all references of "xa." prefix for config into FlatpakDir
There is no need to expose this in the API, especially the library API.

Closes: #1123
Approved by: alexlarsson
2017-10-20 20:06:38 +00:00
Alexander Larsson
9e1e982bf8 Add flatpak config option
This is currenly only used to configure the languages to install.

Closes: #1098
Approved by: alexlarsson
2017-10-11 12:48:07 +00:00