- Timestamp:
- Mar 25, 2011, 2:42:28 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1281 r1282 844 844 # except if a target was given, in which case we only build for it 845 845 my $pbos = pb_distro_get_context($pbtarget); 846 my $tmpl = "$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'},"; 847 848 # Get list of distributions for which we need to generate build files if no target 849 if (not defined ($pbtarget)) { 850 my @pt = pb_conf_get_if("vmlist","velist","rmlist"); 851 if (defined $pt[0]->{$ENV{'PBPROJ'}}) { 852 $tmpl .= $pt[0]->{$ENV{'PBPROJ'}}; 853 } 854 if (defined $pt[1]->{$ENV{'PBPROJ'}}) { 855 # The 2 lists needs to be grouped with a ',' separating them 856 if ($tmpl ne "") { 857 $tmpl .= ","; 858 } 859 $tmpl .= $pt[1]->{$ENV{'PBPROJ'}} 860 } 861 if (defined $pt[2]->{$ENV{'PBPROJ'}}) { 862 # The lists needs to be grouped with a ',' separating them 863 if ($tmpl ne "") { 864 $tmpl .= ","; 865 } 866 $tmpl .= $pt[2]->{$ENV{'PBPROJ'}} 867 } 868 } 869 846 my $tmpl = pb_get_distros($pbos,$pbtarget); 847 870 848 # Setup $pb structure to allow filtering later on, on files using that structure 871 849 $pb->{'tag'} = $pbtag; … … 3254 3232 # Get all required parameters 3255 3233 my ($pbpackager,$pbrepo,$pbml,$pbsmtp) = pb_conf_get("pbpackager","pbrepo","pbml","pbsmtp"); 3256 my ($pkgv, $pkgt , $testver) = pb_conf_get_if("pkgver","pkgtag","testver");3234 my ($pkgv, $pkgt) = pb_conf_get_if("pkgver","pkgtag"); 3257 3235 my $pkg = pb_cms_get_pkg($defpkgdir,$extpkgdir); 3258 3236 my @pkgs = @$pkg; … … 3260 3238 my $first = 0; 3261 3239 3240 # Get all distros concerned 3241 my $pbos = pb_distro_get_context(); 3242 my $distrolist = pb_get_distros($pbos,undef); 3243 my %dl; 3244 foreach my $d (split(/,/,$distrolist)) { 3245 my ($d1,$d2, $d3) = split(/-/,$d); 3246 $dl{$d1}++; 3247 } 3248 3262 3249 # Command to find packages on repo 3263 my $findstr = "find .";3250 my $findstr = "find ".join(" ",keys %dl)." "; 3264 3251 # Generated announce files 3265 3252 my @files; … … 3282 3269 3283 3270 # TODO: use virtual/real names here now 3284 $findstr .= "-name \'$pbpkg-$pbver-$pbtag\.*.rpm\' -o -name \'$pbpkg"."_$pbver*\.deb\' -o -name \'$pbpkg-$pbver*\.ebuild\' -o -name \'$pbpkg-$pbver*\.pkg\' -o -name \'$pbpkg-$pbver*\.sd\' ";3271 $findstr .= "-name \'$pbpkg-$pbver-$pbtag\.*.rpm\' -o -name \'$pbpkg"."_$pbver*\.deb\' -o -name \'$pbpkg-$pbver*\.ebuild\' -o -name \'$pbpkg-$pbver*\.pkg\' -o -name \'$pbpkg-$pbver*\.sd\' "; 3285 3272 3286 3273 my $chglog; … … 3312 3299 # Prepare the command to run and execute it 3313 3300 open(PBS,"> $ENV{'PBTMP'}/pbscript") || die "Unable to create $ENV{'PBTMP'}/pbscript"; 3301 print PBS "set -x\n" if ($pbdebug gt 1); 3314 3302 print PBS "$findstr\n"; 3315 3303 close(PBS); … … 3854 3842 } 3855 3843 3844 # return list of all distributins supported, coma separated 3845 sub pb_get_distros { 3846 3847 my $pbos = shift; 3848 my $pbtarget = shift; 3849 3850 my $tmpl = "$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'},"; 3851 3852 # Get list of distributions for which we need to generate build files if no target 3853 if (not defined ($pbtarget)) { 3854 my @pt = pb_conf_get_if("vmlist","velist","rmlist"); 3855 if (defined $pt[0]->{$ENV{'PBPROJ'}}) { 3856 $tmpl .= $pt[0]->{$ENV{'PBPROJ'}}; 3857 } 3858 if (defined $pt[1]->{$ENV{'PBPROJ'}}) { 3859 # The 2 lists needs to be grouped with a ',' separating them 3860 if ($tmpl ne "") { 3861 $tmpl .= ","; 3862 } 3863 $tmpl .= $pt[1]->{$ENV{'PBPROJ'}} 3864 } 3865 if (defined $pt[2]->{$ENV{'PBPROJ'}}) { 3866 # The lists needs to be grouped with a ',' separating them 3867 if ($tmpl ne "") { 3868 $tmpl .= ","; 3869 } 3870 $tmpl .= $pt[2]->{$ENV{'PBPROJ'}} 3871 } 3872 } 3873 return($tmpl); 3874 } 3875 3856 3876 1;
Note:
See TracChangeset
for help on using the changeset viewer.