Skip to content

Commit 6b3be15

Browse files
authored
feat: Add maintainer field to OS packages (#3149)
1 parent 9ebdc51 commit 6b3be15

File tree

6 files changed

+603
-498
lines changed

6 files changed

+603
-498
lines changed

pkg/fanal/analyzer/pkg/dpkg/dpkg.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func (a dpkgAnalyzer) parseDpkgPkg(scanner *bufio.Scanner) (pkg *types.Package)
126126
dependencies []string
127127
isInstalled bool
128128
sourceVersion string
129+
maintainer string
129130
)
130131
isInstalled = true
131132
for {
@@ -157,6 +158,8 @@ func (a dpkgAnalyzer) parseDpkgPkg(scanner *bufio.Scanner) (pkg *types.Package)
157158
isInstalled = a.parseStatus(line)
158159
case strings.HasPrefix(line, "Depends: "):
159160
dependencies = a.parseDepends(line)
161+
case strings.HasPrefix(line, "Maintainer: "):
162+
maintainer = strings.TrimSpace(strings.TrimPrefix(line, "Maintainer: "))
160163
}
161164
if !scanner.Scan() {
162165
break
@@ -170,10 +173,11 @@ func (a dpkgAnalyzer) parseDpkgPkg(scanner *bufio.Scanner) (pkg *types.Package)
170173
return nil
171174
}
172175
pkg = &types.Package{
173-
ID: a.pkgID(name, version),
174-
Name: name,
175-
Version: version,
176-
DependsOn: dependencies, // Will be consolidated later
176+
ID: a.pkgID(name, version),
177+
Name: name,
178+
Version: version,
179+
DependsOn: dependencies, // Will be consolidated later
180+
Maintainer: maintainer,
177181
}
178182

179183
// Source version and names are computed from binary package names and versions

0 commit comments

Comments
 (0)