texi2html-cvs
[Top][All Lists]
Advanced

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

[Texi2html-cvs] texi2html ChangeLog texi2html.pl test/run_test.sh


From: Derek Robert Price
Subject: [Texi2html-cvs] texi2html ChangeLog texi2html.pl test/run_test.sh
Date: Thu, 11 Dec 2008 19:25:55 +0000

CVSROOT:        /cvsroot/texi2html
Module name:    texi2html
Changes by:     Derek Robert Price <dprice>     08/12/11 19:25:55

Modified files:
        .              : ChangeLog texi2html.pl 
        test           : run_test.sh 

Log message:
        * texi2html.pl: Set $T2H_HOME based on the path to the script when
        it is not found set in the environment.
        * test/run_test.sh: Use mktemp more portably.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texi2html/ChangeLog?cvsroot=texi2html&r1=1.342&r2=1.343
http://cvs.savannah.gnu.org/viewcvs/texi2html/texi2html.pl?cvsroot=texi2html&r1=1.248&r2=1.249
http://cvs.savannah.gnu.org/viewcvs/texi2html/test/run_test.sh?cvsroot=texi2html&r1=1.4&r2=1.5

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/texi2html/texi2html/ChangeLog,v
retrieving revision 1.342
retrieving revision 1.343
diff -u -b -r1.342 -r1.343
--- ChangeLog   28 Nov 2008 09:27:51 -0000      1.342
+++ ChangeLog   11 Dec 2008 19:25:53 -0000      1.343
@@ -1,3 +1,9 @@
+2008-12-11  Derek Price  <address@hidden>
+
+       * texi2html.pl: Set $T2H_HOME based on the path to the script when
+       it is not found set in the environment.
+       * test/run_test.sh: Use mktemp more portably.
+
 2008-11-28  Patrice Dumas  <address@hidden>
 
        * texi2html.pl: in format_line_number, use @ in front of a macro

Index: texi2html.pl
===================================================================
RCS file: /cvsroot/texi2html/texi2html/texi2html.pl,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -b -r1.248 -r1.249
--- texi2html.pl        28 Nov 2008 09:27:51 -0000      1.248
+++ texi2html.pl        11 Dec 2008 19:25:54 -0000      1.249
@@ -38,6 +38,8 @@
 use POSIX qw(setlocale LC_ALL LC_CTYPE);
 # used to obtain the name of the current working directory
 use Cwd;
+# Used to find the parent directory of this script.
+use File::Basename;
 # used to find a relative path back to the current working directory
 use File::Spec;
 
@@ -52,15 +54,27 @@
 #++##########################################################################
 #
 # NOTE FOR DEBUGGING THIS SCRIPT:
-# You can run 'perl texi2html.pl' directly, provided you have
-# the environment variable T2H_HOME set to the directory containing
-# the texi2html.init, T2h_i18n.pm, translations.pl, l2h.init, 
-# T2h_l2h.pm files
+# You can run 'perl texi2html.pl' directly, provided you have the script
+# in the same directory with, or the environment variable T2H_HOME set to
+# the directory containing, the texi2html.init, T2h_i18n.pm, translations.pl,
+# l2h.init, & T2h_l2h.pm files
 #
 #--##########################################################################
+my $T2H_HOME = defined $ENV{T2H_HOME} ? $ENV{T2H_HOME} : dirname $0;
+if ($0 =~ /\.pl$/)
+{
+    # Issue a warning in debugging mode if $T2H_HOME is set but isn't
+    # accessible.
+    if (!-e $T2H_HOME)
+    { warn "T2H_HOME ($T2H_HOME) does not exist."; }
+    elsif (!-d $T2H_HOME)
+    { warn "T2H_HOME ($T2H_HOME) is not a directory."; }
+    elsif (!-x $T2H_HOME)
+    { warn "T2H_HOME ($T2H_HOME) is not accessible."; }
+}
 
 # CVS version:
-# $Id: texi2html.pl,v 1.248 2008/11/28 09:27:51 pertusus Exp $
+# $Id: texi2html.pl,v 1.249 2008/12/11 19:25:54 dprice Exp $
 
 # Homepage:
 my $T2H_HOMEPAGE = "http://www.nongnu.org/texi2html/";;
@@ -1186,26 +1200,26 @@
 }
 # leave this within comments, and keep the require statement
 # This way, you can directly run texi2html.pl, if 
-# $ENV{T2H_HOME}/texi2html.init exists.
+# $T2H_HOME/texi2html.init exists.
 
 # @INIT@
 
-require "$ENV{T2H_HOME}/texi2html.init" 
+require "$T2H_HOME/texi2html.init" 
     if ($0 =~ /\.pl$/ &&
-        -e "$ENV{T2H_HOME}/texi2html.init" && -r 
"$ENV{T2H_HOME}/texi2html.init");
+        -e "$T2H_HOME/texi2html.init" && -r "$T2H_HOME/texi2html.init");
 
 my $translation_file = 'translations.pl'; # file containing all the 
translations
 my $T2H_OBSOLETE_STRINGS;
 
 # leave this within comments, and keep the require statement
 # This way, you can directly run texi2html.pl, 
-# if $ENV{T2H_HOME}/translations.pl exists.
+# if $T2H_HOME/translations.pl exists.
 #
 # @T2H_TRANSLATIONS_FILE@
 
-require "$ENV{T2H_HOME}/$translation_file"
+require "$T2H_HOME/$translation_file"
     if ($0 =~ /\.pl$/ &&
-        -e "$ENV{T2H_HOME}/$translation_file" && -r 
"$ENV{T2H_HOME}/$translation_file");
+        -e "$T2H_HOME/$translation_file" && -r "$T2H_HOME/$translation_file");
 
 #
 # Some functions used to override normal formatting functions in specific 
@@ -1436,14 +1450,14 @@
 
#---############################################################################
 
 # leave this within comments, and keep the require statement
-# This way, you can directly run texi2html.pl, if $ENV{T2H_HOME}/texi2html.init
+# This way, you can directly run texi2html.pl, if $T2H_HOME/MySimple.pm
 # exists.
 
 # @MYSIMPLE@
 
-require "$ENV{T2H_HOME}/MySimple.pm"
+require "$T2H_HOME/MySimple.pm"
     if ($0 =~ /\.pl$/ &&
-        -e "$ENV{T2H_HOME}/MySimple.pm" && -r "$ENV{T2H_HOME}/MySimple.pm");
+        -e "$T2H_HOME/MySimple.pm" && -r "$T2H_HOME/MySimple.pm");
 
 #+++########################################################################
 #                                                                          #
@@ -1452,13 +1466,13 @@
 #---########################################################################
 
 # leave this within comments, and keep the require statement
-# This way, you can directly run texi2html.pl, if $ENV{T2H_HOME}/T2h_i18n.pm
+# This way, you can directly run texi2html.pl, if $T2H_HOME/T2h_i18n.pm
 # exists.
 
 # @T2H_I18N@
-require "$ENV{T2H_HOME}/T2h_i18n.pm"
+require "$T2H_HOME/T2h_i18n.pm"
     if ($0 =~ /\.pl$/ &&
-        -e "$ENV{T2H_HOME}/T2h_i18n.pm" && -r "$ENV{T2H_HOME}/T2h_i18n.pm");
+        -e "$T2H_HOME/T2h_i18n.pm" && -r "$T2H_HOME/T2h_i18n.pm");
 
 
 #########################################################################
@@ -1474,10 +1488,9 @@
 
 # @T2H_L2H@
 
-
-require "$ENV{T2H_HOME}/T2h_l2h.pm"
+require "$T2H_HOME/T2h_l2h.pm"
     if ($0 =~ /\.pl$/ &&
-        -e "$ENV{T2H_HOME}/T2h_l2h.pm" && -r "$ENV{T2H_HOME}/T2h_l2h.pm");
+        -e "$T2H_HOME/T2h_l2h.pm" && -r "$T2H_HOME/T2h_l2h.pm");
 
 }
 

Index: test/run_test.sh
===================================================================
RCS file: /cvsroot/texi2html/texi2html/test/run_test.sh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- test/run_test.sh    29 Aug 2008 15:05:46 -0000      1.4
+++ test/run_test.sh    11 Dec 2008 19:25:54 -0000      1.5
@@ -92,7 +92,7 @@
 [ -d "$diffs_dir" ] || mkdir "$diffs_dir"
 [ -d "$out_dir" ] || mkdir "$out_dir"
 
-if tmp_dir=`mktemp --tmpdir -d l2h_t2h_XXXXXXXX`; then
+if tmp_dir=`mktemp -d l2h_t2h_XXXXXXXX`; then
   echo "\$L2H_TMP = '$tmp_dir';" > l2h_tmp_dir.init
   echo "1;" >> l2h_tmp_dir.init
 else




reply via email to

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