Track transitive packaged license deps of containers

Containers generally package the transitive installable
dependencies of their direct dependencies, track them as license
deps.

Bug: 207445310
Test: m checkbuild
Change-Id: Ic8640152cee0e0cfec5e85a1649a8adfd29d517a
This commit is contained in:
Colin Cross
2022-01-12 10:57:57 -08:00
parent 0107901dec
commit aff21fbf3c
2 changed files with 44 additions and 12 deletions

View File

@@ -2149,3 +2149,23 @@ func IsThirdPartyPath(path string) bool {
}
return false
}
// PathsDepSet is a thin type-safe wrapper around the generic depSet. It always uses
// topological order.
type PathsDepSet struct {
depSet
}
// newPathsDepSet returns an immutable PathsDepSet with the given direct and
// transitive contents.
func newPathsDepSet(direct Paths, transitive []*PathsDepSet) *PathsDepSet {
return &PathsDepSet{*newDepSet(TOPOLOGICAL, direct, transitive)}
}
// ToList returns the PathsDepSet flattened to a list in topological order.
func (d *PathsDepSet) ToList() Paths {
if d == nil {
return nil
}
return d.depSet.ToList().(Paths)
}