flatpak / flatpak-builder

Tool to build flatpaks from source
GNU Lesser General Public License v2.1
142 stars 93 forks source link

Don't create a locale extension if one is manually specified #618

Open bbhtt opened 2 months ago

bbhtt commented 2 months ago

Checklist

flatpak-builder version

1.4.4

Flatpak version

1.15.10

How to reproduce

When a locale extension is manually specified through add-extensions with the same base ID as the app, Flatpak Builder should skip creating it's own locale extension.

Having both causes duplicate groups to be written in the metadata file.

app-id: org.example.test
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
add-extensions:
 org.example.test.Locale:
  directory: share/runtime/locale
  autodelete: true
  locale-subset: true
cleanup-commands:
  - mkdir -p ${FLATPAK_DEST}/share/runtime/locale

causes the metadata to be:

[Application]
name=org.example.test
runtime=org.freedesktop.Platform/x86_64/24.08
sdk=org.freedesktop.Sdk/x86_64/24.08

[Extension org.example.test.Locale]
directory=share/runtime/locale
autodelete=true
locale-subset=true

[Extension org.example.test.Locale]
directory=share/runtime/locale
autodelete=true
locale-subset=true

[Build]
built-extensions=org.example.test.Locale;

which has two duplicate groups.

Expected Behavior

Disable Locale extension creation and don't write duplicate groups

Actual Behavior

Writes duplicate groups in metadata

Additional Information

N/A