Changeset 1137 in ProjectBuilder
- Timestamp:
- Jan 7, 2011, 12:37:04 AM (14 years ago)
- Location:
- devel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Base.pm
r1128 r1137 146 146 pb_log(0,"$cmt... ") if ((! defined $verbose) || ($verbose ne "quiet")); 147 147 pb_log(1,"Executing $cmd\n"); 148 unlink("$ENV{'PBTMP'}/system. log") if (-f "$ENV{'PBTMP'}/system.log");149 $redir = "2>> $ENV{'PBTMP'}/system. log 1>> $ENV{'PBTMP'}/system.log" if ((! defined $verbose) || ($verbose ne "noredir"));148 unlink("$ENV{'PBTMP'}/system.$$.log") if (-f "$ENV{'PBTMP'}/system.$$.log"); 149 $redir = "2>> $ENV{'PBTMP'}/system.$$.log 1>> $ENV{'PBTMP'}/system.$$.log" if ((! defined $verbose) || ($verbose ne "noredir")); 150 150 system("$cmd $redir"); 151 151 my $res = $?; … … 158 158 if ($res == -1) { 159 159 pb_log(0,"failed to execute ($cmd): $!\n") if ((! defined $verbose) || ($verbose ne "quiet")); 160 pb_display_file("$ENV{'PBTMP'}/system. log") if ((-f "$ENV{'PBTMP'}/system.log") and ((! defined $verbose) || ($verbose ne "quiet")));160 pb_display_file("$ENV{'PBTMP'}/system.$$.log") if ((-f "$ENV{'PBTMP'}/system.$$.log") and ((! defined $verbose) || ($verbose ne "quiet"))); 161 161 } elsif ($res & 127) { 162 162 pb_log(0, "child ($cmd) died with signal ".($? & 127).", ".($? & 128) ? 'with' : 'without'." coredump\n") if ((! defined $verbose) || ($verbose ne "quiet")); 163 pb_display_file("$ENV{'PBTMP'}/system. log") if ((-f "$ENV{'PBTMP'}/system.log") and ((! defined $verbose) || ($verbose ne "quiet")));163 pb_display_file("$ENV{'PBTMP'}/system.$$.log") if ((-f "$ENV{'PBTMP'}/system.$$.log") and ((! defined $verbose) || ($verbose ne "quiet"))); 164 164 } elsif ($res == 0) { 165 165 pb_log(0,"OK\n") if ((! defined $verbose) || ($verbose ne "quiet")); 166 pb_display_file("$ENV{'PBTMP'}/system. log") if ((defined $verbose) and (-f "$ENV{'PBTMP'}/system.log") and ($verbose ne "quiet"));166 pb_display_file("$ENV{'PBTMP'}/system.$$.log") if ((defined $verbose) and (-f "$ENV{'PBTMP'}/system.$$.log") and ($verbose ne "quiet")); 167 167 } else { 168 168 pb_log(0, "child ($cmd) exited with value ".($? >> 8)."\n") if ((! defined $verbose) || ($verbose ne "quiet")); 169 pb_display_file("$ENV{'PBTMP'}/system. log") if ((-f "$ENV{'PBTMP'}/system.log") and ((! defined $verbose) || ($verbose ne "quiet")));169 pb_display_file("$ENV{'PBTMP'}/system.$$.log") if ((-f "$ENV{'PBTMP'}/system.$$.log") and ((! defined $verbose) || ($verbose ne "quiet"))); 170 170 } 171 171 return($res); … … 312 312 =item B<pb_set_content> 313 313 314 This function put the content of a file into the file passed inparameter.314 This function put the content of a variable passed as second parameter into the file passed as first parameter. 315 315 316 316 =cut -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r1132 r1137 302 302 return if ((not defined $deps) || ($deps =~ /^\s*$/)); 303 303 if ($deps !~ /^[ ]*$/) { 304 # This may not be // proof. We should test for availability of repo and sleep if not 304 305 pb_system("$dupd $deps","Installing dependencies ($deps)"); 305 306 } -
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.