on iko/ghcjs-patch-master help sign in
Include FSF-libre when determining free-ness (#1264)

* SPDX: Clean up attrset style * SPDX: Include FSF-libre when determining free-ness In Nixpkgs any license considered free or open source by both the FSF and the OSI is considered free. When implementing the SPDX parsing I must've missed the `isFsfLibre` property. This is now fixed. Fixes #1263 * SPDX: Provide default for isFsfLibre The `isFsfLibre` property isn't always included, as opposed to the `isOsiApproved` property. To avoid errors we default it to `false` if it's missing. I opted for the simpler, more verbose way to write this. `lic.isFsfLibre or isOsiApproved` would work as well and reads well but it's not immediately clear that we're testing whether the field exists and defaulting rather than doing a boolean OR.

commit9abb33be43405a9c14ce1734eab99db0c0f4639f authortoonn <toonn@toonn.io> dateMon 11 Oct 2021, 05:21 (5 years ago) parent40df158
1 file changed+5−6
lib/spdx/licenses.nix+5−6
lib/spdx/licenses.nix+5−6
@@ -7,12 +7,11 @@ with builtins; let
77 );
88 dropFour = s: substring 0 (stringLength s - 4) s;
99 toSpdx = lic: with lic;
10− { spdxId = licenseId
11− ; shortName = licenseId
12− ; fullName = name
13− ; url = dropFour detailsUrl + "html"
14− ; free = isOsiApproved
15− ;
10+ { spdxId = licenseId;
11+ shortName = licenseId;
12+ fullName = name;
13+ url = dropFour detailsUrl + "html";
14+ free = isOsiApproved || lic.isFsfLibre or false;
1615 };
1716 toNamedValue = lic: { name = lic.spdxId; value = lic; };
1817in