git.iko.soy/typeable/nixpkgs
on master help sign in
glibcLocales: Fix build for duplicates in locales list

Without this patch, setting the same locale twice, e.g. like this in NixOS: ```nix { i18n.supportedLocales = [ (config.i18n.defaultLocale + "/UTF-8") (config.i18n.defaultLocale + "/UTF-8") ]; } ``` Would make the glibcLocales build fail with ``` Error: unsupported locales detected: en_US.UTF-8/UTF-8 \ You should choose from the list above the error. ```

commit82590fed5fe04aa2503e36e81c84b1e3455780e5 authorSilvan Mosberger <contact@infinisil.com> dateWed 22 Sep 2021, 16:53 (5 years ago) parent6cc26a9
1 file changed+2−2
pkgs/development/libraries/glibc/locales.nix+2−2
pkgs/development/libraries/glibc/locales.nix+2−2
@@ -34,9 +34,9 @@ callPackage ./common.nix { inherit stdenv; } {
3434 + lib.optionalString (!allLocales) ''
3535 # Check that all locales to be built are supported
3636 echo -n '${lib.concatMapStrings (s: s + " \\\n") locales}' \
37− | sort > locales-to-build.txt
37+ | sort -u > locales-to-build.txt
3838 cat ../glibc-2*/localedata/SUPPORTED | grep ' \\' \
39− | sort > locales-supported.txt
39+ | sort -u > locales-supported.txt
4040 comm -13 locales-supported.txt locales-to-build.txt \
4141 > locales-unsupported.txt
4242 if [[ $(wc -c locales-unsupported.txt) != "0 locales-unsupported.txt" ]]; then