up
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Build Test Deploy / docs (push) Has been cancelled
				
			
		
			
				
	
				Build Test Deploy / deploy (push) Has been cancelled
				
			
		
			
				
	
				Build Test Deploy / build-test (push) Has been cancelled
				
			
		
			
				
	
				Build Test Deploy / authority-container (push) Has been cancelled
				
			
		
			
				
	
				Docs CI / lint-and-preview (push) Has been cancelled
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Build Test Deploy / docs (push) Has been cancelled
				
			Build Test Deploy / deploy (push) Has been cancelled
				
			Build Test Deploy / build-test (push) Has been cancelled
				
			Build Test Deploy / authority-container (push) Has been cancelled
				
			Docs CI / lint-and-preview (push) Has been cancelled
				
			This commit is contained in:
		| @@ -160,13 +160,16 @@ internal static class SuseMapper | ||||
|                 continue; | ||||
|             } | ||||
|  | ||||
|             packages.Add(new AffectedPackage( | ||||
|                 AffectedPackageTypes.Rpm, | ||||
|                 identifier: nevra!.ToCanonicalString(), | ||||
|                 platform: package.Platform, | ||||
|                 versionRanges: ranges, | ||||
|                 statuses: BuildStatuses(package, affectedProvenance), | ||||
|                 provenance: new[] { affectedProvenance })); | ||||
|             var normalizedVersions = BuildNormalizedVersions(package, ranges); | ||||
|  | ||||
|             packages.Add(new AffectedPackage( | ||||
|                 AffectedPackageTypes.Rpm, | ||||
|                 identifier: nevra!.ToCanonicalString(), | ||||
|                 platform: package.Platform, | ||||
|                 versionRanges: ranges, | ||||
|                 statuses: BuildStatuses(package, affectedProvenance), | ||||
|                 provenance: new[] { affectedProvenance }, | ||||
|                 normalizedVersions: normalizedVersions)); | ||||
|         } | ||||
|  | ||||
|         return packages.Count == 0 | ||||
| @@ -290,7 +293,7 @@ internal static class SuseMapper | ||||
|         return !string.IsNullOrWhiteSpace(version) && !string.IsNullOrWhiteSpace(release); | ||||
|     } | ||||
|  | ||||
|     private static string? BuildRangeExpression(string? introduced, string? fixedVersion, string? lastAffected) | ||||
|     private static string? BuildRangeExpression(string? introduced, string? fixedVersion, string? lastAffected) | ||||
|     { | ||||
|         var parts = new List<string>(3); | ||||
|         if (!string.IsNullOrWhiteSpace(introduced)) | ||||
| @@ -308,6 +311,32 @@ internal static class SuseMapper | ||||
|             parts.Add($"last:{lastAffected}"); | ||||
|         } | ||||
|  | ||||
|         return parts.Count == 0 ? null : string.Join(" ", parts); | ||||
|     } | ||||
| } | ||||
|         return parts.Count == 0 ? null : string.Join(" ", parts); | ||||
|     } | ||||
|  | ||||
|     private static IReadOnlyList<NormalizedVersionRule> BuildNormalizedVersions( | ||||
|         SusePackageStateDto package, | ||||
|         IReadOnlyList<AffectedVersionRange> ranges) | ||||
|     { | ||||
|         if (ranges.Count == 0) | ||||
|         { | ||||
|             return Array.Empty<NormalizedVersionRule>(); | ||||
|         } | ||||
|  | ||||
|         var note = string.IsNullOrWhiteSpace(package.Platform) | ||||
|             ? null | ||||
|             : $"suse:{package.Platform.Trim()}"; | ||||
|  | ||||
|         var rules = new List<NormalizedVersionRule>(ranges.Count); | ||||
|         foreach (var range in ranges) | ||||
|         { | ||||
|             var rule = range.ToNormalizedVersionRule(note); | ||||
|             if (rule is not null) | ||||
|             { | ||||
|                 rules.Add(rule); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return rules.Count == 0 ? Array.Empty<NormalizedVersionRule>() : rules; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user