You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- allow license exceptions by default – specific ones can be added to a
reject list (fixes#1440)
- allow `+` licenses
- report the portion of the license that is unacceptable in the error
message (improves #710, but could be more explicit about why licenses are rejected)
- extract the constant allow/reject lists from the evaluation function
--| Licence acceptance predicate (only used on central-server)
518
+
--| This is a list of licences that are accepted, even though they aren’t OSI-
519
+
-- or FSF-approved.
520
+
allowedLicenses:: [SPDX.LicenseId]
521
+
allowedLicenses =
522
+
[ SPDX.CC0_1_0, -- CC0 isn't OSI approved, but we allow it as "PublicDomain", this is eg. PublicDomain in http://hackage.haskell.org/package/string-qq-0.0.2/src/LICENSE
523
+
SPDX.Bzip2_1_0_5, -- not OSI approved, but make an exception: https://github.com/haskell/hackage-server/issues/1294
goSimple (SPDX.ELicenseIdSPDX.CC0_1_0) =True-- CC0 isn't OSI approved, but we allow it as "PublicDomain", this is eg. PublicDomain in http://hackage.haskell.org/package/string-qq-0.0.2/src/LICENSE
532
-
goSimple (SPDX.ELicenseIdSPDX.Bzip2_1_0_5) =True-- not OSI approved, but make an exception: https://github.com/haskell/hackage-server/issues/1294
533
-
goSimple (SPDX.ELicenseIdSPDX.Bzip2_1_0_6) =True-- same as above
534
-
goSimple (SPDX.ELicenseId lid) =SPDX.licenseIsOsiApproved lid ||SPDX.LId.licenseIsFsfLibre lid -- allow only OSI or FSF approved licenses.
553
+
goExpr (SPDX.EAnd a b) =case (goExpr a, goExpr b) of
554
+
(Nothing, Nothing) ->Nothing
555
+
(Just l, Nothing) ->pure l
556
+
(Nothing, Just l) ->pure l
557
+
(Just l, Just l') ->pure$SPDX.EAnd l l'
558
+
goExpr (SPDX.EOr a b) =case (goExpr a, goExpr b) of
559
+
(Just l, Just l') ->pure$SPDX.EOr l l'
560
+
(_, _) ->Nothing
561
+
goExpr l@(SPDX.ELicense s e) =case (goSimple s, goException <$> e) of
562
+
(False, JustFalse) ->pure l
563
+
-- TODO: This case should _only_ return the exception, but it includes both
564
+
(True, JustFalse) ->pure$SPDX.ELicense s e
565
+
(False, _) ->pure$SPDX.ELicense s Nothing
566
+
(True, _) ->Nothing
567
+
568
+
goException eid =
569
+
-- most exceptions grant additional rights – reject specific ones
0 commit comments