Changeset 1130 in ProjectBuilder
- Timestamp:
- Dec 22, 2010, 4:01:42 AM (14 years ago)
- Location:
- devel/pb
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1128 r1130 756 756 my %build; 757 757 my %patches; 758 my %sources; 758 759 # We want to at least build for the underlying distro 759 760 # except if a target was given, in which case we only build for it … … 793 794 $pb{'repo'} = $ENV{'PBREPO'}; 794 795 $pb{'patches'} = \%patches; 796 $pb{'sources'} = \%sources; 795 797 pb_log(2,"DEBUG: pb: ".Dumper(%pb)."\n"); 796 798 … … 852 854 my $ptr = pb_get_filters($pbpkg, $pb{'dtype'}, $dfam, $ddir, $dver); 853 855 854 # Prepare local patches for this distro - They are always applied first - May be a problem one day855 foreach my $p (sort(<$ENV{'PBROOTDIR'}/$pbpkg/pbpatch/*>)) {856 $patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.all$/));857 $patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.all$/);858 $patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$pb{'dtype'}$/));859 $patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$pb{'dtype'}$/);860 $patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$dfam$/));861 $patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$dfam$/);862 $patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir$/));863 $patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir$/);864 $patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver$/));865 $patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver$/);866 $patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver-$arch$/));867 $patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver-$arch$/);868 }869 870 # Prepare also remote patches to be included - Applied after the local ones871 foreach my $p ("all","$pb{'dtype'}","$dfam","$ddir","$ddir-$dver","$ddir-$dver-$arch") {872 my $f = "$ENV{'PBROOTDIR'}/$pbpkg/pbextpatch.$p";873 next if (not -f $f);874 if (not open(PATCH,$f)) {875 pb_display("Unable to open existing external patch file content $f\n");876 next;877 }878 while (<PATCH>) {879 chomp();880 $patches{"$ddir-$dver-$arch"} .= "," if (defined $patches{"$ddir-$dver-$arch"});881 $patches{"$ddir-$dver-$arch"} .= "$_";882 }883 close(PATCH);884 }885 pb_log(2,"DEBUG: pb->patches: ".Dumper($pb{'patches'})."\n");886 887 856 # Apply now all the filters on all the files concerned 888 857 # destination dir depends on the type of file … … 894 863 } 895 864 } 865 pb_list_sfiles("$ENV{'PBROOTDIR'}/$pbpkg/pbpatch", \%patches, $pb{'dtype'}, $dfam, $ddir, $dver, $arch, "$ENV{'PBROOTDIR'}/$pbpkg/pbextpatch"); 866 pb_list_sfiles("$ENV{'PBROOTDIR'}/$pbpkg/pbsrc", \%sources, $pb{'dtype'}, $dfam, $ddir, $dver, $arch, "$ENV{'PBROOTDIR'}/$pbpkg/pbextsrc"); 867 896 868 $pm->finish if (defined $pbparallel); 897 869 } … … 906 878 pb_log(0,"No Build files found for ".join(',',sort(@notfound))."\n") if (@notfound); 907 879 pb_log(2,"DEBUG: patches: ".Dumper(%patches)."\n"); 880 pb_log(2,"DEBUG: sources: ".Dumper(%sources)."\n"); 908 881 } 909 882 … … 927 900 if (not defined $web) { 928 901 my %tmp; 929 my $warnflag = 0; 902 my $warnptcflag = 0; 903 my $warnsrcflag = 0; 930 904 # Filter potential patches (local + remote) 931 905 pb_log(0,"Delivering and compressing patches "); … … 935 909 my $pp = basename($pf); 936 910 if ($param eq "SandBox") { 937 $warn flag = 1;911 $warnptcflag = 1; 938 912 } 939 913 pb_cms_export($pf,undef,"$dest/pbconf/$v/pbpatch"); … … 943 917 } 944 918 } 919 pb_log(0,"Delivering additional sources "); 920 foreach my $v (keys %sources) { 921 pb_mkdir_p("$dest/pbconf/$v/pbsrc"); 922 foreach my $pf (split(/,/,$sources{$v})) { 923 my $pp = basename($pf); 924 if ($param eq "SandBox") { 925 $warnsrcflag = 1; 926 } 927 pb_cms_export($pf,undef,"$dest/pbconf/$v/pbsrc"); 928 pb_filter_file_inplace($ptr,"$dest/pbconf/$v/pbsrc/$pp",\%pb); 929 $tmp{$pf} = ""; 930 } 931 } 945 932 foreach my $v (keys %tmp) { 946 933 pb_log(0,"$v "); 947 934 } 948 935 pb_log(0,"\n"); 949 pb_log(0,"WARNING: Patches are always taken from repository not local export\n") if ($warnflag == 1); 936 pb_log(0,"WARNING: Patches are always taken from repository not local export\n") if ($warnptcflag == 1); 937 pb_log(0,"WARNING: Sources are always taken from repository not local export\n") if ($warnsrcflag == 1); 950 938 } else { 951 939 # Instead call News generation … … 3250 3238 } 3251 3239 3252 3240 sub pb_list_sfiles { 3241 3242 my $sdir = shift; 3243 my $sources = shift; 3244 my $dtype = shift; 3245 my $dfam = shift; 3246 my $ddir = shift; 3247 my $dver = shift; 3248 my $arch = shift; 3249 my $extdir = shift; 3250 3251 # Prepare local sources for this distro - They are always applied first - May be a problem one day 3252 # This function works for both patches and additional sources 3253 foreach my $p (sort(<$sdir/*>)) { 3254 $sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.all$/)); 3255 $sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.all$/); 3256 $sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$dtype$/)); 3257 $sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$dtype$/); 3258 $sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$dfam$/)); 3259 $sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$dfam$/); 3260 $sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir$/)); 3261 $sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir$/); 3262 $sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver$/)); 3263 $sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver$/); 3264 $sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver-$arch$/)); 3265 $sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver-$arch$/); 3266 } 3267 3268 # Prepare also remote sources to be included - Applied after the local ones 3269 foreach my $p ("all","$dtype","$dfam","$ddir","$ddir-$dver","$ddir-$dver-$arch") { 3270 my $f = "$extdir.".".$p"; 3271 next if (not -f $f); 3272 if (not open(PATCH,$f)) { 3273 pb_display("Unable to open existing external source file content $f\n"); 3274 next; 3275 } 3276 while (<PATCH>) { 3277 chomp(); 3278 $sources->{"$ddir-$dver-$arch"} .= "," if (defined $sources->{"$ddir-$dver-$arch"}); 3279 $sources->{"$ddir-$dver-$arch"} .= "$_"; 3280 } 3281 close(PATCH); 3282 } 3283 pb_log(2,"DEBUG: sources: ".Dumper($sources)."\n"); 3284 } 3285 3253 3286 # 3254 3287 # Return the list of packages we are working on in a non CMS action -
devel/pb/lib/ProjectBuilder/Env.pm
r1113 r1130 555 555 filter PBDATE = \$pb->{'date'} 556 556 557 # PBPATCHSRC is replaced by the patches names if value is yes 557 # PBPATCHSRC is replaced by the patches names if value is yes. Patches are located under the pbpatch dir of the pkg. 558 558 #filter PBPATCHSRC = yes 559 559 560 560 # PBPATCHCMD is replaced by the patches commands if value is yes 561 561 #filter PBPATCHCMD = yes 562 563 # PBMULTISRC is replaced by the sources names if value is yes. Sources are located under the pbsrc dir of the pkg. 564 #filter PBMULTISRC = yes 562 565 563 566 # PBTAG is replaced by the tag (\$pb->{'tag'} in code) -
devel/pb/lib/ProjectBuilder/Filter.pm
r1044 r1130 177 177 } 178 178 $tmp = ""; 179 } elsif (($s =~ /^PBMULTISRC$/) && ($line =~ /^PBMULTISRC$/)) { 180 pb_log(3,"DEBUG filtering PBMULTISRC\n"); 181 my $i = 1; 182 foreach my $p (split(/,/,$pb->{'sources'}->{$pb->{'tuple'}})) { 183 print DEST "Source$i: ".basename($p)."\n"; 184 $i++; 185 } 186 $tmp = ""; 179 187 } elsif (($s =~ /^PBPATCHCMD$/) && ($line =~ /^PBPATCHCMD$/)) { 180 188 pb_log(3,"DEBUG filtering PBPATCHCMD\n");
Note:
See TracChangeset
for help on using the changeset viewer.