Changeset 1109 in ProjectBuilder
- Timestamp:
- Nov 17, 2010, 12:40:28 PM (14 years ago)
- Location:
- devel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.conf
r1108 r1109 405 405 #ospkgdep pkg = wget,make,perl 406 406 # And also need ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/sudo-1.7.2p1-sol10-sparc-local.gz ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/make-3.81-sol10-sparc-local.gz ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libintl-3.4.0-sol10-x86-local.gz ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libiconv-1.9.2-sol10-x86-local.gz ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.4.6-sol10-x86-local.gz 407 # 407 408 408 409 # Version of the perl module as found on CPAN … … 436 437 #oscmdopt rpmbootstrap = 437 438 # 439 # Commands to check packages 440 # 441 oschkcmd rpm = /usr/bin/rpmlint 442 oschkopt rpm = 443 oschkcmd deb = /usr/bin/lintian 444 oschkopt deb = -
devel/pb-modules/etc/pb.conf.pod
r1072 r1109 70 70 Conffile: pb 71 71 Example: osambiguous debian = debian,ubuntu 72 73 =item B<oschkcmd> 74 75 Nature: Optional 76 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). 77 Value: package checker tool. 78 Conffile: pb 79 Example: oschkcmd deb = /usr/bin/lintian 80 81 =item B<oschkopt> 82 83 Nature: Optional 84 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). 85 Value: package checker tool options. 86 Conffile: pb 87 Example: oschkcmd rpm = -i 72 88 73 89 =item B<oscodename> … … 200 216 Example: pbdefdir default = $ENV{'HOME'}/local/pb/projects 201 217 218 =item B<pbinstalltype> 219 220 Nature: Mandatory 221 Key: project (as defined in the -p option or PBPROJ environment variable) 222 Value: file or pkg. Indicates how pb will be installed during the setupve|vm phase in the virtual environment|machine, using CPAN files or upstream packages. Only the dev team needs to use file as packages do not yet exist for it. Or when no repository exists to pull project-builder.org from. 223 Conffile: pb 224 202 225 =item B<pbml> 203 226 … … 215 238 Conffile: project 216 239 Example: pbpackager pb = Bruno Cornec <bruno@project-builder.org> 240 241 =item B<pbpkg> 242 243 Nature: Optional (Mandatory if pbinstalltype is pkg) 244 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). 245 Value: coma separated list of packages that have to be installed in order for pb to be operational in the VE|VM 246 Conffile: pb 247 Example: pbpkg rhel-5 = project-builder 217 248 218 249 =item B<pbprojdir> -
devel/pb-modules/lib/ProjectBuilder/Log.pm
r1090 r1109 5 5 6 6 use strict; 7 use Mail::Sendmail;8 7 use ProjectBuilder::Base; 9 8 use ProjectBuilder::Log::Item; … … 227 226 # mails the summary to $to 228 227 sub mailSummary { 228 require Mail::Sendmail; 229 229 my $self = shift; 230 230 my $to = shift || ""; … … 239 239 Message => $self->summary() 240 240 ); 241 sendmail(%mail) or return $Mail::Sendmail::error; 241 if (! sendmail(%mail)) { 242 if (defined $Mail::Sendmail::error) { 243 return $Mail::Sendmail::error; 244 } else { 245 return "Unkown error"; 246 } 247 } 242 248 pb_log(0,"Mail send to ". $to ."\n"); 243 249 } -
devel/pb-modules/t/Base.t
r1106 r1109 5 5 use strict; 6 6 use ProjectBuilder::Base; 7 use Test;8 7 9 8 eval … … 15 14 # Test::More not found so no test will be performed here 16 15 if ($@) { 17 BEGIN { plan tests => 1 }; 16 require Test; 17 plan(tests => 1); 18 18 print "# Faking tests as test::More is not available\n"; 19 19 ok(1,1); -
devel/pb-modules/t/Log.t
r1106 r1109 5 5 use strict; 6 6 use ProjectBuilder::Base; 7 use Test;8 7 9 8 eval … … 15 14 # Test::More not found so no test will be performed here 16 15 if ($@) { 17 BEGIN { plan tests => 1 }; 16 require Test; 17 plan(tests => 1); 18 18 print "# Faking tests as test::More is not available\n"; 19 19 ok(1,1); -
devel/pb/bin/pb
r1107 r1109 1148 1148 } 1149 1149 } 1150 # Find the appropriate check cmd/opts 1151 my ($oschkcmd,$oschkopt) = pb_conf_get_if("oschkcmd","oschkopt"); 1152 my $chkcmd .= pb_distro_get_param($ddir,$dver,$arch,$oschkcmd,$dtype,$dfam,$dos); 1153 my $chkopt .= pb_distro_get_param($ddir,$dver,$arch,$oschkopt,$dtype,$dfam,$dos); 1154 1150 1155 # Packages check if needed 1151 1156 if ($dtype eq "rpm") { 1152 if (- f "/usr/bin/rpmlint") {1153 pb_system(" rpmlint $made","Checking validity of rpms with rpmlint","verbose");1157 if (-x $chkcmd) { 1158 pb_system("$chkcmd $chkopt $made","Checking validity of rpms with $chkcmd","verbose"); 1154 1159 } 1155 1160 my $rpms =""; … … 1166 1171 $made2 .= "../$f " if ($f =~ /\.changes$/); 1167 1172 } 1168 if (- f "/usr/bin/lintian") {1169 pb_system(" lintian $made2","Checking validity of debs with lintian","verbose");1173 if (-x $chkcmd) { 1174 pb_system("$chkcmd $chkopt $made2","Checking validity of debs with $chkcmd","verbose"); 1170 1175 } else { 1171 1176 pb_log(0,"deb packages generated: $made2\n"); … … 2560 2565 print SCRIPT << 'EOF'; 2561 2566 2562 my ($ospkgdep,$osperldep,$osperlver) = pb_conf_get_if("ospkgdep","osperldep","osperlver");2563 2564 # First install all required packages2565 pb_system("yum clean all","Cleaning yum env") if (($ddir eq "fedora") || ($ddir eq "asianux") || ($ddir eq "rhel"));2566 my $pkgdep = pb_distro_get_param($ddir,$dver,$darch,$ospkgdep,$dfam,$dtype,$dos);2567 pb_distro_installdeps(undef,$dtype,$pbupd,pb_distro_only_deps_needed($dtype,join(' ',split(/,/,$pkgdep))));2568 2569 # Then install manually the missing perl modules2570 my $perldep = pb_distro_get_param($ddir,$dver,$darch,$osperldep,$dfam,$dtype,$dos);2571 foreach my $m (split(/,/,$perldep)) {2572 # Skip empty deps2573 next if ($m =~ /^\s*$/);2574 my $dir = $m;2575 $dir =~ s/-.*//;2576 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" ,"Installing perl module $m-$osperlver->{$m}");2577 }2578 2579 2567 # Suse wants sudoers as 640 2580 2568 if ((($ddir eq "sles") && (($dver =~ /10/) || ($dver =~ /9/))) || (($ddir eq "opensuse") && ($dver =~ /10.[012]/))) { … … 2582 2570 } 2583 2571 2572 # First install all required packages 2573 pb_system("yum clean all","Cleaning yum env") if (($ddir eq "fedora") || ($ddir eq "asianux") || ($ddir eq "rhel")); 2574 my ($ospkgdep) = pb_conf_get_if("ospkgdep"); 2575 2576 my $pkgdep = pb_distro_get_param($ddir,$dver,$darch,$ospkgdep,$dfam,$dtype,$dos); 2577 pb_distro_installdeps(undef,$dtype,$pbupd,pb_distro_only_deps_needed($dtype,join(' ',split(/,/,$pkgdep)))); 2578 2579 EOF 2580 my $itype = pb_conf_get("pbinstalltype"); 2581 if ($itype->{$ENV{'PBPROJ'}} =~ /^file/) { 2582 print SCRIPT << 'EOF'; 2583 # Then install manually the missing perl modules 2584 my ($osperldep,$osperlver) = pb_conf_get_if("osperldep","osperlver"); 2585 2586 my $perldep = pb_distro_get_param($ddir,$dver,$darch,$osperldep,$dfam,$dtype,$dos); 2587 foreach my $m (split(/,/,$perldep)) { 2588 # Skip empty deps 2589 next if ($m =~ /^\s*$/); 2590 my $dir = $m; 2591 $dir =~ s/-.*//; 2592 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" ,"Installing perl module $m-$osperlver->{$m}"); 2593 } 2594 2584 2595 pb_system("rm -rf ProjectBuilder-* ; wget --passive-ftp ftp://ftp.mondorescue.org/src/ProjectBuilder-latest.tar.gz ; gzip -cd ProjectBuilder-latest.tar.gz | tar xf - ; cd ProjectBuilder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf ProjectBuilder-* ; rm -rf project-builder-* ; wget --passive-ftp ftp://ftp.mondorescue.org/src/project-builder-latest.tar.gz ; gzip -cd project-builder-latest.tar.gz | tar xf - ; cd project-builder-* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf project-builder-* ;","Building Project-Builder"); 2596 EOF 2597 } elsif ($itype->{$ENV{'PBPROJ'}} =~ /^pkg/) { 2598 # pkg based install. We need to point to the project-builder.org repository 2599 print SCRIPT << 'EOF'; 2600 my ($pbpkg) = pb_conf_get_if("pbpkg"); 2601 2602 my $pkgforpb = pb_distro_get_param($ddir,$dver,$darch,$pbpkg,$dfam,$dtype,$depdos); 2603 pb_distro_setuprepo($ddir,$dver,$darch,$dtype); 2604 pb_distro_installdeps(undef,$dtype,$pbupd,pb_distro_only_deps_needed($dtype,join(' ',split(/,/,$pkgforpb)))); 2605 EOF 2606 } else { 2607 # Unknown install type 2608 die("Unknown install type $itype->{$ENV{'PBPROJ'}} for param pbinstalltype"); 2609 } 2610 print SCRIPT << 'EOF'; 2585 2611 pb_system("pb 2>&1 | head -5",undef,"verbose"); 2586 2612 EOF … … 2877 2903 2878 2904 # Preparation of headers 2905 require Mail::Sendmail; 2879 2906 2880 2907 my %mail = ( … … 2887 2914 2888 2915 # Send mail 2889 sendmail(%mail) or die "Unable to send mail ($Mail::Sendmail::error): $Mail::Sendmail::log"; 2916 if (! sendmail(%mail)) { 2917 if ((defined $Mail::Sendmail::error) and (defined $Mail::Sendmail::log)) { 2918 die "Unable to send mail ($Mail::Sendmail::error): $Mail::Sendmail::log"; 2919 } 2920 } 2890 2921 } 2891 2922
Note:
See TracChangeset
for help on using the changeset viewer.