Changeset 136 for devel


Ignore:
Timestamp:
Sep 12, 2007, 3:09:02 AM (12 years ago)
Author:
bruno
Message:

Again lots of various fixes for VM support (close)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r132 r136  
    117117    pb_cms2build();
    118118    pb_build2vm();
    119 } elsif ($action =~ /^cms2ssh$/) {
    120     pb_cms2build();
    121     pb_build2vm();
    122     pb_build2ssh();
    123     pb_pkg2ssh();
    124119} elsif ($action =~ /^clean$/) {
    125120} else {
     
    338333                }
    339334            }
    340             $made="$made $ENV{'PBBUILDDIR'}/RPMS/*/$pbpkg-$pbver-$pbtag$pbsuf.*.rpm $ENV{'PBBUILDDIR'}/SRPMS/$pbpkg-$pbver-$pbtag$pbsuf.src.rpm";
     335            $made="$made RPMS/*/$pbpkg-$pbver-$pbtag$pbsuf.*.rpm SRPMS/$pbpkg-$pbver-$pbtag$pbsuf.src.rpm";
    341336        } elsif ($dtype eq "deb") {
    342             my $tmp = "$ENV{'PBBUILDDIR'}/$pbpkg";
    343             $made="$made $tmp"."_*.deb $tmp"."_*.dsc $tmp"."_*.tar.gz";
     337            $made="$made $pbpkg"."_*.deb $pbpkg"."_*.dsc $pbpkg"."_*.tar.gz";
    344338        } elsif ($dtype eq "ebuild") {
    345             $made="$made $ENV{'PBBUILDDIR'}/portage/*/$pbpkg/$pbpkg-$pbver.ebuild";
     339            $made="$made portage/*/$pbpkg/$pbpkg-$pbver.ebuild";
    346340            pb_mkdir_p("$ENV{'PBBUILDDIR'}/portage") if (! -d "$ENV{'PBBUILDDIR'}/portage");
    347341        } elsif ($dtype eq "slackware") {
    348             $made="$made $ENV{'PBBUILDDIR'}/build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz";
     342            $made="$made build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz";
    349343            pb_mkdir_p("$ENV{'PBBUILDDIR'}/install") if (! -d "$ENV{'PBBUILDDIR'}/install");
    350344        } else {
     
    381375    @pkgs = @$ptr;
    382376
    383     # Get the running distro to build on
     377    # Get the running distro to consider
    384378    my ($odir,$over) = (undef, undef);
    385379    if (defined $vm) {
     
    431425    my $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshhost->{$ENV{'PBPROJ'}}";
    432426    my $tdir;
     427    my $bdir;
    433428    if ($cmt eq "Sources") {
    434429        $tdir = "$sshdir->{$ENV{'PBPROJ'}}/src";
    435430    } elsif ($cmt eq "VMs") {
    436         $tdir = dirname("$sshdir->{$ENV{'PBPROJ'}}");
     431        $tdir = dirname("$sshdir->{$ENV{'PBPROJ'}}")."/delivery";
     432        $bdir = dirname("$sshdir->{$ENV{'PBPROJ'}}")."/build";
     433        # Remove a potential $ENV{'HOME'} as bdir should be relative to pb's home
     434        $bdir =~ s|\$ENV.+\}/||;
    437435    } elsif ($cmt eq "Packages") {
    438436        $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$ddir/$dver";
     
    440438        return;
    441439    }
    442     # Remove a potential $ENV{'HOME'} as tdir shold be relative to pb's home
     440    # Remove a potential $ENV{'HOME'} as tdir should be relative to pb's home
    443441    $tdir =~ s|\$ENV.+\}/||;
    444442
    445443    $port = $sshport->{$ENV{'PBPROJ'}};
    446     pb_system("ssh -q -p $port $mac \"mkdir -p $tdir/delivery ; cd $tdir/delivery ; rm -f $basesrc\"","Preparing $tdir on $mac");
    447     pb_system("scp -p -P $port $src $mac:$tdir/delivery","$cmt delivery in $tdir on $mac");
    448     pb_system("ssh -q -p $port $mac \"echo \'cd $tdir/delivery ; if [ -f pbscript ]; then ./pbscript; fi\' | bash\"","Executing pbscript on $mac  if needed");
     444    pb_system("ssh -q -p $port $mac \"mkdir -p $tdir ; cd $tdir ; rm -f $basesrc\"","Preparing $tdir on $mac");
     445    pb_system("cd $ENV{'PBBUILDDIR'} ; scp -p -P $port $src $mac:$tdir 2> /dev/null","$cmt delivery in $tdir on $mac");
     446    pb_system("ssh -q -p $port $mac \"echo \'cd $tdir ; if [ -f pbscript ]; then ./pbscript; fi\' | bash\"","Executing pbscript on $mac  if needed");
    449447    if ($cmt eq "VMs") {
    450448        # Get back info on pkg produced, compute their name and get them from the VM
    451         pb_system("scp -p -P $port $mac:$tdir/delivery/pbgen-$pbprojver-$pbprojtag $ENV{'PBBUILDDIR'}","Get package names in $tdir on $mac");
     449        pb_system("scp -p -P $port $mac:$bdir/pbgen-$pbprojver-$pbprojtag $ENV{'PBBUILDDIR'} 2> /dev/null","Get package names in $tdir on $mac");
    452450        open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
    453451        my $src = <KEEP>;
     
    455453        close(KEEP);
    456454        $src =~ s/^ *//;
    457         $src =~ s/ +/,/g;
    458         pb_system("scp -p -P $port $mac:$tdir/delivery/{$src} $ENV{'PBBUILDDIR'}/$odir/$over","Package recovery of in $tdir from $mac");
    459         #pb_system("ssh -q -p $port $mac \"rm -rf $tdir ; sido /usr/bin/poweroff\"","VM cleanup and halt on $mac");
     455        pb_mkdir_p("$ENV{'PBBUILDDIR'}/$odir/$over");
     456        foreach my $p (split(/ +/,$src)) {
     457            pb_system("scp -p -P $port $mac:\'$bdir/$p\' $ENV{'PBBUILDDIR'}/$odir/$over 2> /dev/null","Package recovery of ".basename($p)." in $tdir from $mac");
     458        }
     459        #pb_system("ssh -q -p $port $mac \"rm -rf dirname("$sshdir->{$ENV{'PBPROJ'}}"); sudo /usr/bin/poweroff\"","VM cleanup and halt on $mac");
    460460        pb_send2ssh("Packages","$odir"."_"."$over");
    461461        pb_rm_rf("$ENV{'PBBUILDDIR'}/$odir");
     
    611611    print "\n";
    612612    print "-m machine : Name of the virtual Machines you want\n";
    613     print "             to build on (space separated)        \n";
     613    print "             to build on (space separated). All if none precised\n";
    614614    print "             (or use the env variable PBVM)       \n";
    615615    print "\n";
     
    628628    print "\n";
    629629    print "\tbuild2pkg: Create packages for your running distribution  \n";
    630     print "\t           first parameter is version-tag to build\n";
    631     print "\t           if not using default version-tag\n";
    632     print "\t           following parameters are packages to build\n";
    633     print "\t           if not using default list\n";
    634630    print "\n";
    635631    print "\tbuild2ssh: Send the tar files to a SSH host               \n";
     
    639635    print "\tcms2pkg:   cms2build + build2pkg\n";
    640636    print "\n";
    641 }
     637    print "\tbuild2vm:  Create packages in a Virtual Machine  \n";
     638    print "\t           adn send them to a SSH host once built\n";
     639    print "\t           VM supported are QEMU                 \n";
     640    print "\n";
     641    print "\tcms2vm:    cms2build + build2vm\n";
     642    print "\n";
     643}
Note: See TracChangeset for help on using the changeset viewer.