소스 검색

fix revdep search

Michael van Elst 22 년 전
부모
커밋
a73d2d0539
2개의 변경된 파일33개의 추가작업 그리고 20개의 파일을 삭제
  1. 31 18
      openpkg-tool/openpkg-build.pl
  2. 2 2
      openpkg-tool/openpkg-tool.spec

+ 31 - 18
openpkg-tool/openpkg-build.pl

@@ -520,14 +520,15 @@ sub get_revdep ($$) {
     my($env, $i) = @_;
     my($r) = $env->{'repository'};
     my($pkg, %dep, %dlist, %rev);
-    my(@vers,$t,$t1,$with,$name);
-    my($d,$k,%d,$old,%name);
+    my(@vers,$t,$t1,$t2,$with,$name,$vmap);
+    my($d,$k,%d,$old,%name,%pkg);
 
     print "# computing reverse dependencies\n";
 
     foreach $pkg (keys %$i) {
 
-        unless ($r->{$pkg}) {
+        $vmap = $r->{$pkg};
+        unless ($vmap) {
             print "# ATTENTION: $pkg has no upgrade path\n";
             next;
         }
@@ -546,17 +547,25 @@ sub get_revdep ($$) {
                 $k = target_attribute($t, $env, 'keeps', $with);
                 next unless @$d || @$k;
                 %d = unique_map($d,$k);
+                # resolve package
+                unless (exists $pkg{$pkg}) {
+                    ($t2,$old) = dep2target({ name => $pkg }, $env);
+                    $t2 = undef if $old;
+                    $pkg{$pkg} = undef;
+                }
+                $t2 = $pkg{$pkg};
+                next unless $t2;
                 foreach (keys %d) {
                     next if $_ eq 'OpenPKG';
                     # resolve target
-                    unless ($name{$_}) {
+                    unless (exists $name{$_}) {
                         ($t1,$old) = dep2target($d{$_}, $env);
                         $name{$_} = $t1 ? $t1->{name} : $_;
                     }
                     $name = $name{$_};
                     unless ($dep{$name}{$t->{name}}) {
                         $dep{$name}{$t->{name}} = 1;
-                        push @{$dlist{$name}}, $t;
+                        push @{$dlist{$name}}, $t2;
                     }
                 }
             }
@@ -1714,10 +1723,6 @@ sub make_dep ($$$$$$$) {
     # see if a target is already installed and requires a rebuild
     #
     if ($t = find_target($target->{name}, $env->{installed})) {
-        if (!exists $env->{repository}->{$target->{name}}) {
-            print "# excluding $target->{name} (no upgrade path)\n";
-            return;
-        }
         if (exists $env->{exclude}->{$target->{name}}) {
             print "# excluding $target->{name} (no upgrade allowed)\n";
             return;
@@ -1787,13 +1792,9 @@ sub make_dep ($$$$$$$) {
                     if ($t->{LIMBO}) {
                         print "# ATTENTION: ".vsn($t)." is in LIMBO\n";
                     }
-                } elsif ($k{$_}) {
-                    push @$blist,$t;
-                    print "# $target->{name} installs ".vsn($t)." for $_\n";
-                } else {
-                    print "# $target->{name} requires ".vsn($t)." for $_\n";
+                    next;
                 }
-
+                
                 unless (depend_option($t, $d{$_}, $env)) {
                     print "# $target->{name} has conflicting requirement\n";
                     push(@{$env->{fatal}},vsn($target));
@@ -1803,6 +1804,13 @@ sub make_dep ($$$$$$$) {
                     next;
                 }
 
+                if ($k{$_}) {
+                    push @$blist,$t;
+                    print "# $target->{name} installs ".vsn($t)." for $_\n";
+                } else {
+                    print "# $target->{name} requires ".vsn($t)." for $_\n";
+                }
+
                 push @deps, $t;
             } else {
                 print "# $target->{name} searches a frood called '$_'\n";
@@ -1824,19 +1832,21 @@ sub make_dep ($$$$$$$) {
     $target->{WHO} = $who;
     $target->{WHY} = $target->{STATUS};
     push(@$list, $target);
-    $target->{LIMBO} = 0;
-     
+
     # remember new options
     override_options(get_with($target),
                      name_with($target->{name}, $env->{with}),
                      '');
 
+    # moan about non-source packages
     foreach (@{target_nosource($target,$env)}) {
         my($p) = target_source($target,$env)->[$_];
         $p =~ s/.*\///;
         print "# ATTENTION: unpackaged source $_: $p\n";
     }
 
+    $target->{LIMBO} = 0;
+
     #
     # a dependency could not be resolved, don't bother with reverse
     # dependencies for this target
@@ -1946,7 +1956,7 @@ sub build_list ($$) {
         if ($t) {
             warn_about_options($t, $env->{with}, $env->{config});
             $t->{GOAL} = 1;
-            push(@goals, $t);
+            push @goals, $t;
         } else {
             if ($env->{status}) {
                 print "# dropping goal '$name'\n";
@@ -2142,6 +2152,9 @@ sub print_list1 ($$$$$$$) {
 
     foreach (@$list) {
         $spkg = $_->{href};
+        unless ($spkg =~ /\S/) {
+            die "FATAL: internal error, ",vsn($_)," without source URL\n";
+        }
         $bpkg = target2rpm($_, $c);
 
 	$mywith = 

+ 2 - 2
openpkg-tool/openpkg-tool.spec

@@ -32,8 +32,8 @@ Packager:     The OpenPKG Project
 Distribution: OpenPKG [PLUS]
 Group:        Bootstrapping
 License:      GPL
-Version:      20030626
-Release:      20030626
+Version:      20030630
+Release:      20030630
 
 #   list of sources
 Source0:      openpkg.sh