Changeset 1363 in ProjectBuilder
- Timestamp:
- Nov 21, 2011, 2:34:56 PM (13 years ago)
- Location:
- devel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Env.pm
r1348 r1363 335 335 die "$ENV{'PBROOTDIR'} is not a directory" if (not -d $ENV{'PBROOTDIR'}); 336 336 } 337 pb_log(1,"PBROOTDIR=$ENV{'PBROOTDIR'}\n"); 337 338 338 339 # Adds that conf file to the list to consider -
devel/pb/bin/pb
r1360 r1363 913 913 # Used in Filter.pm by pb_filter_file 914 914 915 $build{$v} = " yes";915 $build{$v} = "no"; 916 916 if (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'os'}") { 917 917 pb_list_bfiles("$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'os'}",$pbpkg,\%bfiles,\%pkgfiles,$supfiles); 918 } elsif (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'type'}") { 918 $build{$v} = "yes"; 919 } 920 if (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'type'}") { 919 921 pb_list_bfiles("$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'type'}",$pbpkg,\%bfiles,\%pkgfiles,$supfiles); 920 } elsif (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'family'}") { 922 $build{$v} = "yes"; 923 } 924 if (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'family'}") { 921 925 pb_list_bfiles("$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'family'}",$pbpkg,\%bfiles,\%pkgfiles,$supfiles); 922 } elsif (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}") { 926 $build{$v} = "yes"; 927 } 928 if (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}") { 923 929 pb_list_bfiles("$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}",$pbpkg,\%bfiles,\%pkgfiles,$supfiles); 924 } elsif (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}-$pbos->{'version'}") { 930 $build{$v} = "yes"; 931 } 932 if (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}-$pbos->{'version'}") { 925 933 pb_list_bfiles("$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}-$pbos->{'version'}",$pbpkg,\%bfiles,\%pkgfiles,$supfiles); 926 } elsif (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}") { 934 $build{$v} = "yes"; 935 } 936 if (-d "$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}") { 927 937 pb_list_bfiles("$ENV{'PBROOTDIR'}/$pbpkg/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}",$pbpkg,\%bfiles,\%pkgfiles,$supfiles); 928 } else { 929 $build{$v} = "no"; 938 $build{$v} = "yes"; 930 939 } 931 940 pb_log(2,"DEBUG($v) bfiles: ".Dumper(\%bfiles)."\n"); … … 961 970 } 962 971 # Filter build files at the end, as they depend on patches and sources 963 foreach my $f (values %bfiles,values %pkgfiles) { 964 pb_filter_file("$ENV{'PBROOTDIR'}/$f",$ptr,"$dest/pbconf/$v/".basename($f),$pb); 972 foreach my $f (keys %bfiles) { 973 pb_filter_file("$ENV{'PBROOTDIR'}/$bfiles{$f}",$ptr,"$dest/pbconf/$v/$f",$pb); 974 } 975 foreach my $f (keys %pkgfiles) { 976 pb_filter_file("$ENV{'PBROOTDIR'}/$pkgfiles{$f}",$ptr,"$dest/pbconf/$v/$f",$pb); 965 977 } 966 978 } … … 1248 1260 1249 1261 # We need to handle potential patches to upstream sources 1250 pb_mkdir_p("$ENV{'PBBUILDDIR'}/debian/patches"); 1251 my @f = pb_extract_build_files($src2,"$pbpkg-$pbver/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbpatch/","$ENV{'PBBUILDDIR'}/debian/patches","patch"); 1252 # Generate Debian patch series 1253 open(SERIE,"> $ENV{'PBBUILDDIR'}/debian/series") || die "Unable to write in $ENV{'PBBUILDDIR'}/debian/series"; 1254 foreach my $f (@f) { 1262 pb_mkdir_p("debian/patches"); 1263 my @f = pb_extract_build_files($src2,"$pbpkg-$pbver/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbpatch/","debian/patches","patch"); 1264 1265 # If we use quilt to manage patches, we then setup the env correctly as per http://pkg-perl.alioth.debian.org/howto/quilt.html 1266 # Generate Debian patch series for quilt 1267 # If we use dpatch to manage patches, we then setup the 00list file as well 1268 open(SERIE,"> debian/patches/series") || die "Unable to write in debian/patches/series"; 1269 open(LIST,"> debian/patches/00list") || die "Unable to write in debian/patches/00list"; 1270 foreach my $f (sort @f) { 1271 # We also need to ncompress them 1255 1272 print SERIE "$f\n"; 1273 print LIST "$f\n"; 1256 1274 } 1257 1275 close(SERIE); 1276 close(LIST); 1277 $ENV{'QUILT_PATCHES'}="debian/patches"; 1258 1278 1259 1279 # We need to handle potential additional sources to upstream sources … … 3450 3470 my $pkgfiles = shift; 3451 3471 my $supfiles = shift; 3452 3453 pb_log(2,"DEBUG: entering pb_list_bfiles: ".Dumper($bfiles)."\n"); 3472 # subdir to keep if recursive mode, empty by default 3473 my $subdir = shift || ""; 3474 3475 pb_log(2,"DEBUG: entering pb_list_bfiles in $dir: ".Dumper($bfiles)."\n"); 3454 3476 opendir(BDIR,"$dir") || die "Unable to open dir $dir: $!"; 3455 3477 foreach my $f (readdir(BDIR)) { 3478 pb_log(3,"DEBUG: pb_list_bfiles found $f\n"); 3456 3479 next if ($f =~ /^\./); 3457 if (-d $f) {3480 if (-d "$dir/$f") { 3458 3481 # Recurse for directories (Debian 3.0 format e.g.) 3459 pb_list_bfiles($f,$pbpkg,$bfiles,$pkgfiles,$supfiles); 3482 pb_log(2,"DEBUG: pb_list_bfiles recurse in $dir/$f\n"); 3483 pb_list_bfiles("$dir/$f",$pbpkg,$bfiles,$pkgfiles,$supfiles,$f); 3460 3484 next; 3461 3485 } 3462 $bfiles->{$f} = "$dir/$f"; 3463 $bfiles->{$f} =~ s~$ENV{'PBROOTDIR'}~~; 3486 3487 my $key = $f; 3488 # if recursive then store also the subdir 3489 $key = "$subdir/$f" if ($subdir ne ""); 3490 $bfiles->{$key} = "$dir/$f"; 3491 $bfiles->{$key} =~ s~$ENV{'PBROOTDIR'}~~; 3464 3492 if (defined $supfiles->{$pbpkg}) { 3465 $pkgfiles->{$ f} = "$dir/$f" if ($f =~ /$supfiles->{$pbpkg}/);3493 $pkgfiles->{$key} = "$dir/$f" if ($f =~ /$supfiles->{$pbpkg}/); 3466 3494 } 3467 3495 }
Note:
See TracChangeset
for help on using the changeset viewer.