Changeset 1381 in ProjectBuilder for devel/pb/bin
- Timestamp:
- Dec 23, 2011, 3:50:34 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1374 r1381 2279 2279 # Always redirect the network and always try to use a 'pb' snapshot 2280 2280 #$cmd = "$vmcmd $ENV{'PBVMOPT'} -net user,hostfwd=tcp:$nport:10.0.2.15:22 -loadvm pb $vmm" 2281 $cmd = "$vmcmd $ENV{'PBVMOPT'} -redir tcp:$nport:10.0.2.15:22 -loadvm pb$vmm"2281 $cmd = "$vmcmd $ENV{'PBVMOPT'} -redir tcp:$nport:10.0.2.15:22 $vmm" 2282 2282 } elsif ($vmtype eq "xen") { 2283 2283 } elsif ($vmtype eq "vmware") { … … 2562 2562 # we want to get for the root of the new URL 2563 2563 2564 my $tmp = $ENV{'PBROOTDIR'}; 2565 $tmp =~ s|^$ENV{'PBCONFDIR'}||; 2566 2567 my $newurl = "$uri/".dirname($tmp)."/$newver"; 2564 my $oldver = $ENV{'PBROOTDIR'}; 2565 $oldver =~ s|^$ENV{'PBCONFDIR'}||; 2566 2567 pb_log(2, "PBCONFDIR: $ENV{'PBCONFDIR'}\nPBROOTDIR: $ENV{'PBROOTDIR'}\n"); 2568 2569 my $newurl = "$uri/$newver"; 2568 2570 # Should probably use projver in the old file 2569 my $oldver= basename($tmp); 2571 my $oldvertxt= basename($oldver); 2572 my $newvertxt = basename($newver); 2570 2573 2571 2574 # Duplicate and extract project-builder part 2572 pb_log(2,"Copying $uri/$ tmpto $newurl\n");2573 pb_cms_copy($scheme,"$uri/$ tmp",$newurl);2574 pb_log(2,"Checkout $newurl to $ENV{'PB ROOTDIR'}/../$newver\n");2575 pb_cms_up($scheme,"$ENV{'PBCONFDIR'} /..");2575 pb_log(2,"Copying $uri/$oldver to $newurl\n"); 2576 pb_cms_copy($scheme,"$uri/$oldver",$newurl); 2577 pb_log(2,"Checkout $newurl to $ENV{'PBCONFDIR'}/$newver\n"); 2578 pb_cms_up($scheme,"$ENV{'PBCONFDIR'}"); 2576 2579 2577 2580 # Duplicate and extract project 2578 my $newurl2 = "$pburl->{$ENV{'PBPROJ'}}/".dirname($tmp)."/$newver"; 2579 2580 pb_log(2,"Copying $pburl->{$ENV{'PBPROJ'}}/$tmp to $newurl2\n"); 2581 pb_cms_copy($scheme2,"$pburl->{$ENV{'PBPROJ'}}/$tmp",$newurl2); 2582 pb_log(2,"Checkout $newurl2 to $ENV{'PBDIR'}/../$newver\n"); 2583 pb_cms_up($scheme2,"$ENV{'PBDIR'}/.."); 2581 my $newurl2 = "$pburl->{$ENV{'PBPROJ'}}/$newver"; 2582 2583 pb_log(2,"Copying $pburl->{$ENV{'PBPROJ'}}/$oldver to $newurl2\n"); 2584 pb_cms_copy($scheme2,"$pburl->{$ENV{'PBPROJ'}}/$oldver",$newurl2); 2585 2586 my $tmp = $ENV{'PBDIR'}; 2587 $tmp =~ s|$oldver$||; 2588 pb_log(2,"Checkout $newurl2 to $tmp/$newver\n"); 2589 pb_cms_up($scheme2,"$tmp"); 2584 2590 2585 2591 # Update the .pb file 2586 open(FILE,"$ENV{'PB ROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb") || die "Unable to open $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb";2587 open(OUT,"> $ENV{'PB ROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new") || die "Unable to write to $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new";2592 open(FILE,"$ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb") || die "Unable to open $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb"; 2593 open(OUT,"> $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb.new") || die "Unable to write to $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb.new"; 2588 2594 while(<FILE>) { 2589 s/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldver/projver $ENV{'PBPROJ'} = $newver/; 2590 pb_log(0,"Changing projver from $oldver to $newver in $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb\n") if (/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldver/); 2591 pb_log(0,"Commenting testver in $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb\n") if (/^testver/); 2592 s/^testver/#testver/; 2595 if (/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldvertxt/) { 2596 s/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldvertxt/projver $ENV{'PBPROJ'} = $newvertxt/; 2597 pb_log(0,"Changing projver from $oldvertxt to $newvertxt in $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb\n"); 2598 } 2599 if (/^testver/) { 2600 s/^testver/#testver/; 2601 pb_log(0,"Commenting testver in $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb\n") if (/^testver/); 2602 } 2603 if (/^delivery/) { 2604 pb_log(0,"Please check delivery (".chomp($_).") in $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb\n"); 2605 } 2593 2606 print OUT $_; 2594 pb_log(0,"Please check delivery (".chomp($_).") in $ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb\n") if (/^delivery/);2595 2607 } 2596 2608 close(FILE); 2597 2609 close(OUT); 2598 rename("$ENV{'PB ROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb.new","$ENV{'PBROOTDIR'}/../$newver/$ENV{'PBPROJ'}.pb");2610 rename("$ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb.new","$ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.pb"); 2599 2611 2600 2612 # Checking pbcl files … … 2602 2614 # Compute new pbcl file 2603 2615 my $f2 = $f; 2604 $f2 =~ s|$ENV{'PBROOTDIR'}|$ENV{'PB ROOTDIR'}/../$newver/|;2616 $f2 =~ s|$ENV{'PBROOTDIR'}|$ENV{'PBCONFDIR'}/$newver/|; 2605 2617 open(PBCL,$f) || die "Unable to open $f"; 2606 2618 my $foundnew = 0; 2607 2619 while (<PBCL>) { 2608 $foundnew = 1 if (/^$newver \(/);2620 $foundnew = 1 if (/^$newvertxt \(/); 2609 2621 } 2610 2622 close(PBCL); … … 2612 2624 open(PBCL,$f) || die "Unable to open $f"; 2613 2625 while (<PBCL>) { 2614 print OUT "$_" if (not /^$oldver \(/);2615 if ((/^$oldver \(/) && ($foundnew == 0)) {2616 print OUT "$newver ($pbdate)\n";2626 print OUT "$_" if (not /^$oldvertxt \(/); 2627 if ((/^$oldvertxt \(/) && ($foundnew == 0)) { 2628 print OUT "$newvertxt ($pbdate)\n"; 2617 2629 print OUT "- TBD\n"; 2618 2630 print OUT "\n"; 2619 pb_log(0,"WARNING: version $newver not found in $f so added to $f2...\n") if ($foundnew == 0);2631 pb_log(0,"WARNING: version $newvertxt not found in $f so added to $f2...\n") if ($foundnew == 0); 2620 2632 } 2621 2633 } … … 2624 2636 } 2625 2637 2626 pb_log(2,"Checkin $ENV{'PB ROOTDIR'}/../$newver\n");2627 pb_cms_checkin($scheme,"$ENV{'PB ROOTDIR'}/../$newver",undef);2638 pb_log(2,"Checkin $ENV{'PBCONFDIR'}/$newver\n"); 2639 pb_cms_checkin($scheme,"$ENV{'PBCONFDIR'}/$newver",undef); 2628 2640 } 2629 2641
Note:
See TracChangeset
for help on using the changeset viewer.