scripts: make sure sort-order is independent from locale
authorDaniel Golle <daniel@makrotopia.org>
Wed, 6 Apr 2022 16:25:16 +0000 (17:25 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 6 Apr 2022 16:35:49 +0000 (17:35 +0100)
Set LC_ALL=C environment variable when calling 'sort' as the sort
order otherwise depends on the locale set.

Fixes: 56ce110b73 ("scripts: make sure conffiles are sorted")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 1d77dca3b32dd883bcc2213675cf21111ac1beca)

scripts/ipkg-build

index 32bc4b6d503b6beb40d122ad2da037d3a68397d3..19df621048a62c554b691508747983b917529c8e 100755 (executable)
@@ -58,7 +58,7 @@ pkg_appears_sane() {
 
                rm "$CONTROL"/conffiles
                if [ -f "$CONTROL"/conffiles.resolved ]; then
-                       sort -o "$CONTROL"/conffiles "$CONTROL"/conffiles.resolved
+                       LC_ALL=C sort -o "$CONTROL"/conffiles "$CONTROL"/conffiles.resolved
                        rm "$CONTROL"/conffiles.resolved
                        chmod 0644 "$CONTROL"/conffiles
                fi