summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/man/man-1.6e/man-1.6e-whatis2.patch
blob: 180d4a31787ef9b8090ed601b11265966af9f0ae (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
--- man-1.6e-ro_usr/src/makewhatis.sh	2007-05-18 11:41:50.000000000 -0300
+++ man-1.6e/src/makewhatis.sh	2007-05-18 13:27:16.000000000 -0300
@@ -162,10 +162,15 @@
 fi
 catpath=`echo ${catpath} | tr : ' '`
 
+#WHATIS_DIR=$DESTDIR/var/cache/man/`echo $here|sed -e 's!.*/man/!!g'`
+WHATIS_DIR=$DESTDIR/var/cache/man/$LANG
+[[ -d $WHATIS_DIR ]] || mkdir -p $WHATIS_DIR/
+
 # first truncate all the whatis files that will be created new,
 # then only update - we might visit the same directory twice
 if [ x$update = x ]; then
-   cp /dev/null /var/cache/man/whatis
+   mkdir -p $WHATIS_DIR/
+   /bin/echo -n > $WHATIS_DIR/whatis
 fi
 
 for pages in man cat
@@ -395,13 +400,13 @@
 
        cd $here
 
-       if [ -f /var/cache/man/whatis ]
+       if [ -f $WHATIS_DIR/whatis ]
        then
-	 cat /var/cache/man/whatis >> $TMPFILE
+	 cat $WHATIS_DIR/whatis >> $TMPFILE
        fi
-       tr -s '\n' < $TMPFILE | sort -u > /var/cache/man/whatis
+       tr -s '\n' < $TMPFILE | sort -u > $WHATIS_DIR/whatis
 
-       chmod 644 /var/cache/man/whatis
+       chmod 644 $WHATIS_DIR/whatis
        rm $TMPFILE
    done
 done