r56279 - in /trunk/libnagios-plugin-perl: ./ debian/ debian/patches/ debian/source/ lib/Nagios/ lib/Nagios/Plugin/ t/

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Sat Apr 17 07:31:40 UTC 2010


Author: ansgar-guest
Date: Sat Apr 17 07:31:29 2010
New Revision: 56279

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56279
Log:
* New upstream release.
* Use source format 3.0 (quilt); drop README.source and quilt framework.
* debian/copyright: Minor formatting changes for current DEP-5 proposal.
* Use tiny debian/rules.
* Bump Standards-Version to 3.8.4.
* Add myself to Uploaders.

Added:
    trunk/libnagios-plugin-perl/debian/source/
    trunk/libnagios-plugin-perl/debian/source/format
Removed:
    trunk/libnagios-plugin-perl/debian/README.source
Modified:
    trunk/libnagios-plugin-perl/Changes
    trunk/libnagios-plugin-perl/META.yml
    trunk/libnagios-plugin-perl/debian/changelog
    trunk/libnagios-plugin-perl/debian/control
    trunk/libnagios-plugin-perl/debian/copyright
    trunk/libnagios-plugin-perl/debian/patches/fix-pod2man-errors
    trunk/libnagios-plugin-perl/debian/rules
    trunk/libnagios-plugin-perl/lib/Nagios/Plugin.pm
    trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Functions.pm
    trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Getopt.pm
    trunk/libnagios-plugin-perl/t/Nagios-Plugin-01.t

Modified: trunk/libnagios-plugin-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/Changes?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/Changes (original)
+++ trunk/libnagios-plugin-perl/Changes Sat Apr 17 07:31:29 2010
@@ -1,4 +1,9 @@
 Revision history for Perl module Nagios::Plugin.
+
+0.34 15th April 2010
+  - Amended standard --extra-opts help
+  - pod fix (Frank Wiegand - RT51872)
+  - Added %STATUS_TEXT to valid possible exports (Andrew Ford - RT46048)
 
 0.33 5th June 2009
   - Fixed infinite loop when invalid performance data with multiple = were present

Modified: trunk/libnagios-plugin-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/META.yml?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/META.yml (original)
+++ trunk/libnagios-plugin-perl/META.yml Sat Apr 17 07:31:29 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Nagios-Plugin
-version:            0.33
+version:            0.34
 abstract:           A family of perl modules to streamline writing Nagios 
 author:
     - Nagios Plugin Development Team <nagiosplug-devel at lists.sourceforge.net>
@@ -24,7 +24,7 @@
     directory:
         - t
         - inc
-generated_by:       ExtUtils::MakeMaker version 6.50
+generated_by:       ExtUtils::MakeMaker version 6.56
 meta-spec:
     url:      http://module-build.sourceforge.net/META-spec-v1.4.html
     version:  1.4

Modified: trunk/libnagios-plugin-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/debian/changelog?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/debian/changelog (original)
+++ trunk/libnagios-plugin-perl/debian/changelog Sat Apr 17 07:31:29 2010
@@ -1,4 +1,4 @@
-libnagios-plugin-perl (0.33-2) UNRELEASED; urgency=low
+libnagios-plugin-perl (0.34-1) unstable; urgency=low
 
   [ Nathan Handler ]
   * debian/watch: Update to ignore development releases.
@@ -11,7 +11,15 @@
   [ Ryan Niebur ]
   * Update ryan52's email address
 
- -- Ryan Niebur <ryan at debian.org>  Fri, 25 Sep 2009 00:25:41 -0700
+  [ Ansgar Burchardt ]
+  * New upstream release.
+  * Use source format 3.0 (quilt); drop README.source and quilt framework.
+  * debian/copyright: Minor formatting changes for current DEP-5 proposal.
+  * Use tiny debian/rules.
+  * Bump Standards-Version to 3.8.4.
+  * Add myself to Uploaders.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org>  Sat, 17 Apr 2010 16:26:11 +0900
 
 libnagios-plugin-perl (0.33-1) unstable; urgency=low
 

Modified: trunk/libnagios-plugin-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/debian/control?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/debian/control (original)
+++ trunk/libnagios-plugin-perl/debian/control Sat Apr 17 07:31:29 2010
@@ -1,12 +1,13 @@
 Source: libnagios-plugin-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7), quilt
+Build-Depends: debhelper (>= 7)
 Build-Depends-Indep: perl, libclass-accessor-perl,
   libparams-validate-perl, libconfig-tiny-perl, libmath-calc-units-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Ryan Niebur <ryan at debian.org>
-Standards-Version: 3.8.1
+Uploaders: Ryan Niebur <ryan at debian.org>,
+ Ansgar Burchardt <ansgar at 43-1.org>
+Standards-Version: 3.8.4
 Homepage: http://search.cpan.org/dist/Nagios-Plugin/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libnagios-plugin-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libnagios-plugin-perl/

Modified: trunk/libnagios-plugin-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/debian/copyright?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/debian/copyright (original)
+++ trunk/libnagios-plugin-perl/debian/copyright Sat Apr 17 07:31:29 2010
@@ -1,8 +1,7 @@
-Format-Specification:
-    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: Nagios Plugin development team (http://nagiosplug.sourceforge.net)
-Upstream-Source: http://search.cpan.org/dist/Nagios-Plugin/
-Upstream-Name: Nagios-Plugin
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Nagios Plugin development team (http://nagiosplug.sourceforge.net)
+Source: http://search.cpan.org/dist/Nagios-Plugin/
+Name: Nagios-Plugin
 
 Files: *
 Copyright: 2006, by Nagios Plugin Development Team

Modified: trunk/libnagios-plugin-perl/debian/patches/fix-pod2man-errors
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/debian/patches/fix-pod2man-errors?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/debian/patches/fix-pod2man-errors (original)
+++ trunk/libnagios-plugin-perl/debian/patches/fix-pod2man-errors Sat Apr 17 07:31:29 2010
@@ -1,8 +1,10 @@
-manpage-has-errors-from-pod2man
+From: Ryan Niebur <ryanryan52 at gmail.com>
+Subject: Fix POD error
+Forwarded: https://rt.cpan.org/Ticket/Display.html?id=56683
 
---- a/lib/Nagios/Plugin/Functions.pm
-+++ b/lib/Nagios/Plugin/Functions.pm
-@@ -388,6 +388,8 @@
+--- libnagios-plugin-perl.orig/lib/Nagios/Plugin/Functions.pm
++++ libnagios-plugin-perl/lib/Nagios/Plugin/Functions.pm
+@@ -392,6 +392,8 @@
  join the resultant critical, warning, and ok messages together i.e.
  all messages are joined and returned.
  

Modified: trunk/libnagios-plugin-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/debian/rules?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/debian/rules (original)
+++ trunk/libnagios-plugin-perl/debian/rules Sat Apr 17 07:31:29 2010
@@ -1,25 +1,3 @@
 #!/usr/bin/make -f
-
-include /usr/share/quilt/quilt.make
-
-build: build-stamp
-build-stamp: $(QUILT_STAMPFN)
-	dh build
-	touch $@
-
-clean: unpatch
+%:
 	dh $@
-
-install: install-stamp
-install-stamp: build-stamp
-	dh install
-	touch $@
-
-binary-arch:
-
-binary-indep: install
-	dh $@
-
-binary: binary-arch binary-indep
-
-.PHONY: binary binary-arch binary-indep install clean build

Added: trunk/libnagios-plugin-perl/debian/source/format
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/debian/source/format?rev=56279&op=file
==============================================================================
--- trunk/libnagios-plugin-perl/debian/source/format (added)
+++ trunk/libnagios-plugin-perl/debian/source/format Sat Apr 17 07:31:29 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)

Modified: trunk/libnagios-plugin-perl/lib/Nagios/Plugin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/lib/Nagios/Plugin.pm?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/lib/Nagios/Plugin.pm (original)
+++ trunk/libnagios-plugin-perl/lib/Nagios/Plugin.pm Sat Apr 17 07:31:29 2010
@@ -11,6 +11,7 @@
 use base qw(Class::Accessor::Fast);
 
 Nagios::Plugin->mk_accessors(qw(
+								shortname
 								perfdata 
 								messages 
 								opts
@@ -20,12 +21,12 @@
 use Exporter;
 our @ISA = qw(Exporter);
 our @EXPORT = (@STATUS_CODES);
-our @EXPORT_OK = qw(%ERRORS);
+our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT);
 
 # CPAN stupidly won't index this module without a literal $VERSION here,
 #   so we're forced to duplicate it explicitly
 # Make sure you update $Nagios::Plugin::Functions::VERSION too
-our $VERSION = "0.33";
+our $VERSION = "0.34";
 
 sub new {
 	my $class = shift;
@@ -45,11 +46,8 @@
 		},
 	);
 
-	my $shortname = undef;
-	if (exists $args{shortname}) {
-		$shortname = $args{shortname};
-		delete $args{shortname};
-	}
+	my $shortname = Nagios::Plugin::Functions::get_shortname(\%args);
+	delete $args{shortname} if (exists $args{shortname});
 	my $self = {
 		shortname => $shortname,
 		perfdata  => [],           # to be added later
@@ -104,14 +102,6 @@
 }
 sub max_state_alt {
     Nagios::Plugin::Functions::max_state_alt(@_);
-}
-
-# Override default shortname accessor to add default
-sub shortname {
-    my $self = shift;
-    $self->{shortname} = shift if @_;
-    return $self->{shortname} || 
-           Nagios::Plugin::Functions::get_shortname();
 }
 
 # top level interface to Nagios::Plugin::Threshold
@@ -254,7 +244,7 @@
    );
 
    # add valid command line options and build them into your usage/help documentation.
-   $p->add_arg(
+   $np->add_arg(
      spec => 'warning|w=s',
      help => '-w, --warning=INTEGER:INTEGER .  See '
        . 'http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT '
@@ -262,7 +252,7 @@
    );
 
    # Parse @ARGV and process standard arguments (e.g. usage, help, version)
-   $p->getopts;
+   $np->getopts;
 
 
    # Exit/return value methods - nagios_exit( CODE, MESSAGE ), 
@@ -517,7 +507,7 @@
 2. explicitly set by calling C<set_thresholds()> before C<check_threshold()>, or,
 
 3. implicitly set by command-line parameters -w, -c, --critical or
-   --warning, if you have run C<$plugin->getopts()>.
+   --warning, if you have run C<< $plugin->getopts() >>.
 
 The return value is ready to pass to C <nagios_exit>, e . g .,
 

Modified: trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Functions.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Functions.pm?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Functions.pm (original)
+++ trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Functions.pm Sat Apr 17 07:31:29 2010
@@ -12,7 +12,7 @@
 use Math::Calc::Units;
 
 # Remember to update Nagios::Plugins as well
-our $VERSION = "0.33";
+our $VERSION = "0.34";
 
 our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT);
 
@@ -54,12 +54,15 @@
 sub _use_die { @_ ? $_use_die = shift : $_use_die };
 
 sub get_shortname {
-    my %arg = @_;
-
-    return $arg{plugin}->shortname if $arg{plugin};
-
-    my $shortname = uc basename($ENV{NAGIOS_PLUGIN} || $0);
-    $shortname =~ s/^CHECK_//;     # Remove any leading CHECK_
+    my $arg = shift;
+
+    my $shortname = undef;
+
+    return $arg->{shortname} if (defined($arg->{shortname}));
+    $shortname = $arg->{plugin} if (defined( $arg->{plugin}));
+
+    $shortname = uc basename($shortname || $ENV{NAGIOS_PLUGIN} || $0);
+    $shortname =~ s/^CHECK_(?:BY_)?//;     # Remove any leading CHECK_[BY_]
     $shortname =~ s/\..*$//;       # Remove any trailing suffix
     return $shortname;
 }
@@ -116,7 +119,8 @@
     # Setup output
     my $output = "$STATUS_TEXT{$code}";
     $output .= " - $message" if defined $message && $message ne '';
-    my $shortname = get_shortname(plugin => $arg->{plugin});
+    my $shortname = ($arg->{plugin} ? $arg->{plugin}->shortname : undef);
+    $shortname ||= get_shortname(); # Should happen only if funnctions are called directly
     $output = "$shortname $output" if $shortname;
     if ($arg->{plugin}) {
         my $plugin = $arg->{plugin};
@@ -173,7 +177,7 @@
 
     # Else just assume $arg1 is the message and hope for the best
     else {
-        return nagios_exit( UNKNOWN, $arg1, $rest );
+        return nagios_exit( UNKNOWN, $arg1, $arg2 );
     }
 }
 

Modified: trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Getopt.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Getopt.pm?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Getopt.pm (original)
+++ trunk/libnagios-plugin-perl/lib/Nagios/Plugin/Getopt.pm Sat Apr 17 07:31:29 2010
@@ -38,7 +38,7 @@
     help => "-V, --version\n   Print version information",
   }, {
     spec => 'extra-opts:s@',
-    help => "--extra-opts=[<section>[@<config_file>]]\n   Section and/or config_file from which to load extra options (may repeat)",
+    help => "--extra-opts=[section][\@file]\n   Read options from an ini file. See http://nagiosplugins.org/extra-opts for usage",
   }, {
     spec => 'timeout|t=i',
     help => "-t, --timeout=INTEGER\n   Seconds before plugin times out (default: %s)",

Modified: trunk/libnagios-plugin-perl/t/Nagios-Plugin-01.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnagios-plugin-perl/t/Nagios-Plugin-01.t?rev=56279&op=diff
==============================================================================
--- trunk/libnagios-plugin-perl/t/Nagios-Plugin-01.t (original)
+++ trunk/libnagios-plugin-perl/t/Nagios-Plugin-01.t Sat Apr 17 07:31:29 2010
@@ -1,7 +1,7 @@
 # Nagios::Plugin original test cases
 
 use strict;
-use Test::More tests => 13;
+use Test::More tests => 15;
 
 BEGIN { use_ok('Nagios::Plugin') };
 
@@ -22,6 +22,12 @@
 
 $p = Nagios::Plugin->new( shortname => "SIZE", () );
 is($p->shortname, "SIZE", "shortname set correctly on new");
+
+$p = Nagios::Plugin->new( plugin => "check_stuff", () );
+is($p->shortname, "STUFF", "shortname uses plugin name as default");
+
+$p = Nagios::Plugin->new(  shortname => "SIZE", plugin => "check_stuff", () );
+is($p->shortname, "SIZE", "shortname is not overriden by default");
 
 diag "warn if < 10, critical if > 25 " if $ENV{TEST_VERBOSE};
 my $t = $p->set_thresholds( warning => "10:25", critical => "~:25" );




More information about the Pkg-perl-cvs-commits mailing list