Commit 8d449ba3 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Merge pull request #2147 from erikd/master

Add license type UnspecifiedLicense.
parents af326956 1e96fac3
......@@ -156,7 +156,7 @@ emptyInstalledPackageInfo
sourcePackageId = PackageIdentifier (PackageName "") noVersion,
packageKey = OldPackageKey (PackageIdentifier
(PackageName "") noVersion),
license = AllRightsReserved,
license = UnspecifiedLicense,
copyright = "",
maintainer = "",
author = "",
......
......@@ -105,10 +105,16 @@ data License =
-- jurisdiction necessarily in the public domain elsewhere.
| PublicDomain
-- | No license. The package may not be legally modified or redistributed by
-- anyone but the rightsholder.
-- | Explicitly 'All Rights Reserved', eg for proprietary software. The
-- package may not be legally modified or redistributed by anyone but the
-- rightsholder.
| AllRightsReserved
-- | No license specified which legally defaults to 'All Rights Reserved'.
-- The package may not be legally modified or redistributed by anyone but
-- the rightsholder.
| UnspecifiedLicense
-- | Any other software license.
| OtherLicense
......
......@@ -125,7 +125,7 @@ import Distribution.ModuleName ( ModuleName )
import Distribution.Version
( Version(Version), VersionRange, anyVersion, orLaterVersion
, asVersionIntervals, LowerBound(..) )
import Distribution.License (License(AllRightsReserved))
import Distribution.License (License(UnspecifiedLicense))
import Distribution.Compiler (CompilerFlavor)
import Distribution.System (OS, Arch)
import Distribution.Text
......@@ -230,7 +230,7 @@ emptyPackageDescription
= PackageDescription {
package = PackageIdentifier (PackageName "")
(Version [] []),
license = AllRightsReserved,
license = UnspecifiedLicense,
licenseFiles = [],
specVersionRaw = Right anyVersion,
buildType = Nothing,
......
......@@ -478,10 +478,13 @@ checkLicense :: PackageDescription -> [PackageCheck]
checkLicense pkg =
catMaybes [
check (license pkg == AllRightsReserved) $
check (license pkg == UnspecifiedLicense) $
PackageDistInexcusable
"The 'license' field is missing or specified as AllRightsReserved."
"The 'license' field is missing."
, check (license pkg == AllRightsReserved) $
PackageDistSuspicious
"The 'license' is AllRightsReserved. Is that really what you want?"
, case license pkg of
UnknownLicense l -> Just $
PackageBuildWarning $
......@@ -506,8 +509,9 @@ checkLicense pkg =
++ "version then please file a ticket."
_ -> Nothing
, check (license pkg `notElem` [AllRightsReserved, PublicDomain]
-- AllRightsReserved and PublicDomain are not strictly
, check (license pkg `notElem` [ AllRightsReserved
, UnspecifiedLicense, PublicDomain]
-- *AllRightsReserved and PublicDomain are not strictly
-- licenses so don't need license files.
&& null (licenseFiles pkg)) $
PackageDistSuspicious "A 'license-file' is not specified."
......@@ -1138,7 +1142,8 @@ checkCabalVersion pkg =
intersectVersionRanges unionVersionRanges id
compatLicenses = [ GPL Nothing, LGPL Nothing, AGPL Nothing, BSD3, BSD4
, PublicDomain, AllRightsReserved, OtherLicense ]
, PublicDomain, AllRightsReserved
, UnspecifiedLicense, OtherLicense ]
mentionedExtensions = [ ext | bi <- allBuildInfo pkg
, ext <- allExtensions bi ]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment