summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu@debian.org>2021-02-18 12:19:01 +0100
committerEmilio Pozuelo Monfort <pochu@debian.org>2021-02-18 12:19:01 +0100
commitd16cfb47ef460153669eee57eaec807be6b4fdcc (patch)
tree412e7edd735c0b9adac761d6f199302571f881be /bin
parent482a467cfdb36d7202a5ea84539352a203cefba7 (diff)
lts: take glib2.0
Diffstat (limited to 'bin')
-rwxr-xr-xbin/merge-cve-files19
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/merge-cve-files b/bin/merge-cve-files
index b980cfbdbc..dcc7b9c6a2 100755
--- a/bin/merge-cve-files
+++ b/bin/merge-cve-files
@@ -10,7 +10,7 @@ import sys
import setup_paths # noqa
from debian_support import internRelease
-from sectracker.parsers import cvelist, writecvelist, PackageAnnotation
+from sectracker.parsers import cvelist, writecvelist, PackageAnnotation, FlagAnnotation, XrefAnnotation
def merge_annotations(annotations, new_annotation):
if not isinstance(new_annotation, PackageAnnotation):
@@ -18,6 +18,23 @@ def merge_annotations(annotations, new_annotation):
annotations = list(annotations)
+ annotations_for_pkg = [ann for ann in annotations \
+ if isinstance(ann, PackageAnnotation) \
+ and ann.package == new_annotation.package]
+ if not annotations_for_pkg:
+ if new_annotation.release:
+ raise ValueError(f"new annotation for {new_annotation.package}/{new_annotation.release} "
+ "but there is no annotation for sid")
+ # new package, add it at the top
+ for idx, annotation in enumerate(annotations):
+ if isinstance(annotation, FlagAnnotation) \
+ or isinstance(annotation, XrefAnnotation):
+ continue
+
+ annotations.insert(idx, new_annotation)
+ return annotations
+
+
# append/substitute the new one at the right place
for idx, annotation in enumerate(annotations):
if not isinstance(annotation, PackageAnnotation) \

© 2014-2024 Faster IT GmbH | imprint | privacy policy