texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp texi2any.pl


From: Patrice Dumas
Subject: texinfo/tp texi2any.pl
Date: Sat, 17 Nov 2012 23:58:53 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/11/17 23:58:52

Modified files:
        tp             : texi2any.pl 

Log message:
        Reuse more the results of fileparse.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.142&r2=1.143

Patches:
Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -b -r1.142 -r1.143
--- texi2any.pl 15 Sep 2012 12:19:42 -0000      1.142
+++ texi2any.pl 17 Nov 2012 23:58:52 -0000      1.143
@@ -47,8 +47,8 @@
   }
 }
 
-my ($real_command_name, $directories, $suffix) = fileparse($0);
-$real_command_name =~ s/\.pl$//;
+my ($real_command_name, $command_directory, $command_suffix) 
+   = fileparse($0, '.pl');
 
 # this associates the command line options to the arrays set during
 # command line parsing.
@@ -118,17 +118,20 @@
   return Locale::Messages::dpgettext($messages_textdomain, $context, $msgid);
 }
 
-my $srcdir = defined $ENV{'srcdir'} ? $ENV{'srcdir'} : dirname $0;
+my $srcdir = defined $ENV{'srcdir'} ? $ENV{'srcdir'} : $command_directory;
 
-if (($0 =~ /\.pl$/ and !(defined($ENV{'TEXINFO_DEV_SOURCE'})
+if (($command_suffix eq '.pl' and !(defined($ENV{'TEXINFO_DEV_SOURCE'})
      and $ENV{'TEXINFO_DEV_SOURCE'} eq 0)) or $ENV{'TEXINFO_DEV_SOURCE'}) {
   unshift @INC, $srcdir;
 }
 
 require Texinfo::Convert::Texinfo;
 
+#sub add_module_path_to_INC($$$)
+
 my $libsrcdir = File::Spec->catdir($srcdir, 'maintain');
-if (($0 =~ /\.pl$/ and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
+
+if (($command_suffix eq '.pl' and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
      and $ENV{'TEXINFO_DEV_SOURCE'} eq 0)) or $ENV{'TEXINFO_DEV_SOURCE'}) {
   unshift @INC, File::Spec->catdir($libsrcdir, 'lib', 'libintl-perl', 'lib');
 } elsif ('@USE_EXTERNAL_LIBINTL@' ne 'yes'
@@ -149,7 +152,7 @@
 #my @search_locale_dirs = ("$datadir/locale", (map $_ . '/LocaleData', @INC),
 #  qw (/usr/share/locale /usr/local/share/locale));
 
-if (($0 =~ /\.pl$/ and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
+if (($command_suffix eq '.pl' and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
      and $ENV{'TEXINFO_DEV_SOURCE'} eq 0)) or $ENV{'TEXINFO_DEV_SOURCE'}) {
   # in case of build from the source directory, out of source build, 
   # this helps to locate the locales.
@@ -175,7 +178,7 @@
 Locale::Messages::bindtextdomain ($messages_textdomain, 
                                   File::Spec->catdir($datadir, 'locale'));
 
-if (($0 =~ /\.pl$/ and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
+if (($command_suffix eq '.pl' and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
      and $ENV{'TEXINFO_DEV_SOURCE'} eq 0)) or $ENV{'TEXINFO_DEV_SOURCE'}) {
   unshift @INC, 
     File::Spec->catdir($libsrcdir, 'lib', 'Unicode-EastAsianWidth', 'lib');
@@ -190,7 +193,7 @@
 }
 require Unicode::EastAsianWidth;
 
-if (($0 =~ /\.pl$/ and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
+if (($command_suffix eq '.pl' and !(defined($ENV{'TEXINFO_DEV_SOURCE'}) 
      and $ENV{'TEXINFO_DEV_SOURCE'} eq 0)) or $ENV{'TEXINFO_DEV_SOURCE'}) {
   unshift @INC, File::Spec->catdir($libsrcdir, 'lib', 'Text-Unidecode', 'lib');
 } elsif ('@USE_EXTERNAL_UNIDECODE@' ne 'yes'



reply via email to

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