From 325ade2c613e2cbf4564a8e7f8b8304a82efde4c Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sat, 8 Jul 2006 00:30:47 -0700 Subject: [PATCH] * Merge changes to add a source version cache from Sesse --- cgi/common.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cgi/common.pl b/cgi/common.pl index 4c64ad6..82f3ef3 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -892,6 +892,7 @@ sub buglog { # named source package. This is used to cope with source packages whose # names have changed during their history, and with cases where source # version numbers differ from binary version numbers. +my %_sourceversioncache = (); sub makesourceversions { my $pkg = shift; my $arch = shift; @@ -902,6 +903,15 @@ sub makesourceversions { # Already a source version. $sourceversions{$version} = 1; } else { + my $cachearch = (defined $arch) ? $arch : ''; + my $cachekey = "$pkg/$cachearch/$version"; + if (exists($_sourceversioncache{$cachekey})) { + for my $v (@{$_sourceversioncache{$cachekey}}) { + $sourceversions{$v} = 1; + } + next; + } + my @srcinfo = binarytosource($pkg, $version, $arch); unless (@srcinfo) { # We don't have explicit information about the @@ -922,6 +932,7 @@ sub makesourceversions { } } $sourceversions{"$_->[0]/$_->[1]"} = 1 foreach @srcinfo; + $_sourceversioncache{$cachekey} = [ map { "$_->[0]/$_->[1]" } @srcinfo ]; } } -- 2.39.2