From: Junfeng Dong Date: Fri, 14 Sep 2012 05:43:15 +0000 (+0800) Subject: Handle the temporarily expansion error. X-Git-Tag: 0.1~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f4e53f03d1f33c76e747f36c8a4110d34e7b4b0;p=tools%2Fdepanneur.git Handle the temporarily expansion error. Two kinds of expansion errors: 1. Real error: can't be resolved by both remote repo and local source. 2. Temporary error: will be satified by local source. Change-Id: I7279648fdac73644fbbe92c2440af5c9f52d4585 --- diff --git a/depanneur b/depanneur index 5337634..95e6f46 100755 --- a/depanneur +++ b/depanneur @@ -110,6 +110,7 @@ my @original_specs = (); my @cleaned : shared = (); my @errors :shared; my @expansion_errors = (); +my @tmp_expansion_errors = (); my $packages_built :shared = 0; my %workers = (); @@ -663,7 +664,7 @@ sub source_of { sub update_pkgdeps() { - @expansion_errors = (); + @tmp_expansion_errors = (); foreach my $name (keys %to_build) { if(! (grep $_ eq $name, @skipped)) { my $fn = $to_build{$name}->{filename}; @@ -672,7 +673,7 @@ sub update_pkgdeps() if (!shift @bdeps ) { debug("expansion error"); debug(" $_") for @bdeps; - push @expansion_errors, $name; + push @tmp_expansion_errors, $name; next; } my @deps; @@ -1038,6 +1039,16 @@ while (! $TERM) { last; } + # No candidate packges and all thread works are idle, and pkgdeps + # is updated, in this case, set packages in @tmp_expansion_errors + # as real expansion_errors, and all packages depend on these packages + # can not be blocked. + if (@order == 0 && threads->list() == 0 && $dirty == 0) { + foreach my $pkg (@tmp_expansion_errors) { + push @expansion_errors, $pkg if (! (grep $_ eq $pkg, @expansion_errors)); + } + } + if (@order == 0) { # Waiting thread workers done, then re-calculate ready packages sleep(1);