Debian Codegraph @

debian/patches/check_backuppc/use_nagios_plugins

raw
1 Index: pkg-nagios-plugins-contrib/check_backuppc/check_backuppc-1.1.0/check_backuppc
2 ===================================================================
3 --- pkg-nagios-plugins-contrib.orig/check_backuppc/check_backuppc-1.1.0/check_backuppc
4 +++ pkg-nagios-plugins-contrib/check_backuppc/check_backuppc-1.1.0/check_backuppc
5 @@ -32,7 +32,28 @@ no utf8;
6
7 # Nagios
8 use lib "NAGIOS_LIB";
9 -use utils qw(%ERRORS $TIMEOUT);
10 +sub load_module {
11 + my @names = @_;
12 + my $module;
13 + for my $name (@names) {
14 + my $file = $name;
15 + # requires need either a bare word or a file name
16 + $file =~ s{::}{/}gsxm;
17 + $file .= '.pm';
18 + eval {
19 + require $file;
20 + $name->import(qw(%ERRORS));
21 + $module = $name;
22 + };
23 + last if $module;
24 + }
25 + return $module;
26 +}
27 +
28 +my $plugin_module;
29 +BEGIN {
30 + $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
31 +}
32 use POSIX qw(strftime difftime);
33 use Getopt::Long;
34 Getopt::Long::Configure('bundling');