aboutsummaryrefslogtreecommitdiff
path: root/SBO-Lib/lib
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-11-01 22:58:58 -0500
committerJacob Pipkin <j@dawnrazor.net>2012-11-01 22:58:58 -0500
commitda74382cb1def30948c8170ccc1ff5da47f05a66 (patch)
treed77f0fa2469af1413fafce31979c4597e32082b1 /SBO-Lib/lib
parent8f208049f7d28c03ac64a9a0246a75767b03e065 (diff)
downloadsbotools2-da74382cb1def30948c8170ccc1ff5da47f05a66.tar.xz
but fix to state $temp_queue where had an empty element at end, label for loop in get_build_queue, use unshift in add_to_queue instead of reversing array in get_build_queue, label for loop in add_to_queue
Diffstat (limited to 'SBO-Lib/lib')
-rw-r--r--SBO-Lib/lib/SBO/Lib.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm
index c8b844c..24fae5f 100644
--- a/SBO-Lib/lib/SBO/Lib.pm
+++ b/SBO-Lib/lib/SBO/Lib.pm
@@ -733,12 +733,12 @@ sub add_to_queue ($) {
my $args = shift;
my $sbo = \${$args}{NAME};
return unless $$sbo;
- push(@{$args}{QUEUE}, $$sbo);
+ unshift @$args{QUEUE}, $$sbo;
my $location = get_sbo_location $$sbo;
return unless $location;
my $requires = get_from_info (LOCATION => $location, GET => 'REQUIRES');
- for my $req (@$requires) {
- next if $req eq $$sbo;
+ FIRST: for my $req (@$requires) {
+ next FIRST if $req eq $$sbo;
if ($req eq "%README%") {
${$args}{WARNINGS}{$$sbo}="%README%";
} else {
@@ -752,20 +752,19 @@ sub add_to_queue ($) {
sub get_build_queue ($$) {
exists $_[1] or script_error 'get_build_queue requires two arguments.';
my ($sbos, $warnings) = @_;
- state $temp_queue = [''];
- my @build_queue;
+ state $temp_queue = [()];
for my $sbo (@$sbos) {
my %args = (
- QUEUE => \@temp_queue,
+ QUEUE => $temp_queue,,
NAME => $sbo,
WARNINGS => $warnings
);
add_to_queue(\%args);
}
# Remove duplicate entries (leaving first occurrence)
- my %seen;
- for my $sb( reverse(@temp_queue) ) {
- next if $seen{ $sb }++;
+ my (%seen, @build_queue);
+ FIRST: for my $sb (@$temp_queue) {
+ next FIRST if $seen{$sb}++;
push @build_queue, $sb;
}
return \@build_queue;