From cvs-return-68425-archive-asf-public=cust-asf.ponee.io@httpd.apache.org Thu Jun 3 06:31:47 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id DFF31180643 for ; Thu, 3 Jun 2021 08:31:46 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 2513A4060E for ; Thu, 3 Jun 2021 06:31:46 +0000 (UTC) Received: (qmail 44928 invoked by uid 500); 3 Jun 2021 06:31:45 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 44914 invoked by uid 99); 3 Jun 2021 06:31:44 -0000 Received: from Unknown (HELO svn01-us-east.apache.org) (13.90.137.153) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jun 2021 06:31:44 +0000 Received: from svn01-us-east.apache.org (svn01-us-east.apache.org [127.0.0.1]) by svn01-us-east.apache.org (ASF Mail Server at svn01-us-east.apache.org) with ESMTP id AD0BD17E774 for ; Thu, 3 Jun 2021 06:31:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1890412 - /httpd/site/trunk/content/security/cvejsontohtml.py Date: Thu, 03 Jun 2021 06:31:44 -0000 To: cvs@httpd.apache.org From: jailletc36@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20210603063144.AD0BD17E774@svn01-us-east.apache.org> 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"]: