Policy change: GPL+CE is permissive.
Bug: 210546823
Test: m cts compliance_checkshare compliancenotice_bom \
compliancenotice_shippedlibs compliance_listshare \
compliance_dumpgraph compliance_dumpresolutions htmlnotice \
compliance_rtrace textnotice xmlnotice
Change-Id: I7da36972ffbb1494e33fd63db8e5ec851d47704c
diff --git a/tools/compliance/policy_policy.go b/tools/compliance/policy_policy.go
index 60bdf48..63da731 100644
--- a/tools/compliance/policy_policy.go
+++ b/tools/compliance/policy_policy.go
@@ -16,7 +16,6 @@
import (
"regexp"
- "strings"
)
var (
@@ -62,14 +61,13 @@
// ImpliesNotice lists the condition names implying a notice or attribution policy.
ImpliesNotice = LicenseConditionSet(UnencumberedCondition | PermissiveCondition | NoticeCondition | ReciprocalCondition |
- RestrictedCondition | RestrictedClasspathExceptionCondition | WeaklyRestrictedCondition |
- ProprietaryCondition | ByExceptionOnlyCondition)
+ RestrictedCondition | WeaklyRestrictedCondition | ProprietaryCondition | ByExceptionOnlyCondition)
// ImpliesReciprocal lists the condition names implying a local source-sharing policy.
ImpliesReciprocal = LicenseConditionSet(ReciprocalCondition)
// Restricted lists the condition names implying an infectious source-sharing policy.
- ImpliesRestricted = LicenseConditionSet(RestrictedCondition | RestrictedClasspathExceptionCondition | WeaklyRestrictedCondition)
+ ImpliesRestricted = LicenseConditionSet(RestrictedCondition | WeaklyRestrictedCondition)
// ImpliesProprietary lists the condition names implying a confidentiality policy.
ImpliesProprietary = LicenseConditionSet(ProprietaryCondition)
@@ -81,7 +79,7 @@
ImpliesPrivate = LicenseConditionSet(ProprietaryCondition)
// ImpliesShared lists the condition names implying a source-code sharing policy.
- ImpliesShared = LicenseConditionSet(ReciprocalCondition | RestrictedCondition | RestrictedClasspathExceptionCondition | WeaklyRestrictedCondition)
+ ImpliesShared = LicenseConditionSet(ReciprocalCondition | RestrictedCondition | WeaklyRestrictedCondition)
)
var (
@@ -112,13 +110,9 @@
continue
}
hasLgpl := false
- hasClasspath := false
hasGeneric := false
for _, kind := range tn.LicenseKinds() {
- if strings.HasSuffix(kind, "-with-classpath-exception") {
- cs = cs.Plus(RestrictedClasspathExceptionCondition)
- hasClasspath = true
- } else if anyLgpl.MatchString(kind) {
+ if anyLgpl.MatchString(kind) {
cs = cs.Plus(WeaklyRestrictedCondition)
hasLgpl = true
} else if versionedGpl.MatchString(kind) {
@@ -131,7 +125,7 @@
cs = cs.Plus(RestrictedCondition)
}
}
- if hasGeneric && !hasLgpl && !hasClasspath {
+ if hasGeneric && !hasLgpl {
cs = cs.Plus(RestrictedCondition)
}
continue
@@ -202,9 +196,6 @@
}
result |= depConditions & LicenseConditionSet(RestrictedCondition)
- if 0 != (depConditions&LicenseConditionSet(RestrictedClasspathExceptionCondition)) && !edgeNodesAreIndependentModules(e) {
- result |= LicenseConditionSet(RestrictedClasspathExceptionCondition)
- }
return result
}
@@ -241,9 +232,6 @@
return result
}
result = result.Minus(WeaklyRestrictedCondition)
- if edgeNodesAreIndependentModules(e) {
- result = result.Minus(RestrictedClasspathExceptionCondition)
- }
return result
}
@@ -261,10 +249,7 @@
return NewLicenseConditionSet()
}
- result &= LicenseConditionSet(RestrictedCondition | RestrictedClasspathExceptionCondition)
- if 0 != (result&LicenseConditionSet(RestrictedClasspathExceptionCondition)) && edgeNodesAreIndependentModules(e) {
- result &= LicenseConditionSet(RestrictedCondition)
- }
+ result &= LicenseConditionSet(RestrictedCondition)
return result
}
@@ -281,9 +266,3 @@
isToolchain := e.annotations.HasAnnotation("toolchain")
return !isDynamic && !isToolchain
}
-
-// edgeNodesAreIndependentModules returns true for edges where the target and
-// dependency are independent modules.
-func edgeNodesAreIndependentModules(e *TargetEdge) bool {
- return e.target.PackageName() != e.dependency.PackageName()
-}