Skip to content

Commit 1e96fac

Browse files
committed
Add license type UnspecifiedLicense.
Before this, AllrightsReservered had two separate meanings; the author explicitly chose this license or not license was specified and therefore defaults to AllRightsReserved. The default license when no license is specified is now UnspecifiedLicense. Closes: haskell#2141
1 parent 6b2ebe0 commit 1e96fac

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

Cabal/Distribution/InstalledPackageInfo.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ emptyInstalledPackageInfo
156156
sourcePackageId = PackageIdentifier (PackageName "") noVersion,
157157
packageKey = OldPackageKey (PackageIdentifier
158158
(PackageName "") noVersion),
159-
license = AllRightsReserved,
159+
license = UnspecifiedLicense,
160160
copyright = "",
161161
maintainer = "",
162162
author = "",

Cabal/Distribution/License.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,16 @@ data License =
105105
-- jurisdiction necessarily in the public domain elsewhere.
106106
| PublicDomain
107107

108-
-- | No license. The package may not be legally modified or redistributed by
109-
-- anyone but the rightsholder.
108+
-- | Explicitly 'All Rights Reserved', eg for proprietary software. The
109+
-- package may not be legally modified or redistributed by anyone but the
110+
-- rightsholder.
110111
| AllRightsReserved
111112

113+
-- | No license specified which legally defaults to 'All Rights Reserved'.
114+
-- The package may not be legally modified or redistributed by anyone but
115+
-- the rightsholder.
116+
| UnspecifiedLicense
117+
112118
-- | Any other software license.
113119
| OtherLicense
114120

Cabal/Distribution/PackageDescription.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ import Distribution.ModuleName ( ModuleName )
125125
import Distribution.Version
126126
( Version(Version), VersionRange, anyVersion, orLaterVersion
127127
, asVersionIntervals, LowerBound(..) )
128-
import Distribution.License (License(AllRightsReserved))
128+
import Distribution.License (License(UnspecifiedLicense))
129129
import Distribution.Compiler (CompilerFlavor)
130130
import Distribution.System (OS, Arch)
131131
import Distribution.Text
@@ -230,7 +230,7 @@ emptyPackageDescription
230230
= PackageDescription {
231231
package = PackageIdentifier (PackageName "")
232232
(Version [] []),
233-
license = AllRightsReserved,
233+
license = UnspecifiedLicense,
234234
licenseFiles = [],
235235
specVersionRaw = Right anyVersion,
236236
buildType = Nothing,

Cabal/Distribution/PackageDescription/Check.hs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,13 @@ checkLicense :: PackageDescription -> [PackageCheck]
475475
checkLicense pkg =
476476
catMaybes [
477477

478-
check (license pkg == AllRightsReserved) $
478+
check (license pkg == UnspecifiedLicense) $
479479
PackageDistInexcusable
480-
"The 'license' field is missing or specified as AllRightsReserved."
480+
"The 'license' field is missing."
481481

482+
, check (license pkg == AllRightsReserved) $
483+
PackageDistSuspicious
484+
"The 'license' is AllRightsReserved. Is that really what you want?"
482485
, case license pkg of
483486
UnknownLicense l -> Just $
484487
PackageBuildWarning $
@@ -503,8 +506,9 @@ checkLicense pkg =
503506
++ "version then please file a ticket."
504507
_ -> Nothing
505508

506-
, check (license pkg `notElem` [AllRightsReserved, PublicDomain]
507-
-- AllRightsReserved and PublicDomain are not strictly
509+
, check (license pkg `notElem` [ AllRightsReserved
510+
, UnspecifiedLicense, PublicDomain]
511+
-- *AllRightsReserved and PublicDomain are not strictly
508512
-- licenses so don't need license files.
509513
&& null (licenseFiles pkg)) $
510514
PackageDistSuspicious "A 'license-file' is not specified."
@@ -1119,7 +1123,8 @@ checkCabalVersion pkg =
11191123
intersectVersionRanges unionVersionRanges id
11201124

11211125
compatLicenses = [ GPL Nothing, LGPL Nothing, AGPL Nothing, BSD3, BSD4
1122-
, PublicDomain, AllRightsReserved, OtherLicense ]
1126+
, PublicDomain, AllRightsReserved
1127+
, UnspecifiedLicense, OtherLicense ]
11231128

11241129
mentionedExtensions = [ ext | bi <- allBuildInfo pkg
11251130
, ext <- allExtensions bi ]

0 commit comments

Comments
 (0)