Commit 666476ff authored by sternenseemann's avatar sternenseemann
Browse files

lib.meta.getLicenseBySpdxId: set spdxId in default value

Nixpkgs does not contain an entry in lib.licenses for every SPDX license,
so it is expected that a valid SPDX id would yield no proper result from
getLicenseFromSpdxId. Hence, we should set spdxId in the default value.

Users that think their SPDX ID may be invalid should rather use
getLicenseFromSpdxIdOr.
parent 661b0d8e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -434,8 +434,9 @@ rec {
  getLicenseFromSpdxId =
    licstr:
    getLicenseFromSpdxIdOr licstr (
      lib.warn "getLicenseFromSpdxId: No license matches the given SPDX ID: ${licstr}" {
      lib.warn "getLicenseFromSpdxId: No license with the given SPDX ID found: ${licstr}" {
        shortName = licstr;
        spdxId = licstr;
      }
    );