Changeset 4166e2036e68c43be4f3cb344a12336fa249d728

Show
Ignore:
Timestamp:
11/13/07 19:56:05 (6 years ago)
Author:
Sergey Ivanov <seriv@omniti.com>
git-committer:
Sergey Ivanov <seriv@omniti.com> 1194983765 +0000
git-parent:

[f808515669a647d9cf2ff36891b3c05b309c1751]

git-author:
Sergey Ivanov <seriv@omniti.com> 1194983765 +0000
Message:

fixes

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

Files:

Legend:

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

    rf808515 r4166e20  
    1111  my $dir = $arg->{'object'}; 
    1212  my $moutput = cache_command("/opt/omni/bin/svn info $dir", 60); 
    13   my @molines = split (/\n/,$moutput); 
    14   my ($URL,$mr,$mY,$mM,$mD,$mh,$mm,$ms); 
    15   for(@molines) { 
     13  my @mlines = split (/\n/,$moutput); 
     14  my ($URL,$mr); 
     15  for(@mlines) { 
    1616    if (/^URL:\s*(.*)$/) { $URL=$1; } 
    17     elsif (/^Last Changed Rev:\s*(\d+)/) { $mr = $1; } 
    18     elsif (/^Last Changed Date:\s*(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{2}):(\d{2})/) { 
    19       ($mY,$mM,$mD,$mh,$mm,$ms) = ($1,$2,$3,$4,$5,$6); 
    20     } 
     17    elsif (/^Revision:\s*(\d+)/) { $mr = $1; } 
    2118  } 
    2219  return ($arg->set_status("BAD(wrong URL, in conf:".$arg->{'URL'}.", checked out: $URL)")) if ($URL ne $arg->{'URL'}); 
    23   my $uoutput = cache_command("/opt/omni/bin/svn info --username svnsync --password Athi3izo  --no-auth-cache --non-interactive $arg->{'URL'} 2>&1 ", 60); 
     20  my $uoutput = cache_command("/opt/omni/bin/svn info --username svnsync --password Athi3izo  --no-auth-cache --non-interactive $URL", 60); 
    2421  my @ulines = split (/\n/,$uoutput); 
    25   my ($ur,$uY,$uM,$uD,$uh,$um,$us); 
     22  my ($ur); 
    2623  for(@ulines) { 
    27     if (/^Last Changed Rev:\s*(\d+)/) { $ur = $1; } 
    28     elsif (/^Last Changed Date:\s*(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{2}):(\d{2})/) { 
    29       ($uY,$uM,$uD,$uh,$um,$us) = ($1,$2,$3,$4,$5,$6); 
    30     } 
     24    if (/^Revision:\s*(\d+)/) { $ur = $1; } 
    3125  } 
    3226  if($ur == $mr){ return($arg->set_status("OK(rev:$ur)")); } 
    3327  else{ 
     28    my ($uY,$uM,$uD,$uh,$um,$us); 
     29    for(@ulines) { 
     30      if (/^Last Changed Date:\s*(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{2}):(\d{2})/) { 
     31        ($uY,$uM,$uD,$uh,$um,$us) = ($1,$2,$3,$4,$5,$6); 
     32         print; 
     33      } 
     34    } 
     35    my $routput = cache_command("/opt/omni/bin/svn info --username svnsync --password Athi3izo  --no-auth-cache --non-interactive $URL\@$mr", 60); 
     36    my @rlines = split (/\n/,$routput); 
     37    my ($mY,$mM,$mD,$mh,$mm,$ms); 
     38    for(@rlines) { 
     39       if (/^Last Changed Date:\s*(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{2}):(\d{2})/) { 
     40         ($mY,$mM,$mD,$mh,$mm,$ms) = ($1,$2,$3,$4,$5,$6); 
     41         print; 
     42       } 
     43    } 
    3444    my ($mTime,$uTime,$lag,$maxlag); 
    3545    $mTime=$ms+60*($mm+60*($mh+24*($mD+31*($mM+12*$mY))));