From a5537943fa51b318a9a6955f7b86986bc6d13453 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Tue, 5 Jan 2021 14:30:05 -0500 Subject: [PATCH] keep original dpkg md5sum location Signed-off-by: Alex Goodman --- syft/cataloger/deb/cataloger.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/syft/cataloger/deb/cataloger.go b/syft/cataloger/deb/cataloger.go index 3efc3979f..fb666b69e 100644 --- a/syft/cataloger/deb/cataloger.go +++ b/syft/cataloger/deb/cataloger.go @@ -109,15 +109,12 @@ func fetchMd5Contents(resolver source.Resolver, dbLocation source.Location, pkgs for _, p := range pkgs { // look for /var/lib/dpkg/info/NAME:ARCH.md5sums name := md5Key(p) - md5sumPath := path.Join(parentPath, "info", name+md5sumsExt) - md5SumLocation := resolver.RelativeFileByPath(dbLocation, md5sumPath) + md5SumLocation := resolver.RelativeFileByPath(dbLocation, path.Join(parentPath, "info", name+md5sumsExt)) if md5SumLocation == nil { // the most specific key did not work, fallback to just the name // look for /var/lib/dpkg/info/NAME.md5sums - name = p.Name - md5sumPath = path.Join(parentPath, "info", name+md5sumsExt) - md5SumLocation = resolver.RelativeFileByPath(dbLocation, md5sumPath) + md5SumLocation = resolver.RelativeFileByPath(dbLocation, path.Join(parentPath, "info", p.Name+md5sumsExt)) } // we should have at least one reference if md5SumLocation != nil {