blob: 0fa4bfbac0293c65389de5fab659d6cbb6026b98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
From 8823bf92219d04aa0934abab530fdcf6f18b06bb Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Fri, 25 Jul 2014 15:10:50 +0200
Subject: [PATCH] fix gencat wrapper for LANG=C
Sorting sets including 'charset' file caused that the file was on
concatenated as the last one which causes build fail when current
locale charset is non-utf8.
Also avoid generating temporary files for security reasons.
---
nls/catgen | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/nls/catgen b/nls/catgen
index 40e652f..f5f0313 100755
--- a/nls/catgen
+++ b/nls/catgen
@@ -1,7 +1,5 @@
#!/bin/sh
# Wrapper for gencat
-TMP=/tmp/catgen.$$
-trap "rm -f $TMP" 0 1 2 3 15
sortit() {
awk '/^\$set/ {print $2, FILENAME}' "$@" | sort -n | cut -d ' ' -f 2
@@ -11,7 +9,9 @@ GENCAT="$1"
shift
OUT="$1"
shift
-cat $(sortit "$@") > "$TMP"
+CHARSET="$1"
+shift
-echo "$(basename "$OUT" .cat)"
-"${GENCAT}" "$OUT" "$TMP"
+echo " gencat $OUT"
+cat $CHARSET $(sortit "$@") | "${GENCAT}" "$OUT" -
+exit 0
--
1.9.3
|