Changeset 435


Ignore:
Timestamp:
05/11/08 23:54:06 (5 years ago)
Author:
bruno
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r434 r435  
    484484        pb_cms_export($uri,"$ENV{'PBDIR'}/$dir",$dest); 
    485485 
    486         # Get project info on authors and log file 
    487         my $chglog = "$ENV{'PBROOTDIR'}/$pbpkg/pbcl"; 
    488         $chglog = "$ENV{'PBROOTDIR'}/pbcl" if (! -f $chglog); 
    489         $chglog = undef if (! -f $chglog); 
    490  
    491         my $authors = "$ENV{'PBROOTDIR'}/$pbpkg/pbauthors"; 
    492         $authors = "$ENV{'PBROOTDIR'}/pbauthors" if (! -f $authors); 
    493         $authors = "/dev/null" if (! -f $authors); 
    494  
    495         # Extract cms log history and store it 
    496         if ((defined $chglog) && (! -f "$dest/NEWS")) { 
    497             pb_log(2,"Generating NEWS file from $chglog\n"); 
    498             copy($chglog,"$dest/NEWS") || die "Unable to create $dest/NEWS"; 
    499         } 
    500         pb_cms_log($scheme,"$ENV{'PBDIR'}/$dir",$dest,$chglog,$authors); 
     486        # Generated fake content for test versions to speed up stuff 
     487        my ($testver) = pb_conf_get_if("testver"); 
     488        my $chglog; 
     489 
     490        if ((defined $testver) && (defined $testver->{$ENV{'PBPROJ'}}) && ($testver->{$ENV{'PBPROJ'}} =~ /true/i)) { 
     491            if (! -f "$dest/NEWS") { 
     492                open(NEWS,"> $dest/NEWS") || die "Unable to create $dest/NEWS"; 
     493                close(NEWS); 
     494            } 
     495            open(CL,"> $dest/ChangeLog") || die "Unable to create $dest/ChangeLog"; 
     496            close(CL); 
     497            open(CL,"> $dest/$ENV{'PBCMSLOGFILE'}") || die "Unable to create $dest/$ENV{'PBCMSLOGFILE'}"; 
     498            close(CL); 
     499            $chglog = undef; 
     500        } else { 
     501 
     502            # Get project info on authors and log file 
     503            $chglog = "$ENV{'PBROOTDIR'}/$pbpkg/pbcl"; 
     504            $chglog = "$ENV{'PBROOTDIR'}/pbcl" if (! -f $chglog); 
     505            $chglog = undef if (! -f $chglog); 
     506 
     507            my $authors = "$ENV{'PBROOTDIR'}/$pbpkg/pbauthors"; 
     508            $authors = "$ENV{'PBROOTDIR'}/pbauthors" if (! -f $authors); 
     509            $authors = "/dev/null" if (! -f $authors); 
     510 
     511            # Extract cms log history and store it 
     512            if ((defined $chglog) && (! -f "$dest/NEWS")) { 
     513                pb_log(2,"Generating NEWS file from $chglog\n"); 
     514                copy($chglog,"$dest/NEWS") || die "Unable to create $dest/NEWS"; 
     515            } 
     516            pb_cms_log($scheme,"$ENV{'PBDIR'}/$dir",$dest,$chglog,$authors); 
     517        } 
    501518 
    502519        my %build; 
    503  
    504520        my @pt; 
     521        my $tmpl = ""; 
     522 
    505523        @pt = pb_conf_get_if("vmlist","velist"); 
    506         my $tmpl = ""; 
    507524        if (defined $pt[0]->{$ENV{'PBPROJ'}}) { 
    508525            $tmpl .= $pt[0]->{$ENV{'PBPROJ'}}; 
     
    689706            # For gentoo we need to take pb as subsystem name 
    690707            # We put every apps here under sys-apps. hope it's correct 
    691             # We use pb's home dir in order o have a single OVERLAY line 
     708            # We use pb's home dir in order to have a single OVERLAY line 
    692709            my $tmpd = "$ENV{'HOME'}/portage/pb/sys-apps/$pbpkg"; 
    693710            pb_mkdir_p($tmpd) if (! -d "$tmpd"); 
     
    736753            $made="$made portage/pb/sys-apps/$pbpkg/$pbpkg-$pbver.ebuild"; 
    737754        } elsif ($dtype eq "slackware") { 
    738             $made="$made build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz"; 
    739             pb_mkdir_p("$ENV{'PBBUILDDIR'}/install") if (! -d "$ENV{'PBBUILDDIR'}/install"); 
     755            $made="$made $pbpkg/$pbpkg-$pbver-*-$pbtag.tgz"; 
     756 
     757            chdir "$ENV{'PBBUILDDIR'}" || die "Unable to chdir to $ENV{'PBBUILDDIR'}"; 
     758            pb_system("tar xfz $src","Extracting sources"); 
     759            chdir "$pbpkg-$pbver" || die "Unable to chdir to $pbpkg-$pbver"; 
     760            symlink "pbconf/$ddir-$dver","install" || die "Unable to symlink to pbconf/$ddir-$dver"; 
     761            if (-x "install/pbslack") { 
     762                pb_system("./install/pbslack","Building package"); 
     763                pb_system("sudo /sbin/makepkg -p -l y -c y $pbpkg","Packaging $pbpkg"); 
     764            } 
    740765        } else { 
    741766            die "Unknown dtype format $dtype"; 
     
    869894    if (($cmt eq "Sources") || ($cmt eq "Script")) { 
    870895        $tdir = "$sshdir->{$ENV{'PBPROJ'}}/src"; 
     896        if ((defined $testver) && (defined $testver->{$ENV{'PBPROJ'}}) && ($testver->{$ENV{'PBPROJ'}} =~ /true/i)) { 
     897            # This is a test pkg => target dir is under test 
     898            $tdir = "$sshdir->{$ENV{'PBPROJ'}}/test/src"; 
     899        } 
    871900    } elsif (($cmt eq "vm") || ($cmt eq "ve")) { 
    872901        $tdir = $sshdir->{$ENV{'PBPROJ'}}."/$ENV{'PBPROJ'}/delivery"; 
     
    951980    if ($cmt ne "ve") { 
    952981        my $keyfile = pb_ssh_get(0); 
    953         $shcmd = "ssh -i $keyfile -q -p $nport $mac"; 
    954         $cpcmd = "scp -i $keyfile -p -P $nport"; 
     982        $shcmd = "ssh -i $keyfile -q -o UserKnownHostsFile=/dev/null -p $nport $mac"; 
     983        $cpcmd = "scp -i $keyfile -p -o UserKnownHostsFile=/dev/null -P $nport"; 
    955984        $cptarget = "$mac:$tdir"; 
    956985        if ($cmt eq "vm") { 
     
    13621391        $key = "\Q$zero1"; 
    13631392 
    1364         pb_system("cat $keyfile.pub | ssh -q -p $nport -i $keyfile root\@$vmhost->{$ENV{'PBPROJ'}} \"mkdir -p .ssh ; chmod 700 .ssh ; cat >> .ssh/authorized_keys ; chmod 600 .ssh/authorized_keys\"","Copying local keys to $vtype. This will require the root password"); 
     1393        pb_system("cat $keyfile.pub | ssh -q -o UserKnownHostsFile=/dev/null -p $nport -i $keyfile root\@$vmhost->{$ENV{'PBPROJ'}} \"mkdir -p .ssh ; chmod 700 .ssh ; cat >> .ssh/authorized_keys ; chmod 600 .ssh/authorized_keys\"","Copying local keys to $vtype. This will require the root password"); 
    13651394        # once this is done, we can do what we want on the VM remotely 
    13661395    } 
Note: See TracChangeset for help on using the changeset viewer.