Skip to content

Commit

Permalink
bin: correct @inc in stand-alone Perl programs so lib/fallback is last
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian M committed Dec 10, 2020
1 parent ec395d3 commit b1b0d24
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 29 deletions.
4 changes: 3 additions & 1 deletion bin/alpha_page
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
$Pgm_Root = "$Pgm_Path/..";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";

}

use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_earthquakes
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ eof
}

BEGIN {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
} # Use BEGIN eval to keep perl2exe happy
require 'handy_utilities.pl'; # For read_mh_opts funcion

Expand Down
3 changes: 2 additions & 1 deletion bin/get_email
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
$Pgm_Root = "$Pgm_Path/..";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tcp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my ( %config_parms, %parms );
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_grid
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

require "RedirAgent.pm";
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_grid_ge
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}
my %parms;
use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_grid_xmltv
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # So perl2exe works
eval "push \@INC, '$Pgm_Path/../lib/fallback';"; # So perl2exe works
}

use XMLTV::Version '$Id$ ';
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_info
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ BEGIN {

( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_info_ge
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ BEGIN {

( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_url
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback' "; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my ( %config_parms, %parms );
Expand Down
4 changes: 2 additions & 2 deletions bin/get_weather
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ $opt_v++ if $parms{v}; # Geo::Weather looks at this
my $caller = caller;
my $return_flag = ( $caller and $caller ne 'main' ) ? 1 : 0;

#use my_lib "$Pgm_Path/../lib/site", "$Pgm_Path/../lib/fallback"; # See note in lib/mh_perl2exe.pl for lib -> my_lib explaination
BEGIN {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
} # Use BEGIN eval to keep perl2exe happy

require 'handy_utilities.pl'; # For read_mh_opts funcion
Expand Down
4 changes: 2 additions & 2 deletions bin/get_weather_ca
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ use vars qw(%Weather @Weather_Forecast);
my $caller = caller;
my $return_flag = ( $caller and $caller ne 'main' ) ? 1 : 0;

#use my_lib "$Pgm_Path/../lib/site", "$Pgm_Path/../lib/fallback"; # See note in lib/mh_perl2exe.pl for lib -> my_lib explaination
BEGIN {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
} # Use BEGIN eval to keep perl2exe happy

require 'handy_utilities.pl'; # For read_mh_opts funcion
Expand Down
3 changes: 2 additions & 1 deletion bin/ical2vsdb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ use strict;
## Sometimes icals are unchanged, but the order is different when downloading. Add option to sort the ical to ensure
## Data hasn't changed even if the order did. Added option sort_before_md5 = 1 to enable globally or to the specific ical

use lib '../lib', '../lib/site', '../lib/fallback';
use lib '../lib', '../lib/site';
push @INC, "../lib/fallback";
use iCal::Parser;
use DateTime;
use Digest::MD5 qw(md5 md5_hex);
Expand Down
3 changes: 2 additions & 1 deletion bin/ical_load
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/net_ftp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
3 changes: 2 additions & 1 deletion bin/outlook_read
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/pocketsphinx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ BEGIN {
($Version) = q$Revision: 1084 $ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/read_email
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
3 changes: 2 additions & 1 deletion bin/report_weblog
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
3 changes: 2 additions & 1 deletion bin/send_email
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
3 changes: 2 additions & 1 deletion bin/set_clock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ print "Requesting the time from $parms{server} using $parms{method} method\n";
#use my_lib "$Pgm_Path/../lib"; # See note in lib/mh_perl2exe.pl for lib -> my_lib explaination
#use my_lib "$Pgm_Path/../lib/site"; # See note in lib/mh_perl2exe.pl for lib -> my_lib explaination
BEGIN {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
} # Use BEGIN eval to keep perl2exe happy

my $time_record;
Expand Down
3 changes: 2 additions & 1 deletion bin/set_password
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ else {
my ( %config_parms, %passwords );

sub setup {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
require 'handy_utilities.pl'; # For read_mh_opts funcion
&main::read_mh_opts( \%config_parms, $Pgm_Path );

Expand Down
3 changes: 2 additions & 1 deletion bin/snpp_page
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
$Pgm_Root = "$Pgm_Path/..";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

#--------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion bin/sun_time
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/test_x10
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# perl test_x10 CM17 COM1 B 2

use strict;
use lib '../lib', '../lib/site', '../lib/fallback';
use lib '../lib', '../lib/site';
push @INC, '$Pgm_Path/../lib/fallback';

my ( $device, $port, $house, $unit, $interface, %config_parms );

Expand Down
3 changes: 2 additions & 1 deletion bin/update_docs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use strict;
Expand Down
3 changes: 2 additions & 1 deletion bin/vv_tts.pl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ BEGIN
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
$Pgm_Root = "$Pgm_Path/..";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site', '$Pgm_Path/../lib/fallback'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use Getopt::Long;
Expand Down

0 comments on commit b1b0d24

Please sign in to comment.