Changeset 1541 in ProjectBuilder for devel/pb/bin
- Timestamp:
- May 14, 2012, 2:41:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1540 r1541 1794 1794 pb_log(0,"Sources handled ($cmt): $src\n"); 1795 1795 pb_log(2,"values: ".Dumper(($host,$login,$dir,$port,$tmout,$path,$conf))."\n"); 1796 my ($sshhost,$ssh login,$sshdir,$sshport) = pb_conf_get($host,$login,$dir,$port);1796 my ($sshhost,$sshdir) = pb_conf_get($host,$dir); 1797 1797 # Not mandatory... 1798 1798 $delivery->{$ENV{'PBPROJ'}} = "" if (not defined $delivery->{$ENV{'PBPROJ'}}); 1799 my ($sshlogin,$sshport) = pb_conf_get_if($login,$port); 1800 $sshport->{$ENV{PBPROJ}} = 22 unless (defined $sshport->{$ENV{PBPROJ}}); 1801 $sshlogin->{$ENV{PBPROJ}} = getpwuid($UID) unless (defined $sshlogin->{$ENV{PBPROJ}}); 1799 1802 my ($vtmout,$vepath); 1800 1803 # ...Except those in virtual context … … 2059 2062 my ($shcmd,$cpcmd,$cptarget,$cp2target); 2060 2063 if ($cmt =~ /^VE/) { 2061 my $tp = $vepath->{$ENV{'PBPROJ'}};2062 my $tpdir = "$tp/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";2064 my $tp = pb_path_expand($vepath->{$ENV{'PBPROJ'}}); 2065 my $tpdir = pb_path_expand("$tp/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}"); 2063 2066 my ($ptr) = pb_conf_get("vetype"); 2064 2067 my $vetype = $ptr->{$ENV{'PBPROJ'}}; … … 2070 2073 $cpcmd = "sudo /bin/cp -r "; 2071 2074 # We need to get the home dir of the target account to deliver in the right place 2072 open(PASS,"$tpdir/etc/passwd") || die "Unable to open $tpdir/etc/passwd ";2075 open(PASS,"$tpdir/etc/passwd") || die "Unable to open $tpdir/etc/passwd: $!"; 2073 2076 my $homedir = ""; 2074 2077 while (<PASS>) { … … 2770 2773 } 2771 2774 2775 # This function creates a giant script to configure a particular VM/VE/RM, it then copies the 2776 # script to the target. 2777 2772 2778 # Function to create a potentialy missing pb account on the VM/VE/RM, and adds it to sudo 2773 2779 # Needs to use root account to connect to the VM/VE/RM … … 2874 2880 # For VE we need a good null dev 2875 2881 pb_system("rm -f /dev/null; mknod /dev/null c 1 3; chmod 777 /dev/null"); 2876 EOF 2877 print SCRIPT << "EOF"; 2882 2878 2883 # For VE we first need to mount some FS 2879 2884 pb_system("mount -t proc /proc /proc"); 2880 2885 2881 2886 EOF 2887 } else { 2888 die "Unknown virtual type $vtype"; 2882 2889 } 2883 2890 … … 3030 3037 next if (/^Defaults:$pbac->{$ENV{'PBPROJ'}}\\s+/); 3031 3038 next if (/^Defaults:root \!requiretty/); 3039 next if (/^Defaults:root env_keep/); 3032 3040 EOF 3033 3041 print SCRIPT << 'EOF'; … … 3043 3051 # Keep proxy configuration while using sudo 3044 3052 print PBOUT "Defaults:$pbac->{$ENV{'PBPROJ'}} env_keep += \\\"http_proxy ftp_proxy\\\"\n"; 3053 print PBOUT "Defaults:root env_keep += \\\"http_proxy ftp_proxy\\\"\n"; 3045 3054 EOF 3046 3055 # Try to restrict security to what is really needed … … 3083 3092 } 3084 3093 # We may need a proxy configuration. Get it from the local env 3094 3095 # TODO: make this apply to the bootstrapping also. 3096 my ($ftp_proxy_map, $http_proxy_map) = pb_conf_get_if('ftp_proxy', 'http_proxy'); 3097 my $ftp_proxy = pb_distro_get_param($pbos, $ftp_proxy_map); 3098 my $http_proxy = pb_distro_get_param($pbos, $http_proxy_map); 3099 3100 $ENV{'ftp_proxy'} = $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne '')); 3101 $ENV{'http_proxy'} = $http_proxy if ((defined $http_proxy) && ($http_proxy ne '')); 3085 3102 3086 3103 if (defined $ENV{'http_proxy'}) {
Note:
See TracChangeset
for help on using the changeset viewer.