diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-03-15 11:07:57 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-03-15 11:07:57 +0000 |
commit | 9ccecb891f81af7a12107b4cd63bdcbb2f32e065 (patch) | |
tree | 3bd918fa78413d61a9850ab4be4fa20f394aa0d8 /scripts | |
parent | 5f795282b5e1a6d385a26221f74eac6b6f557133 (diff) | |
download | upstream-9ccecb891f81af7a12107b4cd63bdcbb2f32e065.tar.gz upstream-9ccecb891f81af7a12107b4cd63bdcbb2f32e065.tar.bz2 upstream-9ccecb891f81af7a12107b4cd63bdcbb2f32e065.zip |
scripts/feeds: get rid of redundant feed cache copy
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44779 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/feeds | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/feeds b/scripts/feeds index 6e30b5a20f..a1795e1639 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -366,16 +366,14 @@ sub do_install_package($$) { return 0; } -my %feed; - sub lookup_package($$) { my $feed = shift; my $package = shift; foreach my $feed ($feed, @feeds) { next unless $feed->[1]; - next unless $feed{$feed->[1]}; - $feed{$feed->[1]}->{$package} and return $feed; + next unless $feed_cache{$feed->[1]}; + $feed_cache{$feed->[1]}->[0]->{$package} and return $feed; } return; } @@ -404,9 +402,9 @@ sub install_package { }; # switch to the metadata for the selected feed - get_feed($feed->[1]); + my $cur = get_feed($feed->[1]); - my $pkg = $feed{$feed->[1]}->{$name} or return 1; + my $pkg = $cur->{$name} or return 1; $pkg->{name} or do { $installed{$name} and return 0; # TODO: check if this is an alias package, maybe it's known by another name @@ -488,8 +486,8 @@ sub install { get_installed(); foreach my $f (@feeds) { - # index all feeds - $feed{$f->[1]} = get_feed($f->[1]); + # fetch all feeds + get_feed($f->[1]); # look up the preferred feed $opts{p} and $f->[1] eq $opts{p} and $feed = $f; |