[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo ChangeLog util/dir-example util/texi-el...
From: |
Karl Berry |
Subject: |
texinfo ChangeLog util/dir-example util/texi-el... |
Date: |
Tue, 17 Apr 2012 00:39:35 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Karl Berry <karl> 12/04/17 00:39:35
Modified files:
. : ChangeLog
util : dir-example texi-elements-by-size
Removed files:
util : texi_sort_elements_count.pl
Log message:
texi-elements-by-size renamed from texi_sort_elements_count.pl, with
minor configure tweaks
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/ChangeLog?cvsroot=texinfo&r1=1.1348&r2=1.1349
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/dir-example?cvsroot=texinfo&r1=1.91&r2=1.92
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/texi-elements-by-size?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/texi_sort_elements_count.pl?cvsroot=texinfo&r1=1.1&r2=0
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/texinfo/texinfo/ChangeLog,v
retrieving revision 1.1348
retrieving revision 1.1349
diff -u -b -r1.1348 -r1.1349
--- ChangeLog 14 Apr 2012 00:21:06 -0000 1.1348
+++ ChangeLog 17 Apr 2012 00:39:34 -0000 1.1349
@@ -1,3 +1,8 @@
+2012-04-16 Karl Berry <address@hidden>
+
+ * util/texi-elements-by-size: renamed from
+ texi_sort_elements_count.pl and texinfo configure variables removed.
+
2012-04-13 Karl Berry <address@hidden>
* doc/texinfo.txi (Command Contexts): clarify @shortcaption, etc.
Index: util/dir-example
===================================================================
RCS file: /sources/texinfo/texinfo/util/dir-example,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -b -r1.91 -r1.92
--- util/dir-example 13 Apr 2012 16:56:53 -0000 1.91
+++ util/dir-example 17 Apr 2012 00:39:34 -0000 1.92
@@ -9,7 +9,7 @@
If you have dir entries for Texinfo manuals you'd like to be added here,
please send them to address@hidden
-$Id: dir-example,v 1.91 2012/04/13 16:56:53 karl Exp $
+$Id: dir-example,v 1.92 2012/04/17 00:39:34 karl Exp $
File: dir, Node: Top, This is the top of the INFO tree.
@@ -304,7 +304,8 @@
* Standards: (standards). GNU coding standards.
Individual utilities
-* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
+* aclocal-invocation: (automake)aclocal Invocation.
+ Generating aclocal.m4.
* afm2tfm: (dvips)Invoking afm2tfm. Adobe to TeX font metrics.
* addr2line: (binutils)addr2line. Convert addresses to file and line.
* ar: (binutils)ar. Create, modify, and extract from archives.
@@ -318,7 +319,8 @@
templates
* autom4te: (autoconf)autom4te Invocation. The Autoconf executables
backbone
-* automake: (automake)Invoking Automake. Generating Makefile.in.
+* automake-invocation: (automake)automake Invocation.
+ Generating Makefile.in.
* autoreconf: (autoconf)autoreconf Invocation. Remaking multiple `configure'
scripts
* autoscan: (autoconf)autoscan Invocation. Semi-automatic `configure.ac'
Index: util/texi-elements-by-size
===================================================================
RCS file: /sources/texinfo/texinfo/util/texi-elements-by-size,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- util/texi-elements-by-size 16 Apr 2012 15:59:52 -0000 1.1
+++ util/texi-elements-by-size 17 Apr 2012 00:39:34 -0000 1.2
@@ -1,5 +1,7 @@
#! /usr/bin/env perl
# texi-elements-by-size -- dump list of elements based on words or line counts.
+# Also serve as an example of using the Texinfo::Parser module,
+# including the usual per-format options.
#
# Copyright 2012 Free Software Foundation, Inc.
#
@@ -26,11 +28,16 @@
BEGIN
{
- my $texinfolibdir = "../tp";
- unshift @INC, ($texinfolibdir);
+ # The purpose of these includes is to make it possible to run the
+ # script from a Texinfo source checkout. If that's not relevant,
+ # probably best to simply assume all the needed packages are in the
+ # Perl include path.
#
- require Texinfo::Init;
- Texinfo::Init::init();
+ my $txi_libdir = "../tp";
+ unshift @INC, ($txi_libdir);
+ #
+ my @txi_maint_dirs = qw(Text-Unidecode Unicode-EastAsianWidth libintl-perl);
+ unshift (@INC, map { "$txi_libdir/maintain/lib/$_/lib" } @txi_maint_dirs );
}
use Texinfo::Parser;
@@ -59,11 +66,13 @@
return $_[0];
}
-my $format = 'info';
+my $format = 'info'; # make our counts from the Info output
# this is the format associated with the output format, which is replaced
# when the output format changes. It may also be removed if there is the
# corresponding --no-ifformat.
#my $default_expanded_format = [ $format ];
+
+# directories specified on the command line.
my @include_dirs = ();
my @prepend_dirs = ();
@@ -203,11 +212,11 @@
my $parser_options = { %$parser_default_options };
$parser_options->{'include_directories'} = address@hidden;
-my @prependended_include_directories = ('.');
-push @prependended_include_directories, $input_directory
+my @prepended_include_directories = ('.');
+push @prepended_include_directories, $input_directory
if ($input_directory ne '.');
unshift @{$parser_options->{'include_directories'}},
- @prependended_include_directories;
+ @prepended_include_directories;
unshift @{$parser_options->{'include_directories'}}, @prepend_dirs;
my $error_count = 0;
Index: util/texi_sort_elements_count.pl
===================================================================
RCS file: util/texi_sort_elements_count.pl
diff -N util/texi_sort_elements_count.pl
--- util/texi_sort_elements_count.pl 18 Jan 2012 22:31:13 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,236 +0,0 @@
-#! /usr/bin/perl -w
-
-# texi_sort_elements_count: sort elements based on words or line counts.
-#
-# Copyright 2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License,
-# or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Original author: Patrice Dumas <address@hidden>
-
-
-use strict;
-
-use Getopt::Long qw(GetOptions);
-# to determine the path separator
-use Config;
-
-Getopt::Long::Configure("gnu_getopt");
-
-BEGIN
-{
- my $texinfolibdir = '@datadir@/@PACKAGE@';
- unshift @INC, ($texinfolibdir)
- if ($texinfolibdir ne ''
- and $texinfolibdir ne '@' .'datadir@/@PACKAGE'.'@');
-}
-
-use Texinfo::Parser;
-use Texinfo::Structuring;
-use Texinfo::Convert::TextContent;
-
-my $configured_version = '@PACKAGE_VERSION@';
-$configured_version = $Texinfo::Parser::VERSION
- if ($configured_version eq '@' . 'PACKAGE_VERSION@');
-
-my $real_command_name = $0;
-$real_command_name =~ s/.*\///;
-$real_command_name =~ s/\.pl$//;
-
-# determine the path separators
-my $path_separator = $Config{'path_sep'};
-$path_separator = ':' if (!defined($path_separator));
-my $quoted_path_separator = quotemeta($path_separator);
-
-my $force = 0;
-my $use_sections = 0;
-my $count_words = 0;
-my $no_warn = 0;
-
-# placeholder for future i18n.
-sub __($)
-{
- return $_[0];
-}
-
-my $format = 'info';
-# this is the format associated with the output format, which is replaced
-# when the output format changes. It may also be removed if there is the
-# corresponding --no-ifformat.
-#my $default_expanded_format = [ $format ];
-my @include_dirs = ();
-my @prepend_dirs = ();
-
-my $parser_default_options = {
- #'expanded_formats' => [],
- 'expanded_formats' => [ $format ],
- 'values' => {},
- #'gettext' => \&__
- };
-
-sub set_expansion($$) {
- my $region = shift;
- my $set = shift;
- $set = 1 if (!defined($set));
- if ($set) {
- push @{$parser_default_options->{'expanded_formats'}}, $region
- unless (grep {$_ eq $region}
@{$parser_default_options->{'expanded_formats'}});
- } else {
- @{$parser_default_options->{'expanded_formats'}} =
- grep {$_ ne $region} @{$parser_default_options->{'expanded_formats'}};
-# @{$default_expanded_format}
-# = grep {$_ ne $region} @{$default_expanded_format};
- }
-}
-
-my $result_options = Getopt::Long::GetOptions (
- 'help|h' => sub { print help(); exit 0; },
- 'version|V' => sub {print "$real_command_name $configured_version\n\n";
- printf __("Copyright (C) %s Free Software Foundation, Inc.
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.\n"), '2012';
- exit 0;},
- 'force' => \$force,
- 'ifhtml!' => sub { set_expansion('html', $_[1]); },
- 'ifinfo!' => sub { set_expansion('info', $_[1]); },
- 'ifxml!' => sub { set_expansion('xml', $_[1]); },
- 'ifdocbook!' => sub { set_expansion('docbook', $_[1]); },
- 'iftex!' => sub { set_expansion('tex', $_[1]); },
- 'ifplaintext!' => sub { set_expansion('plaintext', $_[1]); },
- 'use-sections!' => \$use_sections,
- 'count-words!' => \$count_words,
- 'no-warn' => \$no_warn,
- 'D=s' => sub {$parser_default_options->{'values'}->{$_[1]} = 1;},
- 'U=s' => sub {delete $parser_default_options->{'values'}->{$_[1]};},
- 'I=s' => sub {
- push @include_dirs, split(/$quoted_path_separator/, $_[1]); },
- 'P=s' => sub { unshift @prepend_dirs, split(/$quoted_path_separator/,
$_[1]); },
- 'number-sections!' => sub { set_from_cmdline('NUMBER_SECTIONS', $_[1]); },
-);
-
-exit 1 if (!$result_options);
-
-my @input_files = @ARGV;
-# use STDIN if not a tty, like makeinfo does
address@hidden = ('-') if (!scalar(@input_files) and !-t STDIN);
-
-die sprintf(__("%s: missing file argument.\n"), $real_command_name)
- .sprintf(__("Try `%s --help' for more information.\n"), $real_command_name)
- unless (scalar(@input_files) >= 1);
-
-
-if (scalar(@input_files) > 1) {
- warn sprintf(__("%s: superfluous file arguments.\n"), $real_command_name);
-}
-
-my $input_file_name = shift @input_files;
-
-sub help()
-{
- my $help =
- sprintf(__("Usage: %s [OPTION]... TEXINFO-FILE...\n"), $real_command_name)
- ."\n".
- __("Dump out a list of elements sorted by the number of lines (or words)
-they contain after removal of address@hidden")
-."\n";
-
- $help .= __("General Options:
- --count-words count words instead of lines.
- --force keep on even if the Texinfo file parsing failed.
- --help display this help and exit.
- --no-warn suppress warnings (but not errors).
- --use-sections use sections as elements instead of nodes.
- --version display version information and exit.\n")
-."\n";
- $help .= __("Input file options:
- -D VAR define the variable VAR, as with address@hidden
- -I DIR append DIR to the address@hidden search path.
- -P DIR prepend DIR to the address@hidden search path.
- -U VAR undefine the variable VAR, as with
address@hidden")
-."\n";
- $help .= __("Conditional processing in input:
- --ifdocbook process address@hidden and address@hidden
- --ifhtml process address@hidden and address@hidden
- --ifinfo process address@hidden
- --ifplaintext process address@hidden
- --iftex process address@hidden and address@hidden
- --ifxml process address@hidden and address@hidden
- --no-ifdocbook do not process address@hidden and address@hidden text.
- --no-ifhtml do not process address@hidden and address@hidden text.
- --no-ifinfo do not process address@hidden text.
- --no-ifplaintext do not process address@hidden text.
- --no-iftex do not process address@hidden and address@hidden text.
- --no-ifxml do not process address@hidden and address@hidden text.
-
- Also, for the --no-ifFORMAT options, do process address@hidden text.\n");
- return $help;
-
-}
-
-sub _exit($)
-{
- my $error_count = shift;
- exit (1) if ($error_count and !$force);
-}
-
-sub handle_errors($$)
-{
- my $self = shift;
- my $error_count = shift;
- my ($errors, $new_error_count) = $self->errors();
- $error_count += $new_error_count if ($new_error_count);
- foreach my $error_message (@$errors) {
- warn $error_message->{'error_line'} if ($error_message->{'type'} eq 'error'
- or !$no_warn);
- }
-
- _exit($error_count);
- return $error_count;
-}
-
-my $input_directory = '.';
-if ($input_file_name =~ /(.*\/)/) {
- $input_directory = $1;
-}
-
-my $parser_options = { %$parser_default_options };
-$parser_options->{'include_directories'} = address@hidden;
-my @prependended_include_directories = ('.');
-push @prependended_include_directories, $input_directory
- if ($input_directory ne '.');
-unshift @{$parser_options->{'include_directories'}},
- @prependended_include_directories;
-unshift @{$parser_options->{'include_directories'}}, @prepend_dirs;
-
-my $error_count = 0;
-my $parser = Texinfo::Parser::parser($parser_options);
-my $tree = $parser->parse_texi_file($input_file_name);
-
-if (!defined($tree)) {
- handle_errors($parser, $error_count);
- exit (1);
-}
-
-my $converter_options = {};
-$converter_options->{'parser'} = $parser;
-my $converter = Texinfo::Convert::TextContent->converter($converter_options);
-
-my ($sorted_name_counts_array, $formatted_result)
- = $converter->sort_element_counts($tree, $use_sections,
- $count_words);
-
-print STDOUT $formatted_result;
-
-1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo ChangeLog util/dir-example util/texi-el...,
Karl Berry <=