Changeset 4c788be307a22be6ece43323924f27eac69076a8

Show
Ignore:
Timestamp:
05/07/08 18:52:52 (10 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1210186372 +0000
git-parent:

[0a62b9d10a84e3d01f92c00a81af4f2e663a7af5]

git-author:
Mark Harrison <mark@omniti.com> 1210186372 +0000
Message:

Fixed freshsvn module to not use a hardcoded path for the svn binary and try
to locate it using code similar to the dns update-helper.sh script.

git-svn-id: https://labs.omniti.com/resmon/trunk@83 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Module/FRESHSVN.pm

    rf57f044 r4c788be  
    33use Resmon::ExtComm qw/cache_command/; 
    44use vars qw/@ISA/; 
     5use File::Find; 
     6 
    57@ISA = qw/Resmon::Module/; 
    68 
    79sub handler { 
     10  # Find location of subversion binary 
     11  my $svn = 'svn'; 
     12  for my $path (qw(/usr/local/bin /opt/omni/bin)) { 
     13    if (-x "$path/svn") { 
     14      $svn = "$path/svn"; 
     15      last; 
     16    } 
     17  } 
     18 
    819  my $arg = shift; 
    920  my $os = $arg->fresh_status(); 
    1021  return $os if $os; 
    1122  my $dir = $arg->{'object'}; 
    12   my $moutput = cache_command("/opt/omni/bin/svn info $dir", 60); 
     23  my $moutput = cache_command("$svn info $dir", 60); 
    1324  my @mlines = split (/\n/,$moutput); 
    1425  my ($URL,$mr); 
     
    1829  } 
    1930  return ($arg->set_status("BAD(wrong URL, in conf:".$arg->{'URL'}.", checked out: $URL)")) if ($URL ne $arg->{'URL'}); 
    20   my $uoutput = cache_command("/opt/omni/bin/svn info --username svnsync --password Athi3izo  --no-auth-cache --non-interactive $URL", 60); 
     31  my $uoutput = cache_command("$svn info --username svnsync --password Athi3izo  --no-auth-cache --non-interactive $URL", 60); 
    2132  my @ulines = split (/\n/,$uoutput); 
    2233  my ($ur);