Changeset 14557
- Timestamp:
- 2007-09-22T16:15:53+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugout.pm
r13933 r14557 41 41 }; 42 42 43 #globaloptions contains any options that should be passed to all plug ins43 #globaloptions contains any options that should be passed to all plugouts 44 44 my ($verbosity, $outhandle, $failhandle, $globaloptions); 45 45 46 46 sub load_plugout{ 47 my ($plugout name,$plugout_options) =@_;47 my ($plugout) = shift @_; 48 48 49 49 my $colplugdir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugouts"); 50 unshift (@INC, $colplugdir); 51 50 unshift (@INC, $colplugdir); 51 52 my $plugoutname = shift @$plugout; 53 52 54 # find the plugout 53 my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugouts", 55 my $customplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "custom", $ENV{'GSDLCOLLECTION'}, 56 'perllib', 'plugouts', "${plugoutname}.pm"); 57 my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, 'perllib', 'plugouts', 54 58 "${plugoutname}.pm"); 55 my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'},"perllib/plugouts", 56 "${plugoutname}.pm"); 57 if (-e $colplugname) { require $colplugname; } 59 my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'}, 'perllib', 'plugouts', 60 "${plugoutname}.pm"); 61 if (-e $customplugname) { require $customplugname; } 62 elsif (-e $colplugname) { require $colplugname; } 58 63 elsif (-e $mainplugname) { require $mainplugname; } 59 64 else { 60 &gsprintf(STDERR, "{plugout.could_not_find_plugout}\n",65 gsprintf($outhandle, "{plugout.could_not_find_plugout}\n", 61 66 $plugoutname); 62 die "\n";67 die "\n"; 63 68 } 64 69 … … 66 71 my ($plugobj); 67 72 68 eval ("\$plugobj = new \$plugoutname([],\$plugout _options)");73 eval ("\$plugobj = new \$plugoutname([],\$plugout)"); 69 74 die "$@" if $@; 70 75
Note:
See TracChangeset
for help on using the changeset viewer.