image dep calculation
authorAnas Nashif <anas.nashif@intel.com>
Tue, 24 Jul 2012 03:49:01 +0000 (04:49 +0100)
committerAnas Nashif <anas.nashif@intel.com>
Tue, 24 Jul 2012 03:49:01 +0000 (04:49 +0100)
Change-Id: I2e5b78e7118a2a2d55d33b56cf4a48c8475567ed

depanneur

index dc855cf22e5204ff06c8fe00bc9ac75d58041e03..3e888558cf65970d5748faea50ece7ac9d010631 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -515,29 +515,16 @@ if ($binarylist ne "" && -e $binarylist ) {
     chomp(@bins);
     close(FILE);
     foreach my $b (@bins) {
-        next if $b eq "";
-        my $found = 0;
-        foreach my $name (keys %packs) {
-            my @sp = @{$packs{$name}->{subpacks}};
-            my $debuginfo = $b;
-            my $nb;
-            $debuginfo =~ s/(.*)-debuginfo/$1/;
-            $debuginfo =~ s/(.*)-debugsource/$1/;
-            $debuginfo =~ s/(.*)-docs/$1/;
-            if ($b ne $debuginfo) { 
-                $nb = $debuginfo;
-            } else {
-                $nb = $b;
+        open(EXPAND,"$virtualenv/usr/bin/do_expanddeps --dist $dist --depfile $order_dir/.repo.cache --archpath $archpath --configdir $dist_configs \"$b\" |") || die "Failed: $!\n";
+        while ( <EXPAND> ) {
+            chomp;
+            my $ddep = $_;
+            my $so = source_of($ddep, %packs);
+            if ( defined($so) && !(grep $_ eq $so, @tobuild)) {
+                push(@tobuild, $so);
             }
-            if ( grep $_ eq $nb, @sp ) {
-                push(@tobuild, $name);
-                $found = 1 ;
-                last;
-            } 
-        }
-        if (!$found) {
-            push(@tofind, $b);
-        }
+        } 
+        close(EXPAND);
     }
 
     print "Initial set:\n";
@@ -545,29 +532,6 @@ if ($binarylist ne "" && -e $binarylist ) {
         print "$p, ";
     }
     print "\n";
-    foreach my $p (@tobuild) {
-        my @deps = @{$packs{$p}->{deps}};    
-        foreach my $dep (@deps) {
-            debug($dep);
-            foreach my $prr (keys %repo_assist) {
-                debug("=> " . $prr);
-                $dep =~ m/([^\s]+)/;
-                if (grep $_ eq $1, @{$repo_assist{$prr}->{provides}}) {
-                    my $mainp = source_of($1, %packs);
-                    if (defined($mainp)) {
-                        debug("adding $mainp because $p needs it");
-                        push(@tobuild, $mainp);
-                    }
-                }
-            }
-        }
-    }
-    debug("done");
-    print "Improved set:\n";
-    foreach my $p (@tobuild) {
-        print "$p, ";
-    }
-    print "\n";
 
     foreach my $name (@tobuild) {
         my $fn = $packs{$name}->{filename};