Changeset 27662

Show
Ignore:
Timestamp:
19.06.2013 16:37:22 (6 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed the dec regex problem and other regex issues.

Files:
1 modified

Legend:

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

    r27661 r27662  
    7171 
    7272    if ( $major_version == 2 ) { 
    73         $ENV{'snapshot_id2'} = `$httpRetrieve http://www.greenstone.org/next-release.txt`; 
     73            $ENV{'snapshot_id2'} = `$httpRetrieve http://www.greenstone.org/next-release.txt`; 
    7474        chomp($ENV{'snapshot_id2'}); 
    7575    } else { 
     
    7979     
    8080    #change the filenames to have the date in them 
    81     $ENV{'munges'} = "s/$ENV{'snapshot_id2'}/$ENV{'snapshot_id2'}-candidate-" . get_date() . "/g "; 
    82     $ENV{'munges'} .= "s/$ENV{'snapshot_id3'}/$ENV{'snapshot_id3'}-candidate-" . get_date() . "/g"; 
     81    my $id2 = $ENV{'snapshot_id2'}; 
     82    (my $id2re = $id2) =~ s@\.@\\.@g; #copy id2 and then change idre, see http://www.perlmonks.org/?node_id=366431 
     83 
     84    my $id3 = $ENV{'snapshot_id3'}; 
     85    (my $id3re = $id3) =~ s@\.@\\.@g; 
     86 
     87    $ENV{'munges'} = "s/-$id2re/-$id2-candidate-" . get_date() . "/g " if ($id2 =~ m/\S/); 
     88    $ENV{'munges'} .= "s/-$id3re/-$id3-candidate-" . get_date() . "/g" if ($id3 =~ m/\S/); 
     89 
    8390    # the above generates a list of regex. Have a \D (non-digit) prefixed to the value to be substituted, else 
    8491    # Greenstone-documented-examples-2013.06.18.tar.gz gets changed to Greenstone-documented-examples-2013.06-candidate-<daterepeat of 2013.06.18>.18.tar.gz 
     
    128135 
    129136#always rename the log not to clash with other files on puka 
    130 $ENV{'munges'} = $ENV{'munges'} . " s/\.out/-" . get_date() . "-" . $^O . "-log.txt/"; 
     137$ENV{'munges'} = $ENV{'munges'} . " s/\\.out\$/-" . get_date() . "-" . $^O . "-log.txt/"; 
    131138 
    132139#choose a snapshot ID