Changeset 44779


Ignore:
Timestamp:
2015-03-15T12:07:57+01:00 (3 years ago)
Author:
nbd
Message:

scripts/feeds: get rid of redundant feed cache copy

Signed-off-by: Felix Fietkau <nbd@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/feeds

    r44778 r44779  
    367367} 
    368368 
    369 my %feed; 
    370  
    371369sub lookup_package($$) { 
    372370        my $feed = shift; 
     
    375373        foreach my $feed ($feed, @feeds) { 
    376374                next unless $feed->[1]; 
    377                 next unless $feed{$feed->[1]}; 
    378                 $feed{$feed->[1]}->{$package} and return $feed; 
     375                next unless $feed_cache{$feed->[1]}; 
     376                $feed_cache{$feed->[1]}->[0]->{$package} and return $feed; 
    379377        } 
    380378        return; 
     
    405403 
    406404        # switch to the metadata for the selected feed 
    407         get_feed($feed->[1]); 
    408  
    409         my $pkg = $feed{$feed->[1]}->{$name} or return 1; 
     405        my $cur = get_feed($feed->[1]); 
     406 
     407        my $pkg = $cur->{$name} or return 1; 
    410408        $pkg->{name} or do { 
    411409                $installed{$name} and return 0; 
     
    489487 
    490488        foreach my $f (@feeds) { 
    491                 # index all feeds 
    492                 $feed{$f->[1]} = get_feed($f->[1]); 
     489                # fetch all feeds 
     490                get_feed($f->[1]); 
    493491 
    494492                # look up the preferred feed 
Note: See TracChangeset for help on using the changeset viewer.