[xml/sgml-commit] [SCM] linuxdoc-tools package for Debian. branch, master, updated. debian/0.9.60-24-gf1f1363

Agustin Martin Domingo agmartin at debian.org
Mon Jun 15 12:30:32 UTC 2009


The following commit has been merged in the master branch:
commit d01762912019ac483bd9077d5946afad3df3309d
Author: Agustin Martin Domingo <agmartin at debian.org>
Date:   Thu Apr 16 00:22:10 2009 +0200

    Use input file name in initial comment of resulting info file.
    
    For info backend, we better put original input file name in
    resulting info, instead of obscure temp file name, so we
    have in header comment something like
    
      This is file.info, produced by makeinfo version x.yy from
      info file generated after file.sgml by means of linuxdoc-tools.
    
    instead of
    
      This is file.info, produced by makeinfo version x.yy from
      /tmp/linuxdoc-tools.Adm1iK88Ek/sgmltmp.file.2.texi.

diff --git a/lib/fmt/fmt_info.pl b/lib/fmt/fmt_info.pl
index 348602b..ce0f73d 100644
--- a/lib/fmt/fmt_info.pl
+++ b/lib/fmt/fmt_info.pl
@@ -5,7 +5,7 @@
 #  GNU Info-specific driver stuff
 #
 #  Copyright © 1996, Cees de Groot
-#  Copyright © 2008 Agustin Martin
+#  Copyright © 2008-2009 Agustin Martin
 # ------------------------------------------------------------------
 
 package LinuxDocTools::fmt_info;
@@ -106,12 +106,14 @@ $info->{postASP} = sub {
   my $INFILE    = shift;
   my $OUTFILE;
   my $msgheader = "fmt_info::postASP";
+  my $fileinfo  = "info file generated after $global->{origfile} by means of linuxdoc-tools";
 
   my $awk       = $main::progs->{AWK};
   my $awkfilter = "$main::DataDir" . "/filters/info-postASP.awk";
   my $awkin     = "$global->{tmpbase}.1.texi0";
   my $texifile  = "$global->{tmpbase}.2.texi";
   my $infofile  = "$global->{filename}.info";
+  my $infofile0 = "$global->{tmpbase}.info";
 
   open ($OUTFILE, "> $awkin")
     or die "fmt_info::postASP: Could not open \"$awkin\" for writing\n";
@@ -120,9 +122,29 @@ $info->{postASP} = sub {
 
   system ("$awk -v INFO=$infofile -f $awkfilter $awkin > $texifile") == 0
     or die "$msgheader: Failed to run awk filter. Aborting ...\n";
+
   system ("makeinfo $texifile -o $infofile") == 0
     or die "$msgheader: Failed to run makeinfo. Aborting ...\n";
 
+  move $infofile, $infofile0;
+
+  my $TMPINFO;
+  my $infotext;
+  open ( $TMPINFO, "< $infofile0")
+    or die "Could not open $infofile0 for read. Aborting ... \n";
+  {
+    local $/ = undef;
+    $infotext = <$TMPINFO>;
+  }
+  close $TMPINFO;
+
+  $infotext =~ s/^$texifile/$fileinfo/m;
+
+  open ($OUTFILE, "> $infofile")
+    or die "Could not open $infofile for write. Aborting ... \n";
+  print $OUTFILE $infotext;
+  close $OUTFILE;
+
   return 0;
 };
 
diff --git a/perl5lib/LinuxDocTools.pm b/perl5lib/LinuxDocTools.pm
index b4a0928..94c2e5a 100644
--- a/perl5lib/LinuxDocTools.pm
+++ b/perl5lib/LinuxDocTools.pm
@@ -470,7 +470,7 @@ etcetera. See the code for details.
 # ------------------------------------------------------------------------
 sub process_file {
 # ------------------------------------------------------------------------
-  my $file            = shift (@_);
+  my $file            = $global->{origfile} = shift (@_);
   my $saved_umask     = umask;
   my $error_header    = "LinuxdocTools::process_file";
 

-- 
linuxdoc-tools package for Debian.



More information about the debian-xml-sgml-commit mailing list