rpms/groff/devel groff.spec,1.48,1.49 nroff,1.2,1.3

Marcela Mašláňová (mmaslano) fedora-extras-commits at redhat.com
Tue Jul 3 09:54:09 UTC 2007


Author: mmaslano

Update of /cvs/pkgs/rpms/groff/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25051

Modified Files:
	groff.spec nroff 
Log Message:
Add feature.



Index: groff.spec
===================================================================
RCS file: /cvs/pkgs/rpms/groff/devel/groff.spec,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- groff.spec	1 Mar 2007 14:54:52 -0000	1.48
+++ groff.spec	3 Jul 2007 09:53:23 -0000	1.49
@@ -3,7 +3,7 @@
 Summary: A document formatting system
 Name:	groff
 Version: 1.18.1.4
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPL
 Group: Applications/Publishing
 URL: http://groff.ffii.org
@@ -233,6 +233,9 @@
 %endif
 
 %changelog
+* Mon Jul  2 2007 Marcela Maslanova <mmaslano at redhat.com> - 1.18.1.4-5
+- Resolves: rhbz#245934
+
 * Tue Feb 27 2007 Marcela Maslanova <mmaslano at redhat.com> - 1.18.1.4-4
 - merge review
 - rhbz#225859 review


Index: nroff
===================================================================
RCS file: /cvs/pkgs/rpms/groff/devel/nroff,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nroff	6 Jan 2006 19:36:42 -0000	1.2
+++ nroff	3 Jul 2007 09:53:23 -0000	1.3
@@ -4,7 +4,7 @@
 prog="$0"
 charset_in=iso-8859-1
 charset_out=`locale charmap 2>/dev/null`
-opts=
+opts="-mtty-char -Tutf8"
 
 for i
 do
@@ -44,15 +44,21 @@
   shift
 done
 
-TMPFILE=$(mktemp /tmp/man.XXXXXX)
-trap "rm -f $TMPFILE" 0 1 2 3 15
-
-cat ${1+"$@"} >| ${TMPFILE}
+if TMPFILE=$(mktemp /tmp/man.XXXXXX 2>/dev/null); then
+  trap "rm -f $TMPFILE" 0 1 2 3 15
+  cat ${1+"$@"} >| $TMPFILE
+else
+  buf=$(cat ${1+"$@"})
+  TMPFILE=buf
+fi
 
-if iconv -f utf-8 -t utf-8 -o /dev/null ${TMPFILE} 2>/dev/null
-then
-  charset_in=utf-8  
+if [ $TMPFILE = buf ]; then
+  echo -n "$buf" | iconv -f utf-8 -t utf-8 &>/dev/null && charset_in=utf-8
 else
+  iconv -f utf-8 -t utf-8 $TMPFILE &>/dev/null && charset_in=utf-8
+fi
+
+if [ $charset_in != utf-8 ]; then
   echo XXX
   echo XXX $"WARNING: old character encoding and/or character set"
   echo XXX
@@ -64,10 +70,27 @@
 # This shell script is intended for use with man, so warnings are
 # probably not wanted.  Also load nroff-style character definitions.
 
-/usr/bin/iconv -f ${charset_in} -t utf-8 ${TMPFILE} | \
-    /usr/bin/groff -mtty-char -Tutf8 $opts 2>/dev/null | \
+if [ $charset_in = utf-8 -a $charset_out = UTF-8 ]; then
+  if [ $TMPFILE = buf ]; then
+    echo -n "$buf" | /usr/bin/groff $opts 2>/dev/null
+  else
+    exec < $TMPFILE
+    rm -f $TMPFILE
+    exec /usr/bin/groff $opts 2>/dev/null
+  fi
+else
+  if [ $TMPFILE = buf ]; then
+    echo -n "$buf" | \
+      /usr/bin/iconv -f $charset_in -t utf-8 | \
+      /usr/bin/groff $opts 2>/dev/null | \
+      /usr/bin/iconv -f utf-8 -t ${charset_out}//translit
+  else
+    /usr/bin/iconv -f $charset_in -t utf-8 $TMPFILE | \
+    /usr/bin/groff $opts 2>/dev/null | \
     /usr/bin/iconv -f utf-8 -t ${charset_out}//translit
 
-rm -f ${TMPFILE}
-
+    rm -f $TMPFILE
+  fi
+fi
+ 
 # eof




More information about the fedora-extras-commits mailing list