Skip to content

Commit

Permalink
utils: Recognize .yml* and .yaml* file extension variants
Browse files Browse the repository at this point in the history
The code knows of .yml* and .yaml* variants on various places, this one
was only missing. This fixes also a bug, when the YAML file was not compressed,
it was treated as XML.
  • Loading branch information
mcrha committed Jan 16, 2025
1 parent 57c37df commit 0d272e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/as-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2578,7 +2578,10 @@ as_utils_install_metadata_file (AsMetadataLocation location,

switch (as_metadata_file_guess_style (filename)) {
case AS_FORMAT_STYLE_CATALOG:
if (g_strstr_len (filename, -1, ".yml.gz") != NULL) {
if (g_str_has_suffix (filename, ".yml") ||
g_str_has_suffix (filename, ".yml.gz") ||
g_str_has_suffix (filename, ".yaml") ||
g_str_has_suffix (filename, ".yaml.gz")) {
path = g_build_filename (as_metadata_location_get_prefix (location),
"swcatalog",
"yaml",
Expand Down

0 comments on commit 0d272e3

Please sign in to comment.