Changeset 940 in ProjectBuilder
- Timestamp:
- Dec 18, 2009, 2:38:05 AM (15 years ago)
- Location:
- devel
- Files:
-
- 41 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r916 r940 535 535 536 536 # declare packager and repo for filtering 537 # TODO: Is pbrepo needed so early in the process ? 537 538 my ($tmp1, $tmp2) = pb_conf_get("pbpackager","pbrepo"); 538 539 $ENV{'PBPACKAGER'} = $tmp1->{$ENV{'PBPROJ'}}; … … 1612 1613 die "-i iso parameter needed" if (((not defined $iso) || ($iso eq "")) && ($create != 0)); 1613 1614 1615 # TODO: vmmonport should be optional 1614 1616 my ($ptr,$vmpath,$vmport,$vmsize,$vmmonport) = pb_conf_get("vmtype","vmpath","vmport","vmsize","vmmonport"); 1615 1617 my ($vmopt,$vmtmout,$vmsnap) = pb_conf_get_if("vmopt","vmtmout","vmsnap"); … … 1721 1723 # Get VE context 1722 1724 my ($ptr,$vetmout,$vepath,$verebuild,$veconf,$vepostinstall) = pb_conf_get("vetype","vetmout","vepath","verebuild","veconf"); 1723 my ($veb4pi,$vepi,$ve pkglist,$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"); 1724 1726 my $vetype = $ptr->{$ENV{'PBPROJ'}}; 1725 1727 … … 1735 1737 } 1736 1738 1737 my ($verpmtype ) = pb_conf_get("verpmtype");1739 my ($verpmtype,$vedebtype) = pb_conf_get("verpmtype","vedebtype"); 1738 1740 if (($create != 0) || ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i) || ($pbforce == 1)) { 1739 1741 # We have to rebuild the chroot … … 1761 1763 # Need to reshape the package list for pb 1762 1764 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); 1764 1769 if ($postparam eq "") { 1765 1770 $addpkgs = ""; … … 1773 1778 $addpkgs = "--add-pkg-list $pkgfile"; 1774 1779 } 1780 1775 1781 my $rinseverb = ""; 1776 1782 $rinseverb = "--verbose" if ($pbdebug gt 0); … … 1783 1789 } 1784 1790 } 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 } 1786 1809 } elsif ($dtype eq "ebuild") { 1787 1810 die "Please teach the dev team how to build gentoo chroot"; … … 2173 2196 $key = "\Q$zero1"; 2174 2197 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"); 2176 2199 # once this is done, we can do what we want on the VM remotely 2177 2200 } elsif ($vtype eq "ve") { 2178 2201 # 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 } 2182 2209 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 2221 pb_system("rm -f /dev/null; mknod /dev/null c 1 3; chmod 777 /dev/null"); 2222 EOF 2223 if ($postparam ne "") { 2191 2224 print SCRIPT << "EOF"; 2192 2225 # For VE we first need to mount some FS 2193 2226 pb_system("mount -t proc /proc /proc"); 2194 2195 # For VE we need a good null dev2196 pb_system("rm -f /dev/null; mknod /dev/null c 1 3; chmod 777 /dev/null");2197 2227 2198 2228 # For VE we need some additional packages that are not there yet -
devel/pb/lib/ProjectBuilder/CMS.pm
r896 r940 851 851 if ($scheme =~ /socks/) { 852 852 # Get the socks proxy command from the conf file 853 my ($pbsock cmd) = pb_conf_get("pbsockscmd");854 $cmd = "$pbsock cmd->{$ENV{'PBPROJ'}} ";853 my ($pbsockscmd) = pb_conf_get("pbsockscmd"); 854 $cmd = "$pbsockscmd->{$ENV{'PBPROJ'}} "; 855 855 } 856 856
Note:
See TracChangeset
for help on using the changeset viewer.