Skip to content
Snippets Groups Projects
Commit 6f9fa4a2 authored by Mark Harrison's avatar Mark Harrison
Browse files

Adding a SIMPLESVN subversion check for use on bluestreak servers that has

fewer requirements than the FRESHSVN module.


git-svn-id: https://labs.omniti.com/resmon/trunk@100 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
parent abab5d63
No related branches found
No related tags found
No related merge requests found
package Resmon::Module::SIMPLESVN;
use Resmon::ExtComm qw/cache_command/;
use vars qw/@ISA/;
@ISA = qw/Resmon::Module/;
# A 'simple' subversion checkout freshness check. Unlike FRESHSVN, this check
# doesn't have a grace period, nor does it check for the correct URL being
# checked out. Because of this, this module can be used with an older version
# of subversion that doesn't have support for 'svn info' on remote URLs.
#
# Example config:
#
# SIMPLESVN {
# /path/to/working/copy : noop
# }
sub handler {
my $arg = shift;
my $os = $arg->fresh_status();
return $os if $os;
my $wc = $arg->{'object'};
my $output = cache_command("svn st -u -q $wc", 60);
my @lines = grep { $_ !~ /^\?/ } split(/\n/, $output);
my $status = scalar(@lines)>1 ? "BAD" : "OK";
my $revision = 0;
if($lines[-1] =~ /^Status against revision:\s+(\d+)/) {
$revision = $1;
}
return $status, "rev:$revision";
}
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment