httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1890412 - /httpd/site/trunk/content/security/cvejsontohtml.py
Date Thu, 03 Jun 2021 06:31:44 GMT
Author: jailletc36
Date: Thu Jun  3 06:31:44 2021
New Revision: 1890412

URL: http://svn.apache.org/viewvc?rev=1890412&view=rev
Log:
Use natural order sorting, so that 2.4.9 is after 2.4.10

(trick found on https://stackoverflow.com/questions/4836710/is-there-a-built-in-function-for-string-natural-sort)

Modified:
    httpd/site/trunk/content/security/cvejsontohtml.py

Modified: httpd/site/trunk/content/security/cvejsontohtml.py
URL: http://svn.apache.org/viewvc/httpd/site/trunk/content/security/cvejsontohtml.py?rev=1890412&r1=1890411&r2=1890412&view=diff
==============================================================================
--- httpd/site/trunk/content/security/cvejsontohtml.py (original)
+++ httpd/site/trunk/content/security/cvejsontohtml.py Thu Jun  3 06:31:44 2021
@@ -66,7 +66,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"])
-        affects.sort(reverse=True)
+        # 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())
         e['affects'] = ", ".join(affects)
         e['timetable'] = [];
         for time in cve["timeline"]:



Mime
View raw message