rpms/groff/F-7 groff.spec,1.48,1.49 nroff,1.2,1.3
Marcela Mašláňová (mmaslano)
fedora-extras-commits at redhat.com
Thu Aug 16 11:34:46 UTC 2007
Author: mmaslano
Update of /cvs/pkgs/rpms/groff/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17600
Modified Files:
groff.spec nroff
Log Message:
Nroff was changed: man pages are printed, when partion is ro and other encoding could be print correct.
Index: groff.spec
===================================================================
RCS file: /cvs/pkgs/rpms/groff/F-7/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 16 Aug 2007 11:34:13 -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,10 @@
%endif
%changelog
+* Thu Aug 16 2007 Marcela Maslanova <mmaslano at redhat.com> - 1.18.1.4-5
+- nroff was changed: man pages are printed, when partion is ro and
+ other encoding could be print correct
+
* 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/F-7/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 16 Aug 2007 11:34:13 -0000 1.3
@@ -5,6 +5,51 @@
charset_in=iso-8859-1
charset_out=`locale charmap 2>/dev/null`
opts=
+othercoding=0
+
+# Default device.
+# First try the "locale charmap" command, because it's most reliable.
+# On systems where it doesn't exist, look at the environment variables.
+case "`locale charmap 2>/dev/null`" in
+ UTF-8)
+ T=-Tutf8 ;;
+ ISO-8859-1)
+ T=-Tlatin1 ;;
+ IBM-1047)
+ T=-Tcp1047 ;;
+ EUC-JP)
+ T=-Tnippon ;;
+ EUC-KR)
+ T=-Tkorean ;;
+ *)
+ case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
+ *.UTF-8)
+ T=-Tutf8 ;;
+ iso_8859_1 | *.ISO-8859-1)
+ T=-Tlatin1 ;;
+ *.IBM-1047)
+ T=-Tcp1047 ;;
+ ja_JP.ujis | ja_JP.eucJP)
+ T=-Tnippon ;;
+ ko_KR.eucKR)
+ T=-Tkorean ;;
+ *)
+ case "$LESSCHARSET" in
+ utf-8)
+ T=-Tutf8 ;;
+ latin1)
+ T=-Tlatin1 ;;
+ cp1047)
+ T=-Tcp1047 ;;
+ japanese)
+ T=-Tnippon ;;
+ ko)
+ T=-Tkorean ;;
+ *)
+ T=-Tascii8 ;;
+ esac ;;
+ esac ;;
+esac
for i
do
@@ -13,7 +58,7 @@
opts="$opts -P-c" ;;
-h)
opts="$opts -P-h" ;;
- -[eq] | -s* | -u* | -T* )
+ -[eq] | -s*)
# ignore these options
;;
-[mrnoT])
@@ -21,6 +66,12 @@
exit 1 ;;
-[iptSUC] | -[mrno]*)
opts="$opts $1" ;;
+ -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047 | -Tascii8 | -Tnippon | -Tkorean)
+ othercoding=1
+ T=$1 ;;
+ -T*)
+ # ignore other devices
+ ;;
-v | --version)
echo $"GNU nroff (groff) with Red Hat i18n/l10n support"
exit 0 ;;
@@ -44,15 +95,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
@@ -63,11 +120,31 @@
# This shell script is intended for use with man, so warnings are
# probably not wanted. Also load nroff-style character definitions.
+if [ "$othercoding" == 0 ]; then
+ opts="-mtty-char -Tutf8"
+fi
-/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 scm-commits
mailing list