Changeset 21797


Ignore:
Timestamp:
2010-03-16T17:23:20+13:00 (12 years ago)
Author:
oranfry
Message:

imrpoved cross-platform compatibility, stopped using compression for upload, upload logs even if products dont exist and fixed log names to include OS

Location:
other-projects/nightly-tasks/snapshot/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/snapshot/trunk/lib.pl

    r21774 r21797  
    9292    }
    9393
    94     if ( ! -d "$release_dir/products" ) {
    95         die "error: products directory doesn't exist, exiting. (Well, not that exciting, a bit of a downer really...)";
    96     }
    97 
    9894    #copy products to a temporary folder, giving them their new names
    9995        if ( ! -d "$release_dir/uploads" ) {
     
    10298    mkdir "$release_dir/uploads";
    10399
    104     @files = <$release_dir/products/*>;
     100    my @files;
     101    if ( -d "$release_dir/products" ) {
     102        @files = <$release_dir/products/*>;
     103    }
     104
    105105    push( @files, "$release_dir/$rk.out" );
    106106    for my $file ( @files ) {
     
    115115        system( "cp '$file' '$release_dir/uploads/$filename'" );
    116116    }
    117     my $command = "cd $release_dir/uploads && tar -cz * | ";
     117    my $command = "cd $release_dir/uploads && tar -c * | ";
    118118    $command .= ($^O eq "MSWin32" ? "putty" : "ssh");
    119119    $command .= " -i '$ENV{'IDENTITY_FILE'}' nzdl\@puka.cs.waikato.ac.nz";
    120     #system("$command");
    121120    print "$command\n";
     121    system("$command");
    122122}
  • other-projects/nightly-tasks/snapshot/trunk/task.pl

    r21774 r21797  
    6262}
    6363
     64#keep wget/curl base command in a variable
     65my $httpRetrieve = $^O eq "darwin" ? "curl" : "wget -O -";
     66
    6467#setup based on mode
    6568if ( $ENV{'TASK_NAME'} =~ "caveat\$" ) {
     
    6770
    6871    if ( $major_version == 2 ) {
    69         $ENV{'snapshot_id2'} = `wget -O - http://www.greenstone.org/next-release.txt`;
     72        $ENV{'snapshot_id2'} = `$httpRetrieve http://www.greenstone.org/next-release.txt`;
    7073        chomp($ENV{'snapshot_id2'});
    7174    } else {
    72         $ENV{'snapshot_id3'} = `wget -O - http://www.greenstone.org/next-release-greenstone3.txt`;
     75        $ENV{'snapshot_id3'} = `$httpRetrieve http://www.greenstone.org/next-release-greenstone3.txt`;
    7376        chomp($ENV{'snapshot_id3'});
    7477    }
     
    122125
    123126#always rename the log not to clash with other files on puka
    124 $ENV{'munges'} = $ENV{'munges'} . " s/\.out/-" . get_date() . "-log.txt/";
     127$ENV{'munges'} = $ENV{'munges'} . " s/\.out/-" . get_date() . "-" . $^O . "-log.txt/";
    125128
    126129#choose a snapshot ID
Note: See TracChangeset for help on using the changeset viewer.