shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU shishi branch, master, updated. shishi-1-0-2-23-g6e9c754


From: Mats Erik Andersson
Subject: [SCM] GNU shishi branch, master, updated. shishi-1-0-2-23-g6e9c754
Date: Sat, 14 Jun 2014 16:23:48 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU shishi".

http://git.savannah.gnu.org/cgit/shishi.git/commit/?id=6e9c754d175e4a99c07e826d134bd7428cad0013

The branch, master has been updated
       via  6e9c754d175e4a99c07e826d134bd7428cad0013 (commit)
       via  476576a2d3eed820d04e4bec4f8d279a67c7c055 (commit)
      from  e62311d668e4ae44fbda25effe41cdebe3a36f38 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6e9c754d175e4a99c07e826d134bd7428cad0013
Author: Mats Erik Andersson <address@hidden>
Date:   Sat Jun 14 18:15:55 2014 +0200

    gdoc chokes on hash key order.
    
    In texinfo mode recursive change of @ is corruptive.
    Documentation now builds on Debian with perl v5.18.2.

commit 476576a2d3eed820d04e4bec4f8d279a67c7c055
Author: Mats Erik Andersson <address@hidden>
Date:   Sat Jun 14 10:11:01 2014 +0200

    Sync gdoc with libidn.

-----------------------------------------------------------------------

Summary of changes:
 doc/Makefile.am |    1 +
 doc/gdoc        |  135 ++++++++++++++++++++++++++++++++++++-------------------
 doc/gdoc-error  |    6 ++-
 3 files changed, 94 insertions(+), 48 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 355e88f..8946d74 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -841,6 +841,7 @@ doit:
                $(srcdir)/gdoc -man \
                        -module $(PACKAGE) -sourceversion $(VERSION) \
                        -bugsto $(PACKAGE_BUGREPORT) \
+                       -pkg-name "$(PACKAGE_NAME)" \
                        -includefuncprefix \
                        -seeinfo $(PACKAGE) -verbatimcopying \
                        -copyright "2002-2010 Simon Josefsson" \
diff --git a/doc/gdoc b/doc/gdoc
index c00f0cd..4307013 100755
--- a/doc/gdoc
+++ b/doc/gdoc
@@ -1,7 +1,10 @@
-#!/usr/bin/perl
+eval '(exit $?0)' && eval 'exec perl -S "$0" ${1+"$@"}'
+  & eval 'exec perl -S "$0" $argv:q'
+    if 0;
+# Generate documentation from source code.
 
-## Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Simon Josefsson
-##                    added -texinfo, -listfunc
+## Copyright (c) 2002-2013 Simon Josefsson
+##                    added -texinfo, -listfunc, -pkg-name
 ##                    man page revamp
 ##                    various improvements
 ## Copyright (c) 2001, 2002 Nikos Mavrogiannopoulos
@@ -27,7 +30,7 @@
 # usage:
 # gdoc [ -docbook | -html | -text | -man | -tex | -texinfo | -listfunc ]
 #      [ -sourceversion verno ] [ -include file | -includefuncprefix ]
-#      [ -bugsto address ]
+#      [ -bugsto address ] [ -pkg-name packagename ]
 #      [ -seeinfo infonode ] [ -copyright notice ] [ -verbatimcopying ]
 #      [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile
 #
@@ -51,6 +54,10 @@
 #       For man pages, include a section about reporting bugs and mention
 #       the given e-mail address, e.g 'address@hidden'.
 #
+#  -pkg-name packagename
+#       For man pages when -bugsto is used, also include help URLs to the
+#       the project's home page.  For example, "GNU Libidn".
+#
 #  -seeinfo infonode
 #       For man pages, include a section that point to an info manual
 #       for more information.
@@ -125,58 +132,62 @@
 # 2. x^y with ${x}^{y}$.
 # 3. xxx\: with xxx:
 
+# XXX: Migrate to strict code with warnings.
+#      Possibly rewrite with Getopt::Long.
+
 use POSIX qw(strftime);
 
 # match expressions used to find embedded type information
-$type_constant = "\\\%(\\w+)";
-$type_func = "(\\w+\\(\\))";
-$type_param = "\\\@(\\w+)";
-$type_struct = "\\\#(\\w+)";
-$type_env = "(\\\$\\w+)";
+$type_constant = '%(\w+)';
+$type_func =    '(\w+\(\))';
+$type_param =   '@(\w+)';
+$type_struct =  '#(\w+)';
+$type_env =     '(\$\w+)';
 
 
 # Output conversion substitutions.
 #  One for each output format
 
 # these work fairly well
-%highlights_html = ( $type_constant, "<i>\$1</i>",
-                    $type_func, "<b>\$1</b>",
-                    $type_struct, "<i>\$1</i>",
-                    $type_param, "<tt><b>\$1</b></tt>" );
+%highlights_html = ( $type_constant => "<i>\$1</i>",
+                    $type_func =>      "<b>\$1</b>",
+                    $type_struct =>    "<i>\$1</i>",
+                    $type_param =>     "<tt><b>\$1</b></tt>" );
 $blankline_html = "<p>";
 
-%highlights_texinfo = ( $type_constant, "address@hidden",
-                       $type_func, "address@hidden",
-                       $type_struct, "address@hidden",
-                       $type_param, "address@hidden" );
+%highlights_texinfo = ( $type_constant => "address@hidden",
+                       $type_func =>     "address@hidden",
+                       $type_struct =>   "address@hidden",
+                       $type_param =>    "address@hidden" );
 $blankline_texinfo = "";
 
-%highlights_tex = ( $type_constant, "{\\\\it \$1}",
-                    $type_func, "{\\\\bf \$1}",
-                    $type_struct, "{\\\\it \$1}",
-                    $type_param, "{\\\\bf \$1}" );
+%highlights_tex = ( $type_constant =>  "{\\\\it \$1}",
+                    $type_func =>      "{\\\\bf \$1}",
+                    $type_struct =>    "{\\\\it \$1}",
+                    $type_param =>     "{\\\\bf \$1}" );
 $blankline_tex = "\\\\";
 
 # sgml, docbook format
-%highlights_sgml = ( $type_constant, "<replaceable 
class=\"option\">\$1</replaceable>",
-                    $type_func, "<function>\$1</function>",
-                    $type_struct, "<structname>\$1</structname>",
-                    $type_env, "<envar>\$1</envar>",
-                    $type_param, "<parameter>\$1</parameter>" );
+%highlights_sgml = ( $type_constant =>
+                       "<replaceable class=\"option\">\$1</replaceable>",
+                    $type_func =>      "<function>\$1</function>",
+                    $type_struct =>    "<structname>\$1</structname>",
+                    $type_env =>       "<envar>\$1</envar>",
+                    $type_param =>     "<parameter>\$1</parameter>" );
 $blankline_sgml = "</para><para>\n";
 
 # these are pretty rough
-%highlights_man = ( $type_constant, "\\\\fB\$1\\\\fP",
-                   $type_func, "\\\\fB\$1\\\\fP",
-                   $type_struct, "\\\\fB\$1\\\\fP",
-                   $type_param, "\\\\fI\$1\\\\fP" );
+%highlights_man = ( $type_constant =>  "\\\\fB\$1\\\\fP",
+                   $type_func =>       "\\\\fB\$1\\\\fP",
+                   $type_struct =>     "\\\\fB\$1\\\\fP",
+                   $type_param =>      "\\\\fI\$1\\\\fP" );
 $blankline_man = "";
 
 # text-mode
-%highlights_text = ( $type_constant, "\$1",
-                    $type_func, "\$1",
-                    $type_struct, "\$1",
-                    $type_param, "\$1" );
+%highlights_text = ( $type_constant => "\$1",
+                    $type_func =>      "\$1",
+                    $type_struct =>    "\$1",
+                    $type_param =>     "\$1" );
 $blankline_text = "";
 
 
@@ -184,7 +195,7 @@ sub usage {
     print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -tex | 
-texinfo  -listfunc ]\n";
     print "         [ -sourceversion verno ] [ -include file | 
-includefuncprefix ]\n";
     print "         [ -bugsto address ] [ -seeinfo infonode ] [ -copyright 
notice]\n";
-    print "         [ -verbatimcopying ]\n";
+    print "         [ -verbatimcopying ] [ -pkg-name packagename ]\n";
     print "         [ -function funcname [ -function funcname ...] ]\n";
     print "         c source file(s) > outputfile\n";
     exit 1;
@@ -202,6 +213,9 @@ $blankline = $blankline_man;
 $modulename = "API Documentation";
 $sourceversion = strftime "%Y-%m-%d", localtime;
 $function_only = 0;
+
+my $lineprefix = "";
+
 while ($ARGV[0] =~ m/^-(.*)/) {
     $cmd = shift @ARGV;
     if ($cmd eq "-html") {
@@ -240,6 +254,8 @@ while ($ARGV[0] =~ m/^-(.*)/) {
        $includefuncprefix = 1;
     } elsif ($cmd eq "-bugsto") {
        $bugsto = shift @ARGV;
+    } elsif ($cmd eq "-pkg-name") {
+       $pkgname = shift @ARGV;
     } elsif ($cmd eq "-copyright") {
        $copyright = shift @ARGV;
     } elsif ($cmd eq "-verbatimcopying") {
@@ -251,7 +267,7 @@ while ($ARGV[0] =~ m/^-(.*)/) {
        $function = shift @ARGV;
        $function_table{$function} = 1;
     } elsif ($cmd eq "-v") {
-       $verbose = 1;
+       $verbose++;
     } elsif (($cmd eq "-h") || ($cmd eq "--help")) {
        usage();
     }
@@ -304,23 +320,42 @@ sub repstr {
     $output =~ s,\$3,$match3,g;
     $output =~ s,\$4,$match4,g;
 
+    my $return;
+
     eval "\$return = qq/$output/";
 
-#    print "pattern $pattern matched 1=$match1 2=$match2 3=$match3 4=$match4 
replace $repl yielded $output interpolated $return\n";
+    if ($verbose > 1) {
+       print STDERR "Pattern $pattern matched with \$1='$match1' \$2='$match2' 
\$3='$match3' \$4='$match4'\n",
+               "\tReplacement $repl produces $output, interpolated as 
$return\n";
+    }
 
-    $return;
+    return $return;
 }
 
 sub just_highlight {
     my $contents = join "\n", @_;
-    my $line;
     my $ret = "";
 
-    foreach $pattern (keys %highlights) {
-#      print "scanning pattern $pattern ($highlights{$pattern})\n";
+    # Must begin with $type_param since all types insert '@' when
+    # in texinfo mode. These insertions must not trigger new
+    # replacements by $type_param.
+    #
+    # The ordering of hash keys cannot be guaranteed!
+
+    my @patterns = grep ! m/^@/, keys %highlights;
+
+    unshift @patterns, $type_param
+       if defined $highlights{$type_param}
+           and grep m/^@/, keys %highlights;
+
+    foreach my $pattern (@patterns) {
+       if ($verbose > 1) {
+           print "Scanning pattern $pattern -> $highlights{$pattern}\n";
+       }
+
        $contents =~ s:$pattern:repstr($pattern, $highlights{$pattern}, $1, $2, 
$3, $4):gse;
     }
-    foreach $line (split "\n", $contents) {
+    foreach my $line (split "\n", $contents) {
        if ($line eq ""){
            $ret = $ret . $lineprefix . $blankline;
        } else {
@@ -365,7 +400,7 @@ sub output_texinfo {
     }
     foreach $section (@{$args{'sectionlist'}}) {
        print "address@hidden:} " if $section ne $section_default;
-       $args{'sections'}{$section} =~ s:([{}]):address@hidden:gs;
+       $args{'sections'}{$section} =~ s:([{}]):address@hidden:gs;
        output_highlight($args{'sections'}{$section});
     }
     print "address@hidden deftypefun\n\n";
@@ -460,7 +495,7 @@ sub output_tex {
 #      print "\n";
 
        $param3 = $args{'parameters'}{$parameter};
-       $param3 =~ s/#([a-zA-Z\_]+)/{\\it \1}/g;
+       $param3 =~ s/#([a-zA-Z\_]+)/{\\it $1}/g;
 
        $out = just_highlight($param3);
        $out =~ s/_/\\_/g;
@@ -474,16 +509,16 @@ sub output_tex {
     foreach $section (@{$args{'sectionlist'}}) {
        $sec = $section;
        $sec =~ s/_/\\_/g;
-       $sec =~ s/#([a-zA-Z\_]+)/{\\it \1}/g;
+       $sec =~ s/#([a-zA-Z\_]+)/{\\it $1}/g;
 
        print "\n{\\large{$sec}}\\\\\n";
        print "\\begin{rmfamily}\n";
 
        $sec = $args{'sections'}{$section};
        $sec =~ s/\\:/:/g;
-       $sec =~ s/#([a-zA-Z\_]+)/{\\it \1}/g;
+       $sec =~ s/#([a-zA-Z\_]+)/{\\it $1}/g;
        $sec =~ s/->/\$\\rightarrow\$/g;
-       $sec =~ s/([0-9]+)\^([0-9]+)/\$\{\1\}\^\{\2\}\$/g;
+       $sec =~ s/([0-9]+)\^([0-9]+)/\$\{$1\}\^\{$2\}\$/g;
 
        $out = just_highlight($sec);
        $out =~ s/_/\\_/g;
@@ -633,6 +668,11 @@ sub output_man {
     if ($args{'bugsto'}) {
        print ".SH \"REPORTING BUGS\"\n";
        print "Report bugs to <". $args{'bugsto'} . ">.\n";
+       if ($args{'pkgname'}) {
+           print $args{'pkgname'} . " home page: " .
+               "http://www.gnu.org/software/"; . $args{'module'} . "/\n";
+       }
+       print "General help using GNU software: http://www.gnu.org/gethelp/\n";;
     }
 
     if ($args{'copyright'}) {
@@ -755,6 +795,7 @@ sub dump_function {
                         'include' => $include,
                         'includefuncprefix' => $includefuncprefix,
                         'bugsto' => $bugsto,
+                        'pkgname' => $pkgname,
                         'copyright' => $copyright,
                         'verbatimcopying' => $verbatimcopying,
                         'seeinfo' => $seeinfo,
diff --git a/doc/gdoc-error b/doc/gdoc-error
index bac25f2..900540a 100755
--- a/doc/gdoc-error
+++ b/doc/gdoc-error
@@ -1,4 +1,7 @@
-#!/usr/bin/perl
+eval '(exit $?0)' && eval 'exec perl -S "$0" ${1+"$@"}'
+  & eval 'exec perl -S "$0" $argv:q'
+    if 0;
+# Generate error strings from source code.
 
 # Copyright (C) 2002, 2004 Simon Josefsson.
 #
@@ -20,6 +23,7 @@
 # you will.
 
 use strict;
+use warnings;
 
 my ($inerror);
 my ($label, $txt);


hooks/post-receive
-- 
GNU shishi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]