Skip to content

Commit

Permalink
Go back to case-insensitive sort order to avoid a SemVer change
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitchell committed Jan 24, 2024
1 parent 9ff65c3 commit defdc77
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
3 changes: 2 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
const fs = require('fs')
const https = require('https')
const order = require('./order')

https.request('https://spdx.org/licenses/exceptions.json', function (response) {
if (response.statusCode !== 200) {
Expand Down Expand Up @@ -33,6 +34,6 @@ https.request('https://spdx.org/licenses/exceptions.json', function (response) {
function write (file, list) {
fs.writeFileSync(
file + '.json',
JSON.stringify(list.sort(), null, 2) + '\n'
JSON.stringify(list.sort(order), null, 2) + '\n'
)
}
32 changes: 16 additions & 16 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,41 @@
"Autoconf-exception-macro",
"Bison-exception-2.2",
"Bootloader-exception",
"CLISP-exception-2.0",
"Classpath-exception-2.0",
"CLISP-exception-2.0",
"cryptsetup-OpenSSL-exception",
"DigiRule-FOSS-exception",
"FLTK-exception",
"eCos-exception-2.0",
"Fawkes-Runtime-exception",
"FLTK-exception",
"Font-exception-2.0",
"freertos-exception-2.0",
"GCC-exception-2.0",
"GCC-exception-2.0-note",
"GCC-exception-3.1",
"GNAT-exception",
"GNU-compiler-exception",
"gnu-javamail-exception",
"GPL-3.0-interface-exception",
"GPL-3.0-linking-exception",
"GPL-3.0-linking-source-exception",
"GPL-CC-1.0",
"GStreamer-exception-2005",
"GStreamer-exception-2008",
"i2p-gpl-java-exception",
"KiCad-libraries-exception",
"LGPL-3.0-linking-exception",
"libpri-OpenH323-exception",
"Libtool-exception",
"Linux-syscall-note",
"LLGPL",
"LLVM-exception",
"LZMA-exception",
"Libtool-exception",
"Linux-syscall-note",
"OCCT-exception-1.0",
"mif-exception",
"OCaml-LGPL-linking-exception",
"OCCT-exception-1.0",
"OpenJDK-assembly-exception-1.0",
"openvpn-openssl-exception",
"PS-or-PDF-font-exception-20170817",
"QPL-1.0-INRIA-2004-exception",
"Qt-GPL-exception-1.0",
Expand All @@ -43,22 +51,14 @@
"SANE-exception",
"SHL-2.0",
"SHL-2.1",
"stunnel-exception",
"SWI-exception",
"Swift-exception",
"Texinfo-exception",
"u-boot-exception-2.0",
"UBDL-exception",
"Universal-FOSS-exception-1.0",
"WxWindows-exception-3.1",
"cryptsetup-OpenSSL-exception",
"eCos-exception-2.0",
"freertos-exception-2.0",
"gnu-javamail-exception",
"i2p-gpl-java-exception",
"libpri-OpenH323-exception",
"mif-exception",
"openvpn-openssl-exception",
"stunnel-exception",
"u-boot-exception-2.0",
"vsftpd-openssl-exception",
"WxWindows-exception-3.1",
"x11vnc-openssl-exception"
]
5 changes: 3 additions & 2 deletions latest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const assert = require('assert')
const order = require('./order')

// Download JSON file from spdx.org.
require('https').request('https://spdx.org/licenses/exceptions.json')
Expand All @@ -23,8 +24,8 @@ require('https').request('https://spdx.org/licenses/exceptions.json')
identifiers.push(id)
}
})
identifiers.sort()
deprecated.sort()
identifiers.sort(order)
deprecated.sort(order)

const indexJSON = require('./index')
const deprecatedJSON = require('./deprecated')
Expand Down
3 changes: 3 additions & 0 deletions order.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = function (a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase())
}

0 comments on commit defdc77

Please sign in to comment.