From 7e1521119f792d256689320289b7926ac32b42c1 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 17 Oct 2004 23:03:11 +0000 Subject: [PATCH] From Graeme Hewson: make AUTHORS-SHORT not include formatting codes, with AUTHORS-SHORT-FORMAT containing the formatting codes. svn path=/trunk/; revision=12334 --- Makefile.am | 19 +++++++--- Makefile.nmake | 11 +++++- doc/Makefile.am | 4 +- doc/Makefile.nmake | 4 +- ...uthors-short2.pl => make-authors-format.pl | 29 +++------------ make-authors-short.pl | 37 +++++++++++++------ packaging/nsis/ethereal.nsi | 2 + perlnoutf.pl | 16 ++++++++ 8 files changed, 75 insertions(+), 47 deletions(-) rename make-authors-short2.pl => make-authors-format.pl (84%) create mode 100755 perlnoutf.pl diff --git a/Makefile.am b/Makefile.am index 17c613a439..1f8899ae84 100644 --- a/Makefile.am +++ b/Makefile.am @@ -300,8 +300,15 @@ svnversion.h: FORCE # # Build the short version of the authors file for the about dialog # -AUTHORS-SHORT: AUTHORS make-authors-short.pl make-authors-short2.pl - $(PERL) $(srcdir)/make-authors-short.pl < AUTHORS > AUTHORS-SHORT +AUTHORS-SHORT: AUTHORS make-authors-short.pl + $(PERL) $(srcdir)/perlnoutf.pl $(srcdir)/make-authors-short.pl < AUTHORS > AUTHORS-SHORT + +# +# Build the short version of the authors file with formatting codes for the +# man page +# +AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl + $(PERL) $(srcdir)/perlnoutf.pl $(srcdir)/make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT # # Build shell scripts by doing variable substitution. @@ -383,6 +390,7 @@ MAINTAINERCLEANFILES = \ EXTRA_DIST = \ AUTHORS-SHORT \ + AUTHORS-SHORT-FORMAT \ FAQ \ INSTALL.configure \ Makefile.common \ @@ -521,8 +529,8 @@ EXTRA_DIST = \ image/icon_layout_6.xpm \ image/wiretap.rc.in \ imscxdx.xml \ + make-authors-format.pl \ make-authors-short.pl \ - make-authors-short2.pl \ make-manuf \ make-tapreg-dotc \ make-version.pl \ @@ -531,6 +539,7 @@ EXTRA_DIST = \ mergecap.c \ mobileipv4.xml \ nasreq.xml \ + perlnoutf.pl \ print.ps \ randpkt.c \ rdps.c \ @@ -556,7 +565,7 @@ else SUBDIRS = tools wiretap doc epan packaging help @ethereal_SUBDIRS@ endif -ethereal.1: doc/ethereal.pod AUTHORS-SHORT +ethereal.1: doc/ethereal.pod AUTHORS-SHORT-FORMAT (cd doc ; \ $(MAKE) ../ethereal.1 ) @@ -588,7 +597,7 @@ text2pcap.1: doc/text2pcap.pod (cd doc ; \ $(MAKE) ../text2pcap.1 ) -ethereal.html: doc/ethereal.pod AUTHORS-SHORT +ethereal.html: doc/ethereal.pod AUTHORS-SHORT-FORMAT (cd doc ; \ $(MAKE) ../ethereal.html ) diff --git a/Makefile.nmake b/Makefile.nmake index db2d240dfd..679d361cfd 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -229,9 +229,15 @@ svnversion.h: # # Build the short version of the authors file for the about dialog # -AUTHORS-SHORT: AUTHORS make-authors-short.pl make-authors-short2.pl - $(PERL) make-authors-short.pl < AUTHORS > AUTHORS-SHORT +AUTHORS-SHORT: AUTHORS make-authors-short.pl + $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT +# +# Build the short version of the authors file with formatting codes for +# the man page +# +AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl + $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT # # Build "tethereal-tap-register.c", which contains a function @@ -265,6 +271,7 @@ clean: gtk2_distclean capinfo.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\ text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \ rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \ + AUTHORS-SHORT-FORMAT \ dftest.obj dftest.exe randpkt.obj randpkt.ext doxygen.cfg \ $(RESOURCES) cd wiretap diff --git a/doc/Makefile.am b/doc/Makefile.am index 796d69c3e9..8857c94e4c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -24,8 +24,8 @@ # We include dependencies on ../config.h in order to # capture when $(VERSION) changes. -ethereal-tmp.pod: $(srcdir)/ethereal.pod $(top_srcdir)/AUTHORS-SHORT - cat $(srcdir)/ethereal.pod $(top_srcdir)/AUTHORS-SHORT > ethereal-tmp.pod +ethereal-tmp.pod: $(srcdir)/ethereal.pod $(top_srcdir)/AUTHORS-SHORT-FORMAT + cat $(srcdir)/ethereal.pod $(top_srcdir)/AUTHORS-SHORT-FORMAT > ethereal-tmp.pod ../ethereal.1: ethereal-tmp.pod ../config.h $(POD2MAN) \ diff --git a/doc/Makefile.nmake b/doc/Makefile.nmake index 5e6029be11..9741e7e03d 100644 --- a/doc/Makefile.nmake +++ b/doc/Makefile.nmake @@ -32,8 +32,8 @@ doc: ethereal.html tethereal.html ethereal-filter.html capinfo.html \ man: ethereal.1 tethereal.1 ethereal-filter.4 capinfo.1 editcap.1 \ idl2eth.1 mergecap.1 text2pcap.1 -ethereal-tmp.pod: ethereal.pod ../AUTHORS-SHORT - copy /B ethereal.pod + ..\AUTHORS-SHORT ethereal-tmp.pod +ethereal-tmp.pod: ethereal.pod ../AUTHORS-SHORT-FORMAT + copy /B ethereal.pod + ..\AUTHORS-SHORT-FORMAT ethereal-tmp.pod ethereal.1: ethereal.pod ../config.h $(POD2MAN) \ diff --git a/make-authors-short2.pl b/make-authors-format.pl similarity index 84% rename from make-authors-short2.pl rename to make-authors-format.pl index eb5e0beb40..8c325d2d87 100755 --- a/make-authors-short2.pl +++ b/make-authors-format.pl @@ -1,36 +1,17 @@ -#!/usr/bin/perl -w - # $Id$ -# Remove tasks from individual author entries from AUTHORS file -# for use in the about dialog. +# Convert AUTHORS-SHORT file for use in man page and HTML documentation +# after processing through pod2man and pod2html. +# +# Must be called via perlnoutf. use strict; -my $subinfo=0; -my $nextline; - print "=for html
\n\n";
 print "=for man .nf\n\n";
 
-$_ = <>;
-s/\xef\xbb\xbf//;		# Skip UTF-8 byte order mark
-printline() unless /^\n/;
-
 while (<>) {
-	if (/(.*){/) {
-		$subinfo = 1;
-		printline("$1\n");
-	} elsif (/}/) {
-		$subinfo = 0;
-		if (($nextline = <>) !~ /^[\s]*$/) {
-			print($nextline);
-		}
-	} elsif ($subinfo == 1) {
-		next;
-	} else {
-		printline();
-	}
+	printline();
 }
 
 print "\n=for html 
\n"; diff --git a/make-authors-short.pl b/make-authors-short.pl index caa8b5bc90..ac96b0c264 100755 --- a/make-authors-short.pl +++ b/make-authors-short.pl @@ -1,18 +1,31 @@ -#!/usr/bin/perl -w - # $Id$ +# Remove tasks from individual author entries from AUTHORS file +# for use in the about dialog. +# +# Must be called via perlnoutf. + use strict; -# Unset environment variables so perl doesn't -# interpret bytes as UTF-8 characters +my $subinfo=0; +my $nextline; -delete $ENV{LANG}; -delete $ENV{LANGUAGE}; -delete $ENV{LC_ALL}; -delete $ENV{LC_CTYPE}; +$_ = <>; +s/\xef\xbb\xbf//; # Skip UTF-8 byte order mark +print unless /^\n/; -# Call make-authors-short2.pl in same directory, using same interpreter - -(my $prog2 = $0) =~ s/\.pl$/2.pl/; -system($^X, "$prog2", @ARGV); +while (<>) { + if (/(.*){/) { + $subinfo = 1; + print "$1\n"; + } elsif (/}/) { + $subinfo = 0; + if (($nextline = <>) !~ /^[\s]*$/) { + print $nextline; + } + } elsif ($subinfo == 1) { + next; + } else { + print; + } +} diff --git a/packaging/nsis/ethereal.nsi b/packaging/nsis/ethereal.nsi index 312223cf57..660c0f1c44 100644 --- a/packaging/nsis/ethereal.nsi +++ b/packaging/nsis/ethereal.nsi @@ -262,6 +262,7 @@ File "..\..\FAQ" File "..\..\README" File "..\..\README.win32" File "..\..\AUTHORS-SHORT" +File "..\..\AUTHORS-SHORT-FORMAT" File "..\..\COPYING" File "NEWS.txt" File "..\..\manuf" @@ -614,6 +615,7 @@ Delete "$INSTDIR\*.dll" Delete "$INSTDIR\*.html" Delete "$INSTDIR\COPYING" Delete "$INSTDIR\AUTHORS-SHORT" +Delete "$INSTDIR\AUTHORS-SHORT-FORMAT" Delete "$INSTDIR\README*" Delete "$INSTDIR\FAQ" Delete "$INSTDIR\NEWS.txt" diff --git a/perlnoutf.pl b/perlnoutf.pl new file mode 100755 index 0000000000..9f5580fa8c --- /dev/null +++ b/perlnoutf.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w + +# $Id$ + +# Call another Perl script, passing our caller's arguments, with +# environment variables unset so perl doesn't interpret bytes as UTF-8 +# characters. + +use strict; + +delete $ENV{LANG}; +delete $ENV{LANGUAGE}; +delete $ENV{LC_ALL}; +delete $ENV{LC_CTYPE}; + +system("$^X -w @ARGV");