Changeset 1216 in ProjectBuilder for devel/pb/bin


Ignore:
Timestamp:
Feb 24, 2011, 1:51:30 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • rmntpcmd, vmhost, vmmem, vmntpcmd and vmsize have OS keys and not project keys. Fixed in doc and code.
  • Document [web]sshdir|port|login|host
  • pb_date2v needs the pbos as param to deal with *ntpcmd correctly. $v param removed as a consequence.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1215 r1216  
    16171617        ($vtmout) = pb_conf_get($tmout);
    16181618    }
    1619     my $sshmachine = $sshhost->{$ENV{'PBPROJ'}};
    1620     if ($cmt =~ /^RM/) {
    1621         # In that case our real host is in the rmhost with the OS as key, not project as above
    1622         $sshmachine = pb_distro_get_param($pbos,$sshhost);
    1623     }
    1624     pb_log(2,"ssh: ".Dumper(($sshhost,$sshlogin,$sshdir,$sshport,$vtmout,$vepath,$rbsconf))."\n");
     1619    my $remhost = $sshhost->{$ENV{'PBPROJ'}};
     1620    my $remdir = $sshdir->{$ENV{'PBPROJ'}};
     1621    if ($cmt =~ /^V[EM]|RM/) {
     1622        # In that case our real host is in the xxhost with the OS as key, not project as above
     1623        $remhost = pb_distro_get_param($pbos,$sshhost);
     1624    }
     1625    pb_log(2,"ssh: ".Dumper(($remhost,$sshlogin,$remdir,$sshport,$vtmout,$vepath,$rbsconf))."\n");
    16251626
    16261627    my $mac;
    16271628    if ($cmt !~ /^VE/) {
    1628         $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshmachine";
     1629        $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$remhost";
    16291630        # Overwrite account value if passed as parameter
    1630         $mac = "$pbaccount\@$sshmachine" if (defined $pbaccount);
     1631        $mac = "$pbaccount\@$remhost" if (defined $pbaccount);
    16311632        pb_log(2, "DEBUG: pbaccount: $pbaccount => mac: $mac\n") if (defined $pbaccount);
    16321633    } else {
     
    16401641    my $bdir;
    16411642    if (($cmt eq "Sources") || ($cmt =~ /(V[EM]|RM)Script/)) {
    1642         $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/src";
     1643        $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/src";
    16431644    } elsif ($cmt =~ /(V[EM]|RM)(build|test)/) {
    1644         $tdir = $sshdir->{$ENV{'PBPROJ'}}."/$ENV{'PBPROJ'}/delivery";
    1645         $bdir = $sshdir->{$ENV{'PBPROJ'}}."/$ENV{'PBPROJ'}/build";
     1645        $tdir = $remdir."/$ENV{'PBPROJ'}/delivery";
     1646        $bdir = $remdir."/$ENV{'PBPROJ'}/build";
    16461647        # Remove a potential $ENV{'HOME'} as bdir should be relative to pb's home
    16471648        $bdir =~ s|\$ENV.+\}/||;
    16481649    } elsif ($cmt eq "Announce") {
    1649         $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}";
     1650        $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}";
    16501651    } elsif ($cmt eq "Web") {
    1651         $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}";
     1652        $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}";
    16521653    } elsif ($cmt eq "Packages") {
    16531654        if (($pbos->{'type'} eq "rpm") || ($pbos->{'type'} eq "pkg") || ($pbos->{'type'} eq "hpux") || ($pbos->{'type'} eq "tgz")) {
    16541655            # put packages under an arch subdir
    1655             $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";
     1656            $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";
    16561657        } elsif (($pbos->{'type'} eq "deb") || ($pbos->{'type'} eq "ebuild")) {
    16571658            # No need for an arch subdir
    1658             $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}";
     1659            $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}";
    16591660        } else {
    16601661            die "Please teach the dev team where to deliver ($pbos->{'type'} type of packages\n";
     
    16621663
    16631664        my $repodir = $tdir;
    1664         $repodir =~ s|^$sshdir->{$ENV{'PBPROJ'}}/||;
     1665        $repodir =~ s|^$remdir/||;
    16651666
    16661667        my ($pbrepo) = pb_conf_get("pbrepo");
     
    18451846    my $tm = undef;
    18461847    if ($cmt =~ /^(V|R)M/) {
    1847         $tm = $vtmout->{$ENV{'PBPROJ'}};
     1848        $tm = $vtmout->{$v};
    18481849    }
    18491850
     
    21682169                if (($vmtype eq "qemu") || ($vmtype eq "xen") || ($vmtype eq "kvm")) {
    21692170                    my $command = pb_check_req("qemu-img",0);
    2170                     pb_system("$command create -f qcow2 $vmm $vmsize->{$ENV{'PBPROJ'}}","Creating the QEMU VM");
     2171                    pb_system("$command create -f qcow2 $vmm $vmsize->{$v}","Creating the QEMU VM");
    21712172                } elsif ($vmtype eq "vmware") {
    21722173                } else {
     
    23882389
    23892390my $vtype = shift;
    2390 my $v = shift;
     2391my $pbos = shift;
    23912392
    23922393my ($ntp) = pb_conf_get_if($vtype."ntp");
     
    23952396
    23962397if (defined $vntp) {
    2397     my ($ntpcmd) = pb_conf_get($vtype."ntpcmd");
     2398    my ($ntpcmd) = pb_distro_get_param($pbos,pb_conf_get($vtype."ntpcmd"));
    23982399    my $vntpcmd;
    2399     if (defined $ntpcmd->{$v}) {
    2400         $vntpcmd = $ntpcmd->{$v};
     2400    if (defined $ntpcmd->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"}) {
     2401        $vntpcmd = $ntpcmd->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"};
    24012402    } elsif (defined $ntpcmd->{$ENV{'PBPROJ'}}) {
    24022403        $vntpcmd = $ntpcmd->{$ENV{'PBPROJ'}};
     
    24822483    }
    24832484
    2484     my $ntpline = pb_date2v($vtype,$v);
     2485    # Get distro context
     2486    my $pbos = pb_distro_get_context($v);
     2487   
     2488    my $ntpline = pb_date2v($vtype,$pbos);
    24852489    print SCRIPT "# Time sync\n";
    24862490    print SCRIPT "echo 'setting up date with '";
     
    27262730    $pm->start($counter) and next if (defined $pbparallel);
    27272731
    2728     # Deal with date sync.
    2729     my $ntpline = pb_date2v($vtype,$v);
    2730 
    27312732    # Get distro context
    27322733    my $pbos = pb_distro_get_context($v);
    27332734   
     2735    # Deal with date sync.
     2736    my $ntpline = pb_date2v($vtype,$pbos);
     2737
    27342738    # Name of the account to deal with for VM/VE/RM
    27352739    # Do not use the one passed potentially with -a
Note: See TracChangeset for help on using the changeset viewer.