Dear Cabal developers,
    spurred by this discussion on haskell-cafe [1], I attach a small patch
on licence warnings. It:

    - reverts AllRightsReserved as PackageDistInexcusable, as it was
      before this commit [2].
      Reading the comments in Check.hs, this datatype is for issues which
      "[are] OK in the author's environment but [are] almost certain to be
      a portability problems for other environments", which I think it is
      the case.

    - adds a PackageDistSuspicious warning on OtherLicense. The text of
      the warning encourages the developer to choose from licences
      suggested by the OSI or FSF, if they don't want to use a licence
      recognised by cabal.

Thanks
-Francesco


[1] http://mail.haskell.org/pipermail/haskell-cafe/2015-February/118411.html
[2] 
https://github.com/haskell/cabal/commit/8d449ba3231445726272eac4dcf7b2b4a5508db9
>From 414d8e09eee0b4090c9e7dd2e808be37ac8e4d53 Mon Sep 17 00:00:00 2001
From: Francesco Ariis <fa...@ariis.it>
Date: Tue, 3 Mar 2015 15:29:07 +0100
Subject: [PATCH] Improved checkLicence warnings on AllRightsReserved and
 OtherLicense

---
 Cabal/Distribution/PackageDescription/Check.hs |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Cabal/Distribution/PackageDescription/Check.hs b/Cabal/Distribution/PackageDescription/Check.hs
index be4e94a..49e50f3 100644
--- a/Cabal/Distribution/PackageDescription/Check.hs
+++ b/Cabal/Distribution/PackageDescription/Check.hs
@@ -500,8 +500,16 @@ checkLicense pkg =
         "The 'license' field is missing."
 
   , check (license pkg == AllRightsReserved) $
-      PackageDistSuspicious
-        "The 'license' is AllRightsReserved. Is that really what you want?"
+      PackageDistInexcusable
+        "The 'license' field is specified as AllRightsReserved."
+
+  , check (license pkg == OtherLicense) $
+      PackageDistSuspicious $
+        "The 'license' field is specified as OtherLicense. If you need " ++
+        "a license not recognized by cabal, please choose from the ones " ++
+        "suggested by the Free Software Foundation or the Open Source " ++
+        "Initiative."
+
   , case license pkg of
       UnknownLicense l -> Just $
         PackageBuildWarning $
-- 
1.7.10.4

_______________________________________________
cabal-devel mailing list
cabal-devel@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/cabal-devel

Reply via email to