summaryrefslogtreecommitdiff
path: root/editors/abiword-devel/files/patch-au
blob: 3f4fe57c8a307fc686aafa0cf3f6b97123335d06 (plain) (blame)
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
43
44
45
46
$FreeBSD$

--- src/pkg/common/unix/scripts/makewrapper.sh.orig	Tue Nov 13 07:59:56 2001
+++ src/pkg/common/unix/scripts/makewrapper.sh	Fri Nov 23 16:31:06 2001
@@ -66,23 +66,31 @@
 if [ -z "\$locale" ]
 then
     locale=\$LANG
+elif [ -z \$locale ]
+then
+    locale=\$LC_CTYPE
 fi
 #
 if [ ! -z "\$locale" ]
 then
-    #now guess encoding
+    #now guess country/region/encoding
+    country=\`echo \$locale | sed -e 's/\(.*\)_.*\$/\1/'\`
+    region=\`echo \$locale | sed -e 's/^.*_\(.*\)\..*/\1/'\`
     encoding=\`echo \$locale | sed -e 's/^.*\.\(.*\)\$/\1/'\`
-    if [ ! -z "\$encoding" ]
+    if [ ! -z \$country -o ! -z \$region -o ! -z \$encoding ]
     then
-	addfontdir=\$ABISUITE_FONT_HOME/\$encoding
-	if [ ! -z "\$addfontdir" ]
-	then
-	    if [ -d "\$addfontdir" ]
+	addfontdirlst="\$ABISUITE_FONT_HOME/\$country \$ABISUITE_FONT_HOME/\${country}-\${region} \$ABISUITE_FONT_HOME/\$encoding \$ABISUITE_FONT_HOME/\${country}-\${region}.\${encoding}"
+	for addfontdir in \$addfontdirlst
+	do
+	    if [ ! -z \$addfontdir ]
 	    then
-	    	#add directory with locale-specific fonts to font path
-	    	ABISUITE_FONT_PATH=\$ABISUITE_FONT_PATH,\$addfontdir
+		if [ -d \$addfontdir -a ! -f \$addfontdir/.already-in-fp ]
+		then
+		    #add directory with locale-specific fonts to font path
+		    ABISUITE_FONT_PATH=\$ABISUITE_FONT_PATH,\$addfontdir
+		fi
 	    fi
-	fi
+	done
     fi
 fi
 #