rpms/groff/devel nroff,1.6,1.7 nroff.patch,1.1,NONE

Marcela Mašláňová (mmaslano) fedora-extras-commits at redhat.com
Thu Jan 24 15:33:44 UTC 2008


Author: mmaslano

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

Modified Files:
	nroff 
Removed Files:
	nroff.patch 
Log Message:
Nroff is now fixed for working with or without -T option.



Index: nroff
===================================================================
RCS file: /cvs/pkgs/rpms/groff/devel/nroff,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- nroff	23 Jan 2008 13:28:17 -0000	1.6
+++ nroff	24 Jan 2008 15:33:10 -0000	1.7
@@ -4,6 +4,7 @@
 prog="$0"
 charset_in=iso-8859-1
 charset_out=`locale charmap 2>/dev/null`
+# we prefer utf8
 opts="-mtty-char -Tutf8"
 
 for i
@@ -18,9 +19,10 @@
       exit 1 ;;
     -[iptSUC] | -[mrno]*)
       opts="$opts $1" ;;
-	-Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean)
-	  T=$1 ;
-	  opts="-mtty-char $T";;
+	# someone wants specified -T, let's change opts from utf8
+    -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean)
+      T=$1 ;
+      opts="-mtty-char $T";;
     -[eq] | -s* | -u* | -T*)
 	  # ignore other devices
       ;;
@@ -55,44 +57,48 @@
   TMPFILE=buf
 fi
 
-if [ $TMPFILE = buf ]; then
-  echo -n "$buf" | iconv -f utf-8 -t utf-8 &>/dev/null && charset_in=utf-8
+# if -T was set -> just run groff and quit nroff
+if [ -n "$T" ]; then
+  /usr/bin/groff -mtty-char $opts ${TMPFILE} 2>/dev/null 
 else
-  iconv -f utf-8 -t utf-8 $TMPFILE &>/dev/null && charset_in=utf-8
-fi
+  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
-fi
+  if [ $charset_in != utf-8 ]; then
+    echo XXX
+    echo XXX $"WARNING: old character encoding and/or character set"
+    echo XXX
+  fi
 
 # en_US is chosen arbitrarily; any UTF-8 locale should work
-export LC_ALL=en_US.UTF-8
+  export LC_ALL=en_US.UTF-8
 
 # This shell script is intended for use with man, so warnings are
 # probably not wanted.  Also load nroff-style character definitions.
-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
+  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
-    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 | \
+    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
-  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
+    fi
   fi
 fi
- 
 # eof


--- nroff.patch DELETED ---




More information about the fedora-extras-commits mailing list