- Timestamp:
- Jan 7, 2011, 12:37:04 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1134 r1137 1039 1039 pb_log(2,"DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $pbins, $arch))."\n"); 1040 1040 1041 # If needed we may add repository to the build env 1042 pb_distro_setuprepo($ddir,$dver,$arch,$dtype,$dfam,$dos); 1043 1041 1044 # Get list of packages to build 1042 1045 my $ptr = pb_get_pkg(); … … 1049 1052 chdir "$ENV{'PBBUILDDIR'}"; 1050 1053 my $made = ""; # pkgs made during build 1054 my $pm = new Parallel::ForkManager($pbparallel) if (defined $pbparallel); 1055 1056 # We need to communicate info back from the children if parallel so prepare a dir for that 1057 my $tmpd = "$ENV{'PBTMP'}/build.$$"; 1058 pb_mkdir_p($tmpd) if (defined $pbparallel); 1059 1051 1060 foreach my $pbpkg (@pkgs) { 1061 $pm->start and next if (defined $pbparallel); 1062 1052 1063 my $vertag = $pkg->{$pbpkg}; 1053 1064 # get the version of the current package - maybe different … … 1085 1096 } 1086 1097 1087 # If needed we may add repository to the build env1088 pb_distro_setuprepo($ddir,$dver,$arch,$dtype,$dfam,$dos);1089 1098 foreach my $f (@specfile) { 1090 1099 if ($f =~ /\.spec$/) { 1100 # This could cause an issue in // mode 1091 1101 pb_distro_installdeps($f,$dtype,$pbins); 1092 1102 pb_system("rpmbuild $specialdef --define \"packager $ENV{'PBPACKAGER'}\" --define \"_topdir $ENV{'PBBUILDDIR'}\" -ba $f","Building package with $f under $ENV{'PBBUILDDIR'}","verbose"); … … 1095 1105 } 1096 1106 # Get the name of the generated packages 1097 open(LOG,"$ENV{'PBTMP'}/system. log") || die "Unable to open $ENV{'PBTMP'}/system.log";1107 open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log"; 1098 1108 while (<LOG>) { 1099 1109 chomp($_); … … 1114 1124 chmod 0755,"debian/rules"; 1115 1125 1116 pb_distro_setuprepo($ddir,$dver,$arch,$dtype,$dfam,$dos);1117 1126 pb_distro_installdeps("debian/control",$dtype,$pbins); 1118 1127 pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package","verbose"); 1119 1128 # Get the name of the generated packages 1120 open(LOG,"$ENV{'PBTMP'}/system. log") || die "Unable to open $ENV{'PBTMP'}/system.log";1129 open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log"; 1121 1130 while (<LOG>) { 1122 1131 chomp(); … … 1234 1243 die "Unknown dtype format $dtype"; 1235 1244 } 1236 } 1245 if (defined $pbparallel) { 1246 # Communicate results back to parent 1247 pb_set_content("$tmpd/$$",$made); 1248 $pm->finish; 1249 } 1250 } 1251 if (defined $pbparallel) { 1252 # In the parent, we need to get the result from the children 1253 $pm->wait_all_children; 1254 foreach my $f (<$tmpd/*>) { 1255 $made .= " ".pb_get_content($f); 1256 } 1257 pb_rm_rf($tmpd); 1258 } 1259 1237 1260 # Find the appropriate check cmd/opts 1238 1261 my ($oschkcmd,$oschkopt) = pb_conf_get_if("oschkcmd","oschkopt"); … … 2961 2984 <p> 2962 2985 EOF 2963 open(LOG,"$ENV{'PBTMP'}/system. log") || die "Unable to read $ENV{'PBTMP'}/system.log: $!";2986 open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to read $ENV{'PBTMP'}/system.$$.log: $!"; 2964 2987 my $col = 2; 2965 2988 my $i = 1;
Note:
See TracChangeset
for help on using the changeset viewer.