texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * Pod-Simple-Texinfo/pod2texi.pl (BEGIN): detect


From: Patrice Dumas
Subject: branch master updated: * Pod-Simple-Texinfo/pod2texi.pl (BEGIN): detect the case of a pod2texi command installed from Makefile.PL and in that case do not set any path.
Date: Sat, 20 Apr 2024 11:10:43 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 0acc0e74b2 * Pod-Simple-Texinfo/pod2texi.pl (BEGIN): detect the case 
of a pod2texi command installed from Makefile.PL and in that case do not set 
any path.
0acc0e74b2 is described below

commit 0acc0e74b212c961560923c71566ef13c1926e1d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Apr 20 17:10:27 2024 +0200

    * Pod-Simple-Texinfo/pod2texi.pl (BEGIN): detect the case of a
    pod2texi command installed from Makefile.PL and in that case do not
    set any path.
    
    * Pod-Simple-Texinfo/README: explain that pod2texi.pl need to me
    copied before calling perl Makefile.PL.
    
    * Pod-Simple-Texinfo/test_scripts/*.sh: correct a comment.
---
 ChangeLog                                          | 11 +++++++++++
 Pod-Simple-Texinfo/README                          | 15 +++++++++------
 Pod-Simple-Texinfo/pod2texi.pl                     | 22 ++++++++++++++++++----
 .../test_scripts/manual_sectioning_gap_test.sh     |  2 +-
 .../test_scripts/test_empty_head2.sh               |  2 +-
 .../test_scripts/test_ref_to_unknown.sh            |  2 +-
 6 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 472cb75701..104b4ac2ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-04-20  Patrice Dumas  <pertusus@free.fr>
+
+       * Pod-Simple-Texinfo/pod2texi.pl (BEGIN): detect the case of a
+       pod2texi command installed from Makefile.PL and in that case do not
+       set any path.
+
+       * Pod-Simple-Texinfo/README: explain that pod2texi.pl need to me
+       copied before calling perl Makefile.PL.
+
+       * Pod-Simple-Texinfo/test_scripts/*.sh: correct a comment.
+
 2024-04-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (_parse_htmlxref_files): warn if the
diff --git a/Pod-Simple-Texinfo/README b/Pod-Simple-Texinfo/README
index fb9df35a70..20865e3d57 100644
--- a/Pod-Simple-Texinfo/README
+++ b/Pod-Simple-Texinfo/README
@@ -5,6 +5,11 @@ Pod::Simple based Pod formatter to render Texinfo.
 
 INSTALLATION
 
+To install from version control sources, the pod2texi script needs to be
+created first.  This is not needed from code archives.
+
+   cp pod2texi.pl pod2texi
+
 To install this module type the following:
 
    perl Makefile.PL
@@ -25,12 +30,10 @@ and Automake for the build system.  Alternatively, it is 
possible to
 distribute the module using Makefile.PL as described here.
 
 The pod2texi script is usually set up using the Autoconf and Automake
-built environment from pod2texi.pl.  When using Makefile.PL, the
-pod2texi.pl file can be copied instead.  In that case, the Texinfo::Parser
-modules will not be searched for as in the GNU Texinfo usual case, only
-in the perl paths, as in other perl modules.
-
-   cp pod2texi.pl pod2texi
+built environment from pod2texi.pl.  When using Makefile.PL from version
+control sources, pod2texi.pl file should be copied instead, as explained above.
+In that case, the Texinfo::Parser modules will not be searched for as in the
+GNU Texinfo usual case, only in the perl paths, as in other perl modules.
 
 COPYRIGHT AND LICENCE
 
diff --git a/Pod-Simple-Texinfo/pod2texi.pl b/Pod-Simple-Texinfo/pod2texi.pl
index a491662f39..27e7e84497 100755
--- a/Pod-Simple-Texinfo/pod2texi.pl
+++ b/Pod-Simple-Texinfo/pod2texi.pl
@@ -44,10 +44,24 @@ BEGIN
   my $texinfolibdir;
   my $lib_dir;
 
+  my $in_source = 0;
+  # set if we detect that the command comes from a Perl build with Makefile.PL.
+  # In that case we assume that the modules should be found in directories
+  # already registered in paths.
+  my $keep_paths = 0;
+
+  if (defined($ENV{'TEXINFO_DEV_SOURCE'})
+      and $ENV{'TEXINFO_DEV_SOURCE'} ne '0') {
+    $in_source = 1;
+  } elsif ($datadir eq '@' .'datadir@') {
+    if ($0 =~ /\.pl$/) {
+      $in_source = 1;
+    } else {
+      $keep_paths = 1;
+    }
+  }
   # in-source run
-  if ($datadir eq '@' .'datadir@'
-      or defined($ENV{'TEXINFO_DEV_SOURCE'})
-         and $ENV{'TEXINFO_DEV_SOURCE'} ne '0') {
+  if ($in_source) {
     # To find Texinfo::ModulePath
     if (defined($ENV{'top_builddir'})) {
       unshift @INC, File::Spec->catdir($ENV{'top_builddir'}, 'tp');
@@ -65,7 +79,7 @@ BEGIN
     } else {
       unshift @INC, File::Spec->catdir($command_directory, 'lib');
     }
-  } else {
+  } elsif (!$keep_paths) {
     # Look for modules in their installed locations.
     my $lib_dir = File::Spec->catdir($datadir, $package);
     # look for package data in the installed location.
diff --git a/Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh 
b/Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh
index 4170cca6a6..6d4f1890bf 100755
--- a/Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh
+++ b/Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh
@@ -13,7 +13,7 @@ if test z"$srcdir" = "z"; then
   srcdir=.
 fi
 
-# for DIFF_U_OPTION
+# for DIFF_U_OPTION and PERL
 . $testdir/../tp/defs || exit 1
 
 mkdir -p out_tests
diff --git a/Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh 
b/Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh
index 157c6ef6ec..f4785f3354 100755
--- a/Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh
+++ b/Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh
@@ -11,7 +11,7 @@ if test z"$srcdir" = "z"; then
   srcdir=.
 fi
 
-# for DIFF_U_OPTION
+# for DIFF_U_OPTION and PERL
 . $testdir/../tp/defs || exit 1
 
 mkdir -p out_tests_empty_head2
diff --git a/Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh 
b/Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh
index b3b4117827..b13f02362e 100755
--- a/Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh
+++ b/Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh
@@ -11,7 +11,7 @@ if test z"$srcdir" = "z"; then
   srcdir=.
 fi
 
-# for DIFF_U_OPTION
+# for DIFF_U_OPTION and PERL
 . $testdir/../tp/defs || exit 1
 
 mkdir -p out_tests_ref_to_unknown



reply via email to

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