summaryrefslogtreecommitdiffstats
path: root/groff-pic2graph-mktemp.patch
blob: bf78bebbb616138a03095ede938464d3e744b0b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Author: Jan Vcelak <jvcelak@redhat.com>
Related: bz#588232

Fixes 'pic2graph' tool which didn't work due to coreutils version.
Broken tool uses 'mktemp XXX.extension' which was introduced in coreutils 8.1,
currently there is version 7.6 in Fedora 12.

diff -u -urp groff-1.18.1.4/contrib/pic2graph/pic2graph.sh groff-1.18.1.4.fixed/contrib/pic2graph/pic2graph.sh
--- groff-1.18.1.4/contrib/pic2graph/pic2graph.sh	2010-05-04 11:51:27.272577099 +0200
+++ groff-1.18.1.4.fixed/contrib/pic2graph/pic2graph.sh	2010-05-04 11:54:47.105701209 +0200
@@ -74,8 +74,10 @@ fi
 # 3. Process through groff to emit Postscript.
 # 4. Use convert(1) to crop the PostScript and turn it into a bitmap.
 
-tmpps=`mktemp /tmp/pic2graph-XXXXXXXX.ps`
-tmpfmt=`mktemp /tmp/pic2graph-XXXXXXXX.$format`
+tmpps=`mktemp /tmp/pic2graph-XXXXXXXX`
+tmpfmt=`mktemp /tmp/pic2graph-XXXXXXXX`
+mv $tmpps ${tmpps}.ps && tmpps=${tmpps}.ps
+mv $tmpfmt ${tmpfmt}.${format} && tmpfmt=${tmpfmt}.${format}
 trap "rm $tmpps $tmpfmt" 0 2 15
 (echo ".EQ"; echo $eqndelim; echo ".EN"; echo ".PS"; cat; echo ".PE") | \
        groff -e -p $groffpic_opts -Tps >$tmpps \