Home
last modified time | relevance | path

Searched refs:lg (Results 1 – 24 of 24) sorted by relevance

/build/make/tools/compliance/
Dpolicy_shipped.go19 func ShippedNodes(lg *LicenseGraph) TargetNodeSet {
20 lg.mu.Lock()
21 shipped := lg.shippedNodes
22 lg.mu.Unlock()
29 WalkTopDown(NoEdgeContext{}, lg, func(lg *LicenseGraph, tn *TargetNode, path TargetEdgePath) bool {
44 lg.mu.Lock()
45 if lg.shippedNodes == nil {
46 lg.shippedNodes = shipped
49 shipped = lg.shippedNodes
51 lg.mu.Unlock()
Dreadgraph.go73 lg *LicenseGraph member
102 lg := newLicenseGraph()
105 lg.rootFiles = append(lg.rootFiles, f)
107 lg.rootFiles = append(lg.rootFiles, f+".meta_lic")
112 lg: lg,
124 lg.mu.Lock()
126 for _, f := range lg.rootFiles {
127 lg.targets[f] = nil
129 lg.mu.Unlock()
132 for _, f := range lg.rootFiles {
[all …]
Dpolicy_resolve.go37 func ResolveBottomUpConditions(lg *LicenseGraph) {
38 TraceBottomUpConditions(lg, AllResolutions)
45 func TraceBottomUpConditions(lg *LicenseGraph, conditionsFn TraceConditions) {
48 lg.onceBottomUp.Do(func() {
83 dcs = depConditionsPropagatingToTarget(lg, edge, dcs, treatAsAggregate)
94 for _, rname := range lg.rootFiles {
95 rnode := lg.targets[rname]
107 func ResolveTopDownConditions(lg *LicenseGraph) {
108 TraceTopDownConditions(lg, AllResolutions)
114 func TraceTopDownConditions(lg *LicenseGraph, conditionsFn TraceConditions) {
[all …]
Dpolicy_walk.go21 Context(lg *LicenseGraph, path TargetEdgePath, edge *TargetEdge) interface{}
28 func (ctx NoEdgeContext) Context(lg *LicenseGraph, path TargetEdgePath, edge *TargetEdge) interface…
39 func (ctx ApplicableConditionsContext) Context(lg *LicenseGraph, path TargetEdgePath, edge *TargetE…
44 return conditionsAttachingAcrossEdge(lg, edge, universe)
50 type VisitNode func(lg *LicenseGraph, target *TargetNode, path TargetEdgePath) bool
54 func WalkTopDown(ctx EdgeContextProvider, lg *LicenseGraph, visit VisitNode) {
59 visitChildren := visit(lg, fnode, *path)
68 edgeContext = ctx.Context(lg, *path, edge)
76 for _, r := range lg.rootFiles {
78 walk(lg.targets[r])
[all …]
Dpolicy_resolveshare.go18 func ResolveSourceSharing(lg *LicenseGraph) ResolutionSet {
19 ResolveTopDownConditions(lg)
20 return WalkResolutionsForCondition(lg, ImpliesShared)
Dpolicy_resolveprivacy.go18 func ResolveSourcePrivacy(lg *LicenseGraph) ResolutionSet {
19 ResolveTopDownConditions(lg)
20 return WalkResolutionsForCondition(lg, ImpliesPrivate)
Dpolicy_resolvenotices.go18 func ResolveNotices(lg *LicenseGraph) ResolutionSet {
19 ResolveTopDownConditions(lg)
20 return WalkResolutionsForCondition(lg, ImpliesNotice)
Dresolutionset_test.go77 lg := newLicenseGraph()
79 rsShare := toResolutionSet(lg, share)
101 rsPrivate := toResolutionSet(lg, proprietary)
120 lg := newLicenseGraph()
122 rsShare := toResolutionSet(lg, share)
126 if rsShare.AttachesToTarget(newTestNode(lg, "binc")) {
129 if !rsShare.AttachesToTarget(newTestNode(lg, "image")) {
Dtest_util.go115 func newTestNode(lg *LicenseGraph, targetName string) *TargetNode {
116 if tn, alreadyExists := lg.targets[targetName]; alreadyExists {
120 lg.targets[targetName] = tn
240 func logGraph(lg *LicenseGraph, t *testing.T) {
243 for _, target := range lg.Targets() {
248 for _, edge := range lg.Edges() {
291 func toActionSet(lg *LicenseGraph, data []act) ActionSet {
294 actsOn := newTestNode(lg, a.actsOn)
307 func toResolutionSet(lg *LicenseGraph, data []res) ResolutionSet {
310 attachesTo := newTestNode(lg, r.attachesTo)
[all …]
Dpolicy_resolveprivacy_test.go77 lg, err := toGraph(stderr, tt.roots, tt.edges)
82 expectedRs := toResolutionSet(lg, tt.expectedResolutions)
83 actualRs := ResolveSourcePrivacy(lg)
Dpolicy_resolve_test.go333 lg, err := toGraph(stderr, tt.roots, tt.edges)
339 logGraph(lg, t)
341 ResolveBottomUpConditions(lg)
342 actual := asActionList(lg)
346 expected := toActionList(lg, tt.expectedActions)
644 lg, err := toGraph(stderr, tt.roots, tt.edges)
650 logGraph(lg, t)
652 ResolveTopDownConditions(lg)
653 actual := asActionList(lg)
657 expected := toActionList(lg, tt.expectedActions)
Dpolicy_shareprivacyconflicts.go44 func ConflictingSharedPrivateSource(lg *LicenseGraph) []SourceSharePrivacyConflict {
46 ResolveTopDownConditions(lg)
48 combined := WalkActionsForCondition(lg, ImpliesShared.Union(ImpliesPrivate))
Dpolicy_shipped_test.go109 lg, err := toGraph(stderr, tt.roots, tt.edges)
115 for _, edge := range lg.Edges() {
119 nodeset := ShippedNodes(lg)
Dgraph.go76 func (lg *LicenseGraph) Edges() TargetEdgeList {
77 edges := make(TargetEdgeList, 0, len(lg.edges))
78 edges = append(edges, lg.edges...)
83 func (lg *LicenseGraph) Targets() TargetNodeList {
84 targets := make(TargetNodeList, 0, len(lg.targets))
85 for _, target := range lg.targets {
92 func (lg *LicenseGraph) TargetNames() []string {
93 targets := make([]string, 0, len(lg.targets))
94 for target := range lg.targets {
Dreadgraph_test.go90 lg, err := ReadLicenseGraph(tt.fs, stderr, tt.roots)
103 if lg == nil {
108 for _, e := range lg.Edges() {
132 for _, t := range lg.Targets() {
Dpolicy_shareprivacyconflicts_test.go100 lg, err := toGraph(stderr, tt.roots, tt.edges)
105 expectedConflicts := toConflictList(lg, tt.expectedConflicts)
106 actualConflicts := ConflictingSharedPrivateSource(lg)
Dpolicy_resolveshare_test.go265 lg, err := toGraph(stderr, tt.roots, tt.edges)
270 expectedRs := toResolutionSet(lg, tt.expectedResolutions)
271 actualRs := ResolveSourceSharing(lg)
Dpolicy_walk_test.go603 lg, err := toGraph(stderr, tt.roots, tt.edges)
608 expectedRs := toResolutionSet(lg, tt.expectedResolutions)
609 ResolveTopDownConditions(lg)
610 actualRs := WalkResolutionsForCondition(lg, tt.condition)
1196 lg, err := toGraph(stderr, tt.roots, tt.edges)
1201 expectedAs := toActionSet(lg, tt.expectedActions)
1202 ResolveTopDownConditions(lg)
1203 actualAs := WalkActionsForCondition(lg, tt.condition)
1204 checkResolvesActions(lg, actualAs, expectedAs, t)
1376 lg, err := ReadLicenseGraph(GetFS(""), stderr, rootFiles)
[all …]
Dpolicy_policy_test.go223 lg, err := ReadLicenseGraph(&fs, stderr, []string{tt.edge.target})
228 edge := lg.Edges()[0]
239 lg.targets[otherTarget] = otn
257 csActual := depConditionsPropagatingToTarget(lg, edge, depConditions, tt.treatAsAggregate)
281 …cs := targetConditionsPropagatingToDep(lg, edge, targetConditions, tt.treatAsAggregate, AllResolut…
Dpolicy_policy.go175 func depConditionsPropagatingToTarget(lg *LicenseGraph, e *TargetEdge, depConditions LicenseConditi…
199 func targetConditionsPropagatingToDep(lg *LicenseGraph, e *TargetEdge, targetConditions LicenseCond…
230 func conditionsAttachingAcrossEdge(lg *LicenseGraph, e *TargetEdge, universe LicenseConditionSet) L…
Dpolicy_resolvenotices_test.go426 lg, err := toGraph(stderr, tt.roots, tt.edges)
431 expectedRs := toResolutionSet(lg, tt.expectedResolutions)
432 actualRs := ResolveNotices(lg)
Dnoticeindex.go39 lg *LicenseGraph member
68 func IndexLicenseTexts(rootFS fs.FS, lg *LicenseGraph, rs ResolutionSet) (*NoticeIndex, error) {
70 rs = ResolveNotices(lg)
73 lg: lg,
76 shipped: ShippedNodes(lg),
158 WalkTopDown(NoEdgeContext{}, lg, func(lg *LicenseGraph, tn *TargetNode, path TargetEdgePath) bool {
235 files := make([]string, 0, len(ni.files) + len(ni.lg.targets) + len(projectMeta))
237 for f := range ni.lg.targets {
/build/make/tools/compliance/cmd/sbom/
Dsbom.go311 func inputFiles(lg *compliance.LicenseGraph, pmix *projectmetadata.Index, licenseTexts []string) []…
313 targets := lg.TargetNames()
356 lg, err := compliance.ReadLicenseGraph(ctx.rootFS, ctx.stderr, files)
402 compliance.WalkTopDownBreadthFirst(nil, lg,
403 …func(lg *compliance.LicenseGraph, tn *compliance.TargetNode, path compliance.TargetEdgePath) bool {
519 deps := inputFiles(lg, pmix, licenseTexts)
/build/make/tools/compliance/cmd/dumpresolutions/
Ddumpresolutions_test.go946 func newTestCondition(lg *compliance.LicenseGraph, conditionName ...string) compliance.LicenseCondi…
957 func (tm *targetMatcher) matchString(ctx *testContext, lg *compliance.LicenseGraph) string {
958 cs := newTestCondition(lg, tm.conditions...)
977 func (rm *resolutionMatcher) matchString(ctx *testContext, lg *compliance.LicenseGraph) string {
978 cs := newTestCondition(lg, rm.conditions...)
3303 lg, err := dumpResolutions(&tt.ctx, stdout, stderr, compliance.GetFS(tt.outDir), rootFiles...)
3315 expectedOut.WriteString(m.matchString(ctx, lg))