Handle the temporarily expansion error.
authorJunfeng Dong <junfeng.dong@intel.com>
Fri, 14 Sep 2012 05:43:15 +0000 (13:43 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Fri, 14 Sep 2012 09:38:47 +0000 (17:38 +0800)
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

depanneur

index 5337634..95e6f46 100755 (executable)
--- 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);