This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=34ee5a06c72365df998c85820b4028519ceba5e7

commit 34ee5a06c72365df998c85820b4028519ceba5e7
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Oct 25 18:36:16 2022 +0200

    dpkg-shlibdeps: Cache soname check against shlibs files
    
    This should reduce the I/O and parsing, and more importantly the
    duplicate warnings when the library name cannot be extracted.
    
    Closes: #1022766
---
 scripts/dpkg-shlibdeps.pl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 6c8a2d3ab..557a66fd9 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -172,7 +172,8 @@ my %global_soname_notfound;
 my %global_soname_used;
 my %global_soname_needed;
 
-# Symfile and objdump caches
+# Cached data.
+my %shlibs_cache;
 my %symfile_cache;
 my %objdump_cache;
 my %symfile_has_soname_cache;
@@ -721,6 +722,10 @@ sub split_soname {
 sub extract_from_shlibs {
     my ($soname, $shlibfile) = @_;
 
+    if (exists $shlibs_cache{$shlibfile}{$soname}) {
+        return $shlibs_cache{$shlibfile}{$soname};
+    }
+
     my $shlibs_re = qr{
         ^\s*
         (?:(\S+):\s+)?              # Optional type
@@ -738,6 +743,7 @@ sub extract_from_shlibs {
     unless (defined $libname) {
        warning(g_("can't extract name and version from library name '%s'"),
                $soname);
+        $shlibs_cache{$shlibfile}{$soname} = undef;
        return;
     }
     # Open shlibs file
@@ -769,6 +775,7 @@ sub extract_from_shlibs {
        }
     }
     close($shlibs_fh);
+    $shlibs_cache{$shlibfile}{$soname} = $dep;
     return $dep;
 }
 

-- 
Dpkg.Org's dpkg

Reply via email to