[Secure-testing-commits] r47702 - bin

Ben Hutchings benh at moszumanska.debian.org
Tue Jan 3 20:05:55 UTC 2017


Author: benh
Date: 2017-01-03 20:05:53 +0000 (Tue, 03 Jan 2017)
New Revision: 47702

Modified:
   bin/gen-DSA
Log:
bin/gen-DSA: Fix sorting of CVE IDs with last part >= 10000

Use sort -V, which seems to do the right thing.


Modified: bin/gen-DSA
===================================================================
--- bin/gen-DSA	2017-01-03 19:54:59 UTC (rev 47701)
+++ bin/gen-DSA	2017-01-03 20:05:53 UTC (rev 47702)
@@ -80,7 +80,7 @@
 
 split_n_sort() {
     printf '%s' "$1" | sed -r 's/[ ,;]+/ /g;s/^ //' | tr ' ' "\n" | sort -u |
-    sort -n | tr "\n" ' ' | sed -r 's/\s+/ /g;s/\s$//'
+    sort ${2:--n} | tr "\n" ' ' | sed -r 's/\s+/ /g;s/\s$//'
 }
 
 _d_space() {
@@ -185,7 +185,7 @@
 
 BUGNUM="$(split_n_sort "$BUGNUM")"
 
-CVE="$(split_n_sort "$CVE")"
+CVE="$(split_n_sort "$CVE" -V)"
 cve_spacing="$(right_space '' 17)"
 
 sed_cmd='s/((CVE-[0-9-]+[ ]+){4})(.+)$/\1\\n'"$cve_spacing"'\3/g;P;D'




More information about the Secure-testing-commits mailing list