Changeset 1321

Show
Ignore:
Timestamp:
08/15/06 18:06:10
Author:
miyagawa
Message:

implemented get_current in smoker

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/tools/smoker.pl

    r1320 r1321  
    44use File::Path; 
    55use File::Temp qw(tempdir); 
     6use LWP::Simple; 
    67use YAML; 
    78 
     
    1011 
    1112my $config  = eval { YAML::LoadFile($file) } || {}; 
    12 my $current = get_current($repo)
     13my $current = get_current($repo) or die "Can't get Revision from $repo"
    1314 
    1415$config->{revision} ||= $current - 1; 
    1516 
    16 while ($config->{revision}++ <= $current) { 
     17my $run; 
     18while (++$config->{revision} <= $current) { 
    1719    run_chimps($config->{revision}); 
     20    $run++; 
    1821} 
    1922 
    20 YAML::DumpFile($file, $config); 
     23$config->{revision} = $current; 
     24YAML::DumpFile($file, $config) if $run; 
    2125 
    2226sub run_chimps { 
     
    4448    rmtree("$workdir/$checkout"); 
    4549} 
     50 
     51sub get_current { 
     52    my $repo = shift; 
     53    my $html = LWP::Simple::get($repo); 
     54    $html =~ /Revision (\d+):/ and return $1; 
     55    return; 
     56}