texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp MANIFEST texi2any.pl


From: Patrice Dumas
Subject: texinfo/tp MANIFEST texi2any.pl
Date: Sun, 19 Feb 2012 11:41:30 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/02/19 11:41:30

Modified files:
        tp             : MANIFEST texi2any.pl 

Log message:
        Parse version from configure.ac when using unconfigured script.  Idea
        from the boss ;-)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/MANIFEST?cvsroot=texinfo&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.115&r2=1.116

Patches:
Index: MANIFEST
===================================================================
RCS file: /sources/texinfo/texinfo/tp/MANIFEST,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- MANIFEST    17 Feb 2012 22:53:46 -0000      1.34
+++ MANIFEST    19 Feb 2012 11:41:30 -0000      1.35
@@ -1012,6 +1012,7 @@
 t/results/sectioning/next_no_prev_to_node.pl
 t/results/sectioning/node_empty_direction.pl
 t/results/sectioning/nodename_parentheses.pl
+t/results/sectioning/node_nested_parentheses.pl
 t/results/sectioning/node_part_chapter_after_chapter.pl
 t/results/sectioning/node_part_chapter_after_top.pl
 t/results/sectioning/node.pl
@@ -1145,6 +1146,7 @@
 t/results/xtable/table_nested.pl
 t/results/xtable/text_between_item_itemx.pl
 t/results/xtable/title_and_itemx_before_item.pl
+t/test_brace_count.t
 t/test_count.t
 t/test_fill_gaps_in_sectioning.t
 t/test_protect_hashchar_at_line_beginning.t

Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- texi2any.pl 17 Feb 2012 22:53:47 -0000      1.115
+++ texi2any.pl 19 Feb 2012 11:41:30 -0000      1.116
@@ -192,17 +192,36 @@
 require DebugTexinfo::DebugCount;
 require DebugTexinfo::DebugTree;
 
+# Version setting is complicated, because we cope with 
+# * script with configure values substituted or not
+# * script shipped as part of texinfo or as a standalone perl module
+
 # When shipped as a perl modules, $hardcoded_version is set to undef here
-# by a sed one liner.
-# $hardcoded_version has to be manually adjusted.  I know that it is wrong, 
-# but that are the boss orders ;-)
-my $hardcoded_version = "4.13.90";
-# Version: set in configure.in
+# by a sed one liner.  The consequence is that configure.ac is not used
+# to retrieve the version number.
+# Otherwise this is only used as a safety value, and should never be used 
+# in practice as a regexp extracts the version from configure.ac.
+my $hardcoded_version = "4.13.90-hardcoded";
+# Version set in configure.ac
 my $configured_version = '@PACKAGE_VERSION@';
 if ($configured_version eq '@' . 'PACKAGE_VERSION@') {
+  # if not configured, and $hardcoded_version is set search for the version 
+  # in configure.ac
   if (defined($hardcoded_version)) {
-    $configured_version = $hardcoded_version;
+    if (open (CONFIGURE, "$srcdir/../configure.ac")) {
+      while (<CONFIGURE>) {
+        if (/^AC_INIT\(\[[^\]]+\]\s*,\s*\[([^\]]+)\]\s*,/) {
+          $configured_version = $1;
+          last;
+        }
+      }
+      close (CONFIGURE);
+    }
+    # This should never be used, but is a safety value
+    $configured_version = $hardcoded_version if 
(!defined($configured_version));
   } else {
+    # used in the standalone perl module, as $hardcoded_version is undef
+    # and it should never be configured in that setup
     $configured_version = $Texinfo::Parser::VERSION;
   }
 }



reply via email to

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