Changeset 940 in ProjectBuilder


Ignore:
Timestamp:
Dec 18, 2009, 2:38:05 AM (14 years ago)
Author:
Bruno Cornec
Message:

Preliminary version of a Web site

Location:
devel
Files:
41 added
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r916 r940  
    535535
    536536    # declare packager and repo for filtering
     537    # TODO: Is pbrepo needed so early in the process ?
    537538    my ($tmp1, $tmp2) = pb_conf_get("pbpackager","pbrepo");
    538539    $ENV{'PBPACKAGER'} = $tmp1->{$ENV{'PBPROJ'}};
     
    16121613        die "-i iso parameter needed" if (((not defined $iso) || ($iso eq "")) && ($create != 0));
    16131614
     1615        # TODO: vmmonport should be optional
    16141616        my ($ptr,$vmpath,$vmport,$vmsize,$vmmonport) = pb_conf_get("vmtype","vmpath","vmport","vmsize","vmmonport");
    16151617        my ($vmopt,$vmtmout,$vmsnap) = pb_conf_get_if("vmopt","vmtmout","vmsnap");
     
    17211723        # Get VE context
    17221724        my ($ptr,$vetmout,$vepath,$verebuild,$veconf,$vepostinstall) = pb_conf_get("vetype","vetmout","vepath","verebuild","veconf");
    1723         my ($veb4pi,$vepi,$vepkglist,$vesnap) = pb_conf_get_if("veb4pi","vepi","vepkglist","vesnap");
     1725        my ($veb4pi,$vepi,$vesnap,$oscodename,$vepkglist,$osmindep) = pb_conf_get_if("veb4pi","vepi","vesnap","oscodename","vepkglist","osmindep");
    17241726        my $vetype = $ptr->{$ENV{'PBPROJ'}};
    17251727
     
    17351737            }
    17361738
    1737             my ($verpmtype) = pb_conf_get("verpmtype");
     1739            my ($verpmtype,$vedebtype) = pb_conf_get("verpmtype","vedebtype");
    17381740            if (($create != 0) || ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i) || ($pbforce == 1)) {
    17391741                # We have to rebuild the chroot
     
    17611763                        # Need to reshape the package list for pb
    17621764                        my $addpkgs;
    1763                         $postparam = pb_distro_get_param($ddir,$dver,$darch,$vepkglist);
     1765                        $postparam = "";
     1766                        $postparam .= pb_distro_get_param($ddir,$dver,$darch,$osmindep);
     1767                        $postparam .= ",";
     1768                        $postparam .= pb_distro_get_param($ddir,$dver,$darch,$vepkglist);
    17641769                        if ($postparam eq "") {
    17651770                            $addpkgs = "";
     
    17731778                            $addpkgs = "--add-pkg-list $pkgfile";
    17741779                        }
     1780
    17751781                        my $rinseverb = "";
    17761782                        $rinseverb = "--verbose" if ($pbdebug gt 0);
     
    17831789                    }
    17841790                } elsif ($dtype eq "deb") {
    1785                     pb_system("","Creating the pbuilder VE TBD");
     1791                    my $vedebstyle = pb_distro_get_param($ddir,$dver,$darch,$vedebtype);
     1792                    my $codename = pb_distro_get_param($ddir,$dver,$darch,$oscodename);
     1793                    my $postparam = "";
     1794                    my $addpkgs;
     1795                    $postparam .= pb_distro_get_param($ddir,$dver,$darch,$osmindep);
     1796                    $postparam .= ",";
     1797                    $postparam .= pb_distro_get_param($ddir,$dver,$darch,$vepkglist);
     1798                    if ($postparam eq "") {
     1799                        $addpkgs = "";
     1800                    } else {
     1801                        $addpkgs = "--include $postparam";
     1802                    }
     1803
     1804                    # debootstrap works with amd64 not x86_64
     1805                    $darch = "amd64" if ($darch eq "x86_64");
     1806                    if ($vedebstyle eq "debootstrap") {
     1807                        pb_system("sudo /usr/sbin/debootstrap --arch=$darch $codename \"$vepath->{$ENV{'PBPROJ'}}/$ddir/$dver/$darch\" $addpkgs","Creating the debootstrap VE for $ddir-$dver ($darch)", "verbose");
     1808                    }
    17861809                } elsif ($dtype eq "ebuild") {
    17871810                    die "Please teach the dev team how to build gentoo chroot";
     
    21732196        $key = "\Q$zero1";
    21742197
    2175         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 may require the root password");
     2198        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 ; if [ -x /usr/bin/chcon ]; then /usr/bin/chcon -Rt home_ssh_t .ssh 2> /dev/null; fi\"","Copying local keys to $vtype. This may require the root password");
    21762199        # once this is done, we can do what we want on the VM remotely
    21772200    } elsif ($vtype eq "ve") {
    21782201        # We need to finish the setup of packages needed in the VE if needed
    2179         # rinse at least needs it
    2180         my ($vepkglist) = pb_conf_get_if("vepkglist");
    2181 
     2202        # rinse/deboostrap at least needs it
     2203        my ($vepkglist,$osmindep) = pb_conf_get_if("vepkglist","osmindep");
     2204
     2205        my $postparam = "";
     2206        if (defined $osmindep) {
     2207            $postparam .= pb_distro_get_param($ddir,$dver,$darch,$osmindep);
     2208        }
    21822209        if (defined $vepkglist) {
    2183             my $postparam = pb_distro_get_param($ddir,$dver,$darch,$vepkglist);
    2184             # Change the list of pkg in to a space separated list
    2185             $postparam =~ s/,/ /g;
    2186             # remove potential sudo from the update command for this time,
    2187             # as this will be run as root anyway, and if not we will have
    2188             # a problem with tty
    2189             $pbupd =~ s/sudo //g;
    2190 
     2210            $postparam .= " ".pb_distro_get_param($ddir,$dver,$darch,$vepkglist);
     2211        }
     2212        # Change the list of pkg in to a space separated list
     2213        $postparam =~ s/,/ /g;
     2214        # remove potential sudo from the update command for this time,
     2215        # as this will be run as root anyway, and if not we will have
     2216        # a problem with tty
     2217        $pbupd =~ s/sudo //g;
     2218
     2219            print SCRIPT << "EOF";
     2220# For VE we need a good null dev
     2221pb_system("rm -f /dev/null; mknod /dev/null c 1 3; chmod 777 /dev/null");
     2222EOF
     2223        if ($postparam ne "") {
    21912224            print SCRIPT << "EOF";
    21922225# For VE we first need to mount some FS
    21932226pb_system("mount -t proc /proc /proc");
    2194 
    2195 # For VE we need a good null dev
    2196 pb_system("rm -f /dev/null; mknod /dev/null c 1 3; chmod 777 /dev/null");
    21972227
    21982228# For VE we need some additional packages that are not there yet
  • devel/pb/lib/ProjectBuilder/CMS.pm

    r896 r940  
    851851if ($scheme =~ /socks/) {
    852852    # Get the socks proxy command from the conf file
    853     my ($pbsockcmd) = pb_conf_get("pbsockscmd");
    854     $cmd = "$pbsockcmd->{$ENV{'PBPROJ'}} ";
     853    my ($pbsockscmd) = pb_conf_get("pbsockscmd");
     854    $cmd = "$pbsockscmd->{$ENV{'PBPROJ'}} ";
    855855}
    856856
Note: See TracChangeset for help on using the changeset viewer.