diff --git a/pkg/fanal/analyzer/pkg/dpkg/dpkg.go b/pkg/fanal/analyzer/pkg/dpkg/dpkg.go index ac6ec0983b59..16b8ec44815d 100644 --- a/pkg/fanal/analyzer/pkg/dpkg/dpkg.go +++ b/pkg/fanal/analyzer/pkg/dpkg/dpkg.go @@ -17,6 +17,7 @@ import ( debVersion "github.com/knqyf263/go-deb-version" "github.com/samber/lo" "go.uber.org/zap" + "golang.org/x/exp/slices" "golang.org/x/xerrors" dio "github.com/aquasecurity/go-dep-parser/pkg/io" @@ -294,8 +295,11 @@ func (a dpkgAnalyzer) parseDepends(s string) []string { for _, d := range strings.Split(dep, "|") { d = a.trimVersionRequirement(d) - // Store only package names here - dependencies = append(dependencies, strings.TrimSpace(d)) + // Store only uniq package names here + d = strings.TrimSpace(d) + if !slices.Contains(dependencies, d) { + dependencies = append(dependencies, d) + } } } return dependencies diff --git a/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go b/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go index 39d692a4bad8..af49cb753075 100644 --- a/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go +++ b/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go @@ -190,7 +190,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { Version: "1.19.0.5ubuntu2", SrcName: "dpkg", SrcVersion: "1.19.0.5ubuntu2", - DependsOn: []string{"tar@1.29b-2"}, + DependsOn: []string{ + "tar@1.29b-2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -272,7 +274,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "grep", SrcVersion: "3.1", SrcRelease: "2", - DependsOn: []string{"dpkg@1.19.0.5ubuntu2"}, + DependsOn: []string{ + "dpkg@1.19.0.5ubuntu2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -284,7 +288,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "gzip", SrcVersion: "1.6", SrcRelease: "5ubuntu1", - DependsOn: []string{"dpkg@1.19.0.5ubuntu2"}, + DependsOn: []string{ + "dpkg@1.19.0.5ubuntu2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -303,7 +309,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { Version: "1.51", SrcName: "init-system-helpers", SrcVersion: "1.51", - DependsOn: []string{"perl-base@5.26.1-6ubuntu0.2"}, + DependsOn: []string{ + "perl-base@5.26.1-6ubuntu0.2", + }, Maintainer: "Ubuntu Developers ", Arch: "all", }, @@ -352,7 +360,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcEpoch: 1, SrcVersion: "2.4.47", SrcRelease: "2build1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -410,7 +420,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "bzip2", SrcVersion: "1.0.6", SrcRelease: "8.1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -424,7 +436,6 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcRelease: "3ubuntu1", DependsOn: []string{ "libc6@2.27-3ubuntu1", - "libc6@2.27-3ubuntu1", }, Maintainer: "Ubuntu Developers ", Arch: "amd64", @@ -437,7 +448,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "glibc", SrcVersion: "2.27", SrcRelease: "3ubuntu1", - DependsOn: []string{"libgcc1@1:8-20180414-1ubuntu2"}, + DependsOn: []string{ + "libgcc1@1:8-20180414-1ubuntu2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -449,7 +462,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libcap-ng", SrcVersion: "0.7.7", SrcRelease: "3.1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -461,7 +476,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "e2fsprogs", SrcVersion: "1.44.1", SrcRelease: "1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -473,7 +490,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "db5.3", SrcVersion: "5.3.28", SrcRelease: "13.1ubuntu1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -483,7 +502,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { Version: "0.213ubuntu1", SrcName: "cdebconf", SrcVersion: "0.213ubuntu1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -495,7 +516,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "e2fsprogs", SrcVersion: "1.44.1", SrcRelease: "1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -507,9 +530,11 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "util-linux", SrcVersion: "2.31.1", SrcRelease: "0.4ubuntu3.1", - DependsOn: []string{"libblkid1@2.31.1-0.4ubuntu3.1", + DependsOn: []string{ + "libblkid1@2.31.1-0.4ubuntu3.1", "libc6@2.27-3ubuntu1", - "libuuid1@2.31.1-0.4ubuntu3.1"}, + "libuuid1@2.31.1-0.4ubuntu3.1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -521,7 +546,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libffi", SrcVersion: "3.2.1", SrcRelease: "8", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -566,7 +593,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcEpoch: 2, SrcVersion: "6.1.2+dfsg", SrcRelease: "2", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -578,7 +607,8 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "gnutls28", SrcVersion: "3.5.18", SrcRelease: "1ubuntu1", - DependsOn: []string{"libc6@2.27-3ubuntu1", + DependsOn: []string{ + "libc6@2.27-3ubuntu1", "libgmp10@2:6.1.2+dfsg-2", "libhogweed4@3.4-1", "libidn2-0@2.0.4-1.1build2", @@ -586,7 +616,8 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { "libp11-kit0@0.23.9-2", "libtasn1-6@4.13-2", "libunistring2@0.9.9-0ubuntu1", - "zlib1g@1:1.2.11.dfsg-0ubuntu2"}, + "zlib1g@1:1.2.11.dfsg-0ubuntu2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -598,7 +629,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libgpg-error", SrcVersion: "1.27", SrcRelease: "6", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -610,9 +643,11 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "nettle", SrcVersion: "3.4", SrcRelease: "1", - DependsOn: []string{"libc6@2.27-3ubuntu1", + DependsOn: []string{ + "libc6@2.27-3ubuntu1", "libgmp10@2:6.1.2+dfsg-2", - "libnettle6@3.4-1"}, + "libnettle6@3.4-1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -624,8 +659,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libidn2", SrcVersion: "2.0.4", SrcRelease: "1.1build2", - DependsOn: []string{"libc6@2.27-3ubuntu1", - "libunistring2@0.9.9-0ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + "libunistring2@0.9.9-0ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -637,7 +674,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "lz4", SrcVersion: "0.0~r131", SrcRelease: "2ubuntu3", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -649,7 +688,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "xz-utils", SrcVersion: "5.1.1alpha+20120614", SrcRelease: "2", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Jonathan Nieder ", Arch: "amd64", }, @@ -661,9 +702,11 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "util-linux", SrcVersion: "2.31.1", SrcRelease: "0.4ubuntu3.1", - DependsOn: []string{"libblkid1@2.31.1-0.4ubuntu3.1", + DependsOn: []string{ + "libblkid1@2.31.1-0.4ubuntu3.1", "libc6@2.27-3ubuntu1", - "libselinux1@2.7-2build2"}, + "libselinux1@2.7-2build2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -675,8 +718,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "ncurses", SrcVersion: "6.1", SrcRelease: "1ubuntu1.18.04", - DependsOn: []string{"libc6@2.27-3ubuntu1", - "libtinfo5@6.1-1ubuntu1.18.04"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + "libtinfo5@6.1-1ubuntu1.18.04", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -688,8 +733,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "ncurses", SrcVersion: "6.1", SrcRelease: "1ubuntu1.18.04", - DependsOn: []string{"libc6@2.27-3ubuntu1", - "libtinfo5@6.1-1ubuntu1.18.04"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + "libtinfo5@6.1-1ubuntu1.18.04", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -701,7 +748,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "nettle", SrcVersion: "3.4", SrcRelease: "1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -713,8 +762,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "p11-kit", SrcVersion: "0.23.9", SrcRelease: "2", - DependsOn: []string{"libc6@2.27-3ubuntu1", - "libffi6@3.2.1-8"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + "libffi6@3.2.1-8", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -737,10 +788,12 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "pam", SrcVersion: "1.1.8", SrcRelease: "3.6ubuntu2", - DependsOn: []string{"libaudit1@1:2.8.2-1ubuntu1", + DependsOn: []string{ + "libaudit1@1:2.8.2-1ubuntu1", "libc6@2.27-3ubuntu1", "libpam0g@1.1.8-3.6ubuntu2", - "libselinux1@2.7-2build2"}, + "libselinux1@2.7-2build2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -752,9 +805,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "pam", SrcVersion: "1.1.8", SrcRelease: "3.6ubuntu2", - DependsOn: []string{"debconf@1.5.66", + DependsOn: []string{ "debconf@1.5.66", - "libpam-modules@1.1.8-3.6ubuntu2"}, + "libpam-modules@1.1.8-3.6ubuntu2", + }, Maintainer: "Ubuntu Developers ", Arch: "all", }, @@ -766,9 +820,11 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "pam", SrcVersion: "1.1.8", SrcRelease: "3.6ubuntu2", - DependsOn: []string{"debconf@1.5.66", + DependsOn: []string{ + "debconf@1.5.66", "libaudit1@1:2.8.2-1ubuntu1", - "libc6@2.27-3ubuntu1"}, + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -782,7 +838,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcVersion: "8.39", SrcEpoch: 2, SrcRelease: "9", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -796,8 +854,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcVersion: "3.3.12", SrcRelease: "3ubuntu1.1", SrcEpoch: 2, - DependsOn: []string{"libc6@2.27-3ubuntu1", - "libsystemd0@237-3ubuntu10.3"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + "libsystemd0@237-3ubuntu10.3", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -809,7 +869,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libseccomp", SrcVersion: "2.3.1", SrcRelease: "2.1ubuntu4", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -821,8 +883,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libselinux", SrcVersion: "2.7", SrcRelease: "2build2", - DependsOn: []string{"libc6@2.27-3ubuntu1", - "libpcre3@2:8.39-9"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + "libpcre3@2:8.39-9", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -845,12 +909,14 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libsemanage", SrcVersion: "2.7", SrcRelease: "2build2", - DependsOn: []string{"libaudit1@1:2.8.2-1ubuntu1", + DependsOn: []string{ + "libaudit1@1:2.8.2-1ubuntu1", "libbz2-1.0@1.0.6-8.1", "libc6@2.27-3ubuntu1", "libselinux1@2.7-2build2", "libsemanage-common@2.7-2build2", - "libsepol1@2.7-1"}, + "libsepol1@2.7-1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -862,7 +928,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libsepol", SrcVersion: "2.7", SrcRelease: "1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -874,7 +942,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "util-linux", SrcVersion: "2.31.1", SrcRelease: "0.4ubuntu3.1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -886,8 +956,10 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "e2fsprogs", SrcVersion: "1.44.1", SrcRelease: "1", - DependsOn: []string{"libc6@2.27-3ubuntu1", - "libcom-err2@1.44.1-1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + "libcom-err2@1.44.1-1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -899,9 +971,11 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "gcc-8", SrcVersion: "8-20180414", SrcRelease: "1ubuntu2", - DependsOn: []string{"gcc-8-base@8-20180414-1ubuntu2", + DependsOn: []string{ + "gcc-8-base@8-20180414-1ubuntu2", "libc6@2.27-3ubuntu1", - "libgcc1@1:8-20180414-1ubuntu2"}, + "libgcc1@1:8-20180414-1ubuntu2", + }, Maintainer: "Ubuntu Core developers ", Arch: "amd64", }, @@ -924,7 +998,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libtasn1-6", SrcVersion: "4.13", SrcRelease: "2", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -936,7 +1012,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "ncurses", SrcVersion: "6.1", SrcRelease: "1ubuntu1.18.04", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -948,7 +1026,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "systemd", SrcVersion: "237", SrcRelease: "3ubuntu10.3", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -960,7 +1040,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libunistring", SrcVersion: "0.9.9", SrcRelease: "0ubuntu1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -972,7 +1054,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "ustr", SrcVersion: "1.0.4", SrcRelease: "3", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Vaclav Ovsik ", Arch: "amd64", }, @@ -984,7 +1068,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "util-linux", SrcVersion: "2.31.1", SrcRelease: "0.4ubuntu3.1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -996,7 +1082,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "libzstd", SrcVersion: "1.3.3+dfsg", SrcRelease: "2ubuntu1", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -1041,7 +1129,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "util-linux", SrcVersion: "2.31.1", SrcRelease: "0.4ubuntu3.1", - DependsOn: []string{"util-linux@2.31.1-0.4ubuntu3.1"}, + DependsOn: []string{ + "util-linux@2.31.1-0.4ubuntu3.1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -1077,12 +1167,14 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcEpoch: 1, SrcVersion: "4.5", SrcRelease: "1ubuntu1", - DependsOn: []string{"libaudit1@1:2.8.2-1ubuntu1", + DependsOn: []string{ + "libaudit1@1:2.8.2-1ubuntu1", "libc6@2.27-3ubuntu1", "libpam-modules@1.1.8-3.6ubuntu2", "libpam0g@1.1.8-3.6ubuntu2", "libselinux1@2.7-2build2", - "libsemanage1@2.7-2build2"}, + "libsemanage1@2.7-2build2", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -1107,13 +1199,15 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcEpoch: 2, SrcVersion: "3.3.12", SrcRelease: "3ubuntu1.1", - DependsOn: []string{"init-system-helpers@1.51", + DependsOn: []string{ + "init-system-helpers@1.51", "libc6@2.27-3ubuntu1", "libncurses5@6.1-1ubuntu1.18.04", "libncursesw5@6.1-1ubuntu1.18.04", "libprocps6@2:3.3.12-3ubuntu1.1", "libtinfo5@6.1-1ubuntu1.18.04", - "lsb-base@9.20170808ubuntu1"}, + "lsb-base@9.20170808ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -1145,9 +1239,11 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "sysvinit", SrcVersion: "2.88dsf", SrcRelease: "59.10ubuntu1", - DependsOn: []string{"init-system-helpers@1.51", + DependsOn: []string{ + "init-system-helpers@1.51", "libc6@2.27-3ubuntu1", - "util-linux@2.31.1-0.4ubuntu3.1"}, + "util-linux@2.31.1-0.4ubuntu3.1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -1179,7 +1275,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcName: "util-linux", SrcVersion: "2.31.1", SrcRelease: "0.4ubuntu3.1", - DependsOn: []string{"fdisk@2.31.1-0.4ubuntu3.1"}, + DependsOn: []string{ + "fdisk@2.31.1-0.4ubuntu3.1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", }, @@ -1193,7 +1291,9 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { SrcEpoch: 1, SrcVersion: "1.2.11.dfsg", SrcRelease: "0ubuntu2", - DependsOn: []string{"libc6@2.27-3ubuntu1"}, + DependsOn: []string{ + "libc6@2.27-3ubuntu1", + }, Maintainer: "Ubuntu Developers ", Arch: "amd64", },