Changeset 479 for devel/pb/bin/pb


Ignore:
Timestamp:
Jun 5, 2008, 5:04:41 PM (12 years ago)
Author:
Bruno Cornec
Message:

Allows pbcl files to not have info on the new version and add it on the fly for newver action

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r477 r479  
    13371337    my $oldver= basename($tmp);
    13381338
    1339     # Checking pbcl files
    1340     foreach my $f (<$ENV{'PBROOTDIR'}/*/pbcl>) {
    1341         open(PBCL,$f) || die "Unable to open $f";
    1342         my $foundnew = 0;
    1343         while (<PBCL>) {
    1344             $foundnew = 1 if (/^$newver \(/);
    1345         }
    1346         close(PBCL);
    1347         die "ERROR: version $newver not found in $f" if ($foundnew == 0);
    1348     }
    1349 
    13501339    # Duplicate and extract project-builder part
    13511340    pb_log(2,"Copying $uri/$tmp to $newurl\n");
     
    13751364    close(OUT);
    13761365    rename("$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new","$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb");
     1366
     1367    # Checking pbcl files
     1368    foreach my $f (<$ENV{'PBROOTDIR'}/*/pbcl>) {
     1369        open(PBCL,$f) || die "Unable to open $f";
     1370        my $foundnew = 0;
     1371        while (<PBCL>) {
     1372            $foundnew = 1 if (/^$newver \(/);
     1373        }
     1374        close(PBCL);
     1375        open(OUT,"> $f.new") || die "Unable to write to $f.new: $!";
     1376        open(PBCL,$f) || die "Unable to open $f";
     1377        while (<PBCL>) {
     1378            print OUT "$_"; if (not /^$oldver \(/);
     1379            if ((/^$oldver \(/) && ($foundnew == 0)) {
     1380                print OUT "$newver ($pbdate)\n";
     1381                print OUT "- TBD\n";
     1382                print OUT "\n";
     1383                pb_log(0,"WARNING: version $newver not found in $f so added..." if ($foundnew == 0);
     1384            }
     1385        }
     1386        close(OUT);
     1387        close(PBCL);
     1388        rename("$f.new","$f");
     1389    }
    13771390
    13781391    pb_log(2,"Checkin $ENV{'PBROOTDIR'}/../$newver\n");
Note: See TracChangeset for help on using the changeset viewer.