httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1075434 - in /websites/staging/httpd/trunk/content: ./ security/cvejsontohtml.py
Date Sat, 05 Jun 2021 10:09:34 GMT
Author: buildbot
Date: Sat Jun  5 10:09:34 2021
New Revision: 1075434

Log:
Staging update by buildbot for httpd

Modified:
    websites/staging/httpd/trunk/content/   (props changed)
    websites/staging/httpd/trunk/content/security/cvejsontohtml.py

Propchange: websites/staging/httpd/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sat Jun  5 10:09:34 2021
@@ -1 +1 @@
-1890443
+1890492

Modified: websites/staging/httpd/trunk/content/security/cvejsontohtml.py
==============================================================================
--- websites/staging/httpd/trunk/content/security/cvejsontohtml.py (original)
+++ websites/staging/httpd/trunk/content/security/cvejsontohtml.py Sat Jun  5 10:09:34 2021
@@ -10,6 +10,11 @@ parser.add_option("-e","--extratext",hel
 parser.add_option("-i","--inputdirectory",help="directory of json files",dest="directory")
 (options,args) = parser.parse_args()
 
+
+def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
+    return [int(text) if text.isdigit() else text.lower()
+            for text in _nsre.split(s)]   
+            
 filterversion = options.filterversion or ""
 cves = []
 entries = {}
@@ -66,8 +71,8 @@ for k,v in sorted(entries.items(), key=l
             else:
                 # Otherwise maybe we started doing things like "<2.7.8"
                 affects.append(ver["version_affected"]+ver["version_value"])
-        # Make a natural order sort (i.e. revrite version like 0002.4.8 and 002.4.38)
-        affects.sort(reverse=True, key=lambda x: '{0:0>8}'.format(x).lower())
+        # Make a natural order sort
+        affects.sort(reverse=True, key=natural_sort_key)
         e['affects'] = ", ".join(affects)
         e['timetable'] = [];
         for time in cve["timeline"]:



Mime
View raw message