Changeset 1651 in ProjectBuilder
- Timestamp:
- Oct 7, 2012, 6:07:09 AM (12 years ago)
- Location:
- devel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.conf
r1645 r1651 296 296 # On RedHat 6.2 we do not give any package here to avoid problems to add them as there is no repo nor yum mecanism 297 297 osmindep redhat = 298 osmindep redhat-6.2 = 298 osmindep redhat-6.2 = ftp://ftp.pbone.net/mirror/archive.download.redhat.com/pub/redhat/linux/6.2/en/powertools/i386/i386/sudo-1.6.1-1.i386.rpm 299 299 osmindep default = perl,sudo,wget,tar,make,gzip 300 300 301 301 # These deps are needed for rpmbootstrap to install a base distribution 302 302 # Originally reuse from rinse conf files 303 rbsmindep redhat-6.2 = MAKEDEV,SysVinit,authconfig,basesystem,bash,binutils,bzip2,chkconfig,console-tools,cracklib,cracklib-dicts,dev,dev86,diffutils,dhcpcd,e2fsprogs,file,filesystem,fileutils,findutils,gawk,gdbm,glib,glibc,gmp,grep,gzip,info,initscripts,iproute,iputils,kernel,krb5-configs,krb5-libs,ldconfig,ld.so,libc,libelf,libstdc++,libtermcap,logrotate,make,mingetty,mktemp,modutils,mount,newt,ncurses,net-tools,pam,passwd,p erl,popt,procps,psmisc,pwdb,python,readline,rpm,rpm-python,sed,setup,shadow-utils,sh-utils,slang,sysklogd,tar,tcsh,termcap,textutils,util-linux,vim-common,vim-minimal,vixie-cron,which,wget,zlib303 rbsmindep redhat-6.2 = MAKEDEV,SysVinit,authconfig,basesystem,bash,binutils,bzip2,chkconfig,console-tools,cracklib,cracklib-dicts,dev,dev86,diffutils,dhcpcd,e2fsprogs,file,filesystem,fileutils,findutils,gawk,gdbm,glib,glibc,gmp,grep,gzip,info,initscripts,iproute,iputils,kernel,krb5-configs,krb5-libs,ldconfig,ld.so,libc,libelf,libstdc++,libtermcap,logrotate,make,mingetty,mktemp,modutils,mount,newt,ncurses,net-tools,pam,passwd,patch,perl,popt,procps,psmisc,pwdb,python,readline,redhat-release,rpm,rpm-python,sed,setup,shadow-utils,sh-utils,slang,sysklogd,tar,tcsh,termcap,textutils,util-linux,vim-common,vim-minimal,vixie-cron,which,wget,xntp3,zlib 304 304 # 305 305 rbsmindep fedora-4 = MAKEDEV,SysVinit,audit-libs,basesystem,bash,beecrypt,bzip2-libs,chkconfig,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,elfutils-libelf,ethtool,expat,filesystem,findutils,gawk,gdbm,glib2,glibc,glibc-common,grep,info,initscripts,iproute,iputils,krb5-libs,libacl,libattr,libcap,libgcc,libidn,libselinux,libsepol,libstdc++,libtermcap,libxml2,libxml2-python,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,python-sqlite,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,sed,setup,shadow-utils,sqlite,sysklogd,termcap,tzdata,udev,util-linux,yum,zlib … … 533 533 # Old RedHat - Module-Build first for processing as needed by others 534 534 osperldep redhat = Module-Build,Date-Manip,File-MimeInfo,File-BaseDir 535 ospkgdep redhat = wget,make,ntp,patch,diffutils535 ospkgdep redhat = 536 536 # Old SuSE - Module-Build first for processing as needed by others 537 537 osperldep suse = Module-Build,Date-Manip,File-MimeInfo,File-BaseDir … … 652 652 ospkg default = project-builder 653 653 # Where is the associated repo 654 osrepo redhat-6.2 = 654 655 osrepo rpm = ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}/pb.repo 655 656 osrepo deb = ftp://ftp.project-builder.org/$pbos->{'name'}/$pbos->{'version'}/pb.sources.list … … 673 674 ossha rpm = sha256 674 675 # RHEL before 6 had python 2.4 676 ossha redhat-6.2 = sha 675 677 ossha rhel-2.1 = sha 676 678 ossha rhel-3 = sha -
devel/pb-modules/lib/ProjectBuilder/Base.pm
r1647 r1651 135 135 The first parameter is the shell command to call. This command should NOT use redirections. 136 136 The second parameter is the message to print on screen. If none is given, then the command is printed. 137 The third parameter prints the result of the command after correct execution if value is "verbose". If value is "noredir", it avoids redirecting outputs (e.g. for vi). If value is "quiet", doesn't print anything at all. If value is "mayfail", failure of the command is ok even if $Global::pb_stop_on_error is set, because the caller will be handling the error. 137 The third parameter prints the result of the command after correct execution if value is "verbose". If value is "noredir", it avoids redirecting outputs (e.g. for vi). If value is "quiet", doesn't print anything at all. If value is "mayfail", failure of the command is ok even if $Global::pb_stop_on_error is set, because the caller will be handling the error. A "verbose" can be added to mayfail to have it explain why it failed 138 138 This function returns as a result the return value of the system command. 139 139 … … 160 160 my $res = $?; 161 161 # Exit now if the command may fail 162 if ((defined $verbose) and ($verbose eq "mayfail")) {162 if ((defined $verbose) and ($verbose =~ /mayfail/)) { 163 163 pb_log(0,"NOT OK but non blocking\n") if ($res != 0); 164 164 pb_log(0,"OK\n") if ($res == 0); 165 pb_display_file("$ENV{'PBTMP'}/system.$$.log") if ((-f "$ENV{'PBTMP'}/system.$$.log") and (defined $verbose) and ($verbose =~ /verbose/)); 165 166 return($res) 166 167 } … … 178 179 confess("ERROR running command ($cmd) with cwd=$cwd, pid=$$"); 179 180 } else { 180 pb_log(0,"ERROR running command ($cmd) with cwd=$cwd, pid=$$ ");181 pb_log(0,"ERROR running command ($cmd) with cwd=$cwd, pid=$$\n"); 181 182 } 182 183 } else { -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r1597 r1651 33 33 34 34 our @ISA = qw(Exporter); 35 our @EXPORT = qw(pb_distro_conffile pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_get_param pb_distro_get_context pb_distro_to_keylist );35 our @EXPORT = qw(pb_distro_conffile pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_setuposrepo pb_distro_get_param pb_distro_get_context pb_distro_to_keylist pb_apply_conf_proxy); 36 36 ($VERSION,$REVISION) = pb_version_init(); 37 37 … … 306 306 307 307 # We do not overwrite shell settings 308 $ENV{ftp_proxy} ||= $ftp_proxy ;309 $ENV{http_proxy} ||= $http_proxy ;308 $ENV{ftp_proxy} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne "")); 309 $ENV{http_proxy} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne "")); 310 310 } 311 311 -
devel/pb/bin/pb
r1649 r1651 2342 2342 # For VE we need to change the owner manually 2343 2343 if ($cmt =~ /^VE/) { 2344 my $res = pb_system("$shcmdroot sed -i '/requiretty/d' /etc/sudoers","Removing potential requiretty in sudoers" );2344 my $res = pb_system("$shcmdroot sed -i '/requiretty/d' /etc/sudoers","Removing potential requiretty in sudoers","quiet"); 2345 2345 pb_system("$shcmdroot sed '/requiretty/d' /etc/sudoers > /tmp/sudoers.new ; mv /tmp/sudoers.new $tpdir/tmp/sudoers.new ; $shcmdroot mv /tmp/sudoers.new /etc/sudoers","Removing again potential requiretty in sudoers as sed -i failed") if (($res ne 0) && (-f "$tpdir/etc/sudoers")); 2346 2346 pb_system("$shcmd \"sudo $chowncommand -R $mac $tdir\"","Adapt owner in $tdir to $mac"); … … 2528 2528 my $pbos = pb_distro_get_context($v); 2529 2529 2530 my $ftp_proxy = pb_distro_get_param($pbos,pb_conf_get_if("ftp_proxy")); 2531 my $http_proxy = pb_distro_get_param($pbos,pb_conf_get_if("http_proxy")); 2532 2533 $ENV{ftp_proxy} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne "")); 2534 $ENV{http_proxy} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne "")); 2530 pb_apply_conf_proxy($pbos); 2535 2531 2536 2532 # Launch the VMs/VEs … … 3084 3080 EOF 3085 3081 my $ppref = "our"; 3086 $ppref = "my" if (($pbos->{'name'} =~ / redhat/) && ($pbos->{'version'} =~ /^6/));3082 $ppref = "my" if (($pbos->{'name'} =~ /^redhat/) && ($pbos->{'version'} =~ /^6/)); 3087 3083 print SCRIPT << "EOF"; 3088 $ppref \$pbdebug ;3084 $ppref \$pbdebug = $pbdebug; 3089 3085 $ppref \$pbLOG; 3090 3086 $ppref \$pbsynmsg = "pbscript"; … … 3132 3128 } elsif ($vtype eq "ve") { 3133 3129 print SCRIPT << "EOF"; 3134 # For VE we need a good null dev3135 pb_system("rm -f /dev/null; mknod /dev/null c 1 3; chmod 777 /dev/null");3136 3137 3130 # For VE we first need to mount some FS 3138 3131 pb_system("mount -t proc /proc /proc") unless (-d "/proc/$$"); 3139 3132 3133 # For VE we need a good null dev 3134 # Except for RedHat 6.2 where it's good and doesnt like being recreated 3140 3135 EOF 3136 print SCRIPT "pb_system('rm -f /dev/null; mknod /dev/null c 1 3; chmod 777 /dev/null')\n" unless (($pbos->{'name'} =~ /^redhat/) && ($pbos->{'version'} =~ /^6/)); 3141 3137 } else { 3142 3138 die "Unknown virtual type $vtype"; … … 3345 3341 print SCRIPT "pb_system(\"$ntpline\",\"Updating time with $ntpline\",\"mayfail\");\n"; 3346 3342 } 3347 # We may need a proxy configuration. Get it from the local env3348 my $ftp_proxy = pb_distro_get_param($pbos,pb_conf_get_if("ftp_proxy"));3349 my $http_proxy = pb_distro_get_param($pbos,pb_conf_get_if("http_proxy"));3350 3351 $ENV{'ftp_proxy'} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne ""));3352 $ENV{'http_proxy'} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne ""));3353 3354 if (defined $ENV{'http_proxy'}) {3355 print SCRIPT "\$ENV\{'http_proxy'\}=\"$ENV{'http_proxy'}\";\n";3356 }3357 3358 if (defined $ENV{'ftp_proxy'}) {3359 print SCRIPT "\$ENV\{'ftp_proxy'\}=\"$ENV{'ftp_proxy'}\";\n";3360 }3361 3343 3362 3344 print SCRIPT << 'EOF'; 3363 3345 3346 # We may need a proxy configuration. Get it from the local env 3347 pb_apply_conf_proxy($pbos); 3348 3364 3349 # Suse wants sudoers as 640 3365 3350 if ((($pbos->{'name'} eq "sles") && (($pbos->{'version'} =~ /10/) || ($pbos->{'version'} =~ /9/))) || (($pbos->{'name'} eq "opensuse") && ($pbos->{'version'} =~ /10.[012]/))) { … … 3415 3400 3416 3401 my $perldep = pb_distro_get_param($pbos,$osperldep); 3402 my $bashopt = ""; 3403 $bashopt = "-x" if ($pbdebug ge 1); 3404 my $verbopt = "mayfail"; 3405 $verbopt = "mayfailverbose" if ($pbdebug ge 1); 3417 3406 foreach my $m (split(/,/,$perldep)) { 3418 3407 # Skip empty deps … … 3420 3409 my $dir = $m; 3421 3410 $dir =~ s/-.*//; 3422 pb_system("echo \"rm -rf $m* ; wget http://search.cpan.org/CPAN/modules/by-module/$dir/$m-$osperlver->{$m}.tar.gz ; gzip -cd $m-$osperlver->{$m}.tar.gz | tar xf - ; cd $m* ; if [ -f Build.PL ]; then perl Build.PL; ./Build ; ./Build install ; else perl Makefile.PL; make ; make install ; fi; cd .. ; rm -rf $m*\" | bash -e " ,"Installing perl module $m-$osperlver->{$m}","mayfail");3411 pb_system("echo \"rm -rf $m* ; wget http://search.cpan.org/CPAN/modules/by-module/$dir/$m-$osperlver->{$m}.tar.gz ; gzip -cd $m-$osperlver->{$m}.tar.gz | tar xf - ; cd $m* ; if [ -f Build.PL ]; then perl Build.PL; ./Build ; ./Build install ; else perl Makefile.PL; make ; make install ; fi; cd .. ; rm -rf $m*\" | bash -e $bashopt" ,"Installing perl module $m-$osperlver->{$m}",$verbopt); 3423 3412 } 3424 3413 EOF
Note:
See TracChangeset
for help on using the changeset viewer.