diff --git a/metadata/fields/custom/license.py b/metadata/fields/custom/license.py index df1a97f324..7ac4fcfb90 100644 --- a/metadata/fields/custom/license.py +++ b/metadata/fields/custom/license.py @@ -128,7 +128,7 @@ class LicenseField(field_types.MetadataField): ]) # Suggest using the standard value delimiter when possible. - if (re.search(_PATTERN_VERBOSE_DELIMITER, value) + if (len(licenses) > 1 and re.search(_PATTERN_VERBOSE_DELIMITER, value) and self.VALUE_DELIMITER not in value): return vr.ValidationWarning( reason=f"Separate licenses using a '{self.VALUE_DELIMITER}'.") diff --git a/metadata/tests/fields_test.py b/metadata/tests/fields_test.py index b491b56156..5571cff3a8 100644 --- a/metadata/tests/fields_test.py +++ b/metadata/tests/fields_test.py @@ -118,6 +118,8 @@ class FieldValidationTest(unittest.TestCase): valid_values=[ "Apache, 2.0 / MIT / MPL 2", "LGPL 2.1", + "GPL v2 or later", + "LGPL2 with the classpath exception", "Apache, Version 2 and Public domain", ], error_values=["", "\n", ",", "Apache 2.0 / MIT / "],