texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/Pod-Simple-Texinfo Makefile.am pod2texi.pl


From: Patrice Dumas
Subject: texinfo/Pod-Simple-Texinfo Makefile.am pod2texi.pl
Date: Tue, 24 Jan 2012 22:50:13 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/01/24 22:50:13

Modified files:
        Pod-Simple-Texinfo: Makefile.am pod2texi.pl 

Log message:
        Error out when no file is given and in a terminal.
        
        Add all the required includes for dependent modules.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/Pod-Simple-Texinfo/Makefile.am?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/Pod-Simple-Texinfo/pod2texi.pl?cvsroot=texinfo&r1=1.4&r2=1.5

Patches:
Index: Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/Pod-Simple-Texinfo/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- Makefile.am 21 Jan 2012 23:52:21 -0000      1.3
+++ Makefile.am 24 Jan 2012 22:50:13 -0000      1.4
@@ -12,8 +12,9 @@
 dist_modules_DATA = \
  lib/Pod/Simple/Texinfo.pm
 
-pod2texi: pod2texi.pl
-       sed -e 's,address@hidden@],$(datadir),g' $(srcdir)/$< >$@
+pod2texi: pod2texi.pl Makefile
+       sed -e 's,address@hidden@],$(datadir),g' \
+       -e 's,address@hidden@],$(PACKAGE),g' $(srcdir)/$< >$@
        chmod a+x $@
 
 TESTS = prove.sh

Index: pod2texi.pl
===================================================================
RCS file: /sources/texinfo/texinfo/Pod-Simple-Texinfo/pod2texi.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- pod2texi.pl 21 Jan 2012 22:39:33 -0000      1.4
+++ pod2texi.pl 24 Jan 2012 22:50:13 -0000      1.5
@@ -20,19 +20,23 @@
 # Original author: Patrice Dumas <address@hidden>
 
 use strict;
-use Pod::Simple::Texinfo;
-
 use Getopt::Long qw(GetOptions);
 
 Getopt::Long::Configure("gnu_getopt");
 
 BEGIN
 {
-  my $texinfolibdir = '@datadir@/Pod-Simple-Texinfo';
-  unshift @INC, ($texinfolibdir)
-    if ($texinfolibdir ne ''
-        and $texinfolibdir ne '@' .'datadir@/Pod-Simple-Texinfo');
+  if ('@datadir@' ne '@' . 'datadir@') {
+    my $pkgdatadir = eval '"@datadir@/@PACKAGE@"';
+    my $datadir = eval '"@datadir@"';
+    unshift @INC, ("$pkgdatadir/Pod-Simple-Texinfo",
+        "$pkgdatadir",
+        "$pkgdatadir/lib/libintl-perl/lib", 
+        "$pkgdatadir/lib/Unicode-EastAsianWidth/lib",
+        "$pkgdatadir/lib/Text-Unidecode/lib");
+  }
 }
+use Pod::Simple::Texinfo;
 
 {
 # A fake package to be able to use Pod::Simple::PullParser without generating
@@ -51,9 +55,15 @@
 my $real_command_name = $0;
 $real_command_name =~ s/.*\///;
 
+# placeholder for string translations, not used for now
+sub __($)
+{
+  return $_[0];
+}
+
 sub pod2texi_help()
 {
-  print "Usage: pod2texi [OPTION]... POD-FILE...
+  print __("Usage: pod2texi [OPTION]... POD-FILE...
 
 Translate Pod to Texinfo.  If the base level is higher than 0, 
 a main manual including all the files is done otherwise all
@@ -64,7 +74,7 @@
     --unnumbered-sections   use unumbered sections.
     --output=NAME           output name for the first or the main manual.
     --top                   top for the main manual.
-    --version               display version information and exit.\n";
+    --version               display version information and exit.\n");
 }
 
 my $base_level = 0;
@@ -91,8 +101,16 @@
 my @manuals;
 my @all_manual_names;
 
+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);
+
 # First gather all the manual names
-foreach my $file (@ARGV) {
+foreach my $file (@input_files) {
   # not really used, only the manual name is used.
   my $parser = Pod::Simple::PullParserRun->new();
   $parser->parse_file($file);
@@ -108,7 +126,7 @@
 
 my $file_nr = 0;
 my @included;
-foreach my $file (@ARGV) {
+foreach my $file (@input_files) {
   my $outfile;
   my $name = shift @all_manual_names;
   if ($base_level == 0 and !$file_nr and defined($output)) {



reply via email to

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