summaryrefslogtreecommitdiff
path: root/fml/libexec
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-01-21 11:52:03 +0000
committerfukachan <fukachan>2001-01-21 11:52:03 +0000
commit2f7fc7a69f61f222bd00253c62b2b61dab5b562c (patch)
tree2be7fb941561f6a5b5799a96d6b121910efa7a97 /fml/libexec
parent1e4e015ad82ea78c273c2b667d6fe3fab6103eff (diff)
downloadfml8-2f7fc7a69f61f222bd00253c62b2b61dab5b562c.tar.gz
fml8-2f7fc7a69f61f222bd00253c62b2b61dab5b562c.tar.bz2
fml8-2f7fc7a69f61f222bd00253c62b2b61dab5b562c.zip
fix @INC loading for debug
Diffstat (limited to 'fml/libexec')
-rwxr-xr-xfml/libexec/fml10
-rwxr-xr-xfml/libexec/fmlwrapper6
2 files changed, 11 insertions, 5 deletions
diff --git a/fml/libexec/fml b/fml/libexec/fml
index 25852986..e913e2d7 100755
--- a/fml/libexec/fml
+++ b/fml/libexec/fml
@@ -30,7 +30,8 @@ sub main::ProcessSwitch
my ($args) = @_;
# 1. create process
- my $pkg = _package_we_use($args);
+ my $pkg = _package_we_use($args);
+ croak("$args->{ myname } is unknown program\n") unless ($pkg);
eval qq{ require $pkg; }; # XXX require() needs bare words.
croak($@) if $@;
@@ -59,7 +60,7 @@ sub _package_we_use
my $name = $args->{ myname };
my $pkg = '';
- if ($name eq 'fml.pl' || $name eq 'distribute') {
+ if ($name eq 'fml.pl' || $name eq 'distribute' || $name eq 'fmlwrapper') {
$pkg = 'FML::Process::Distribute';
}
elsif (( $name eq 'fml.pl' && $args->{ options }->{ ctladdr }) ||
@@ -72,6 +73,11 @@ sub _package_we_use
elsif ($name eq 'mead') {
$pkg = 'FML::Process::Mead';
}
+ else {
+ return '';
+ }
+
+ return $pkg;
}
diff --git a/fml/libexec/fmlwrapper b/fml/libexec/fmlwrapper
index 1837ed3b..8100e207 100755
--- a/fml/libexec/fmlwrapper
+++ b/fml/libexec/fmlwrapper
@@ -78,9 +78,9 @@ sub Bootstrap
my $default_config = $my_default_config || $main_cf->{ default_config };
unshift(@cf, $default_config);
- # 3. reset @INC
- unshift(@INC, $main_cf->{ local_lib_dir }) if $main_cf->{ local_lib_dir };
- unshift(@INC, $main_cf->{ lib_dir }) if $main_cf->{ lib_dir };
+ # 3. reset @INC
+ unshift(@INC, split(/\s+/, $main_cf->{ local_lib_dir }));
+ unshift(@INC, split(/\s+/, $main_cf->{ lib_dir }));
# 4. inspect my mode from $0
use File::Basename;