[commit: Cabal] : Remove stability feature from cabal init (5813efc)
Ian Lynagh
igloo at earth.li
Fri Jun 24 02:05:10 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch :
http://hackage.haskell.org/trac/ghc/changeset/5813efcc32e6a9b51f7babd35e9dd86333a4706d
>---------------------------------------------------------------
commit 5813efcc32e6a9b51f7babd35e9dd86333a4706d
Author: Duncan Coutts <duncan at haskell.org>
Date: Sat Dec 19 03:08:55 2009 +0000
Remove stability feature from cabal init
The stability field in .cabal files is deprecated since it's mostly useless.
>---------------------------------------------------------------
cabal-install/Distribution/Client/Init.hs | 16 +---------------
cabal-install/Distribution/Client/Init/Types.hs | 15 ---------------
cabal-install/Distribution/Client/Setup.hs | 6 ------
3 files changed, 1 insertions(+), 36 deletions(-)
diff --git a/cabal-install/Distribution/Client/Init.hs b/cabal-install/Distribution/Client/Init.hs
index 274a390..be54d5e 100644
--- a/cabal-install/Distribution/Client/Init.hs
+++ b/cabal-install/Distribution/Client/Init.hs
@@ -49,7 +49,7 @@ import Distribution.Version
( orLaterVersion )
import Distribution.Client.Init.Types
- ( InitFlags(..), PackageType(..), Category(..), Stability(..) )
+ ( InitFlags(..), PackageType(..), Category(..) )
import Distribution.Client.Init.Licenses
( bsd3, gplv2, gplv3, lgpl2, lgpl3 )
import Distribution.Client.Init.Heuristics
@@ -92,7 +92,6 @@ extendFlags = getPackageName
>=> getAuthorInfo
>=> getHomepage
>=> getSynopsis
- >=> getStability
>=> getCategory
>=> getLibOrExec
>=> getSrcDir
@@ -185,15 +184,6 @@ getSynopsis flags = do
return $ flags { synopsis = maybeToFlag syn }
-getStability :: InitFlags -> IO InitFlags
-getStability flags = do
- stab <- return (flagToMaybe $ stability flags)
- ?>> maybePrompt flags (promptList "Project stability" [Stable ..]
- (Just Experimental)
- True)
-
- return $ flags { stability = maybeToFlag stab }
-
-- | Prompt for a package category.
-- Note that it should be possible to do some smarter guessing here too, i.e.
-- look at the name of the top level source directory.
@@ -458,10 +448,6 @@ generateCabalFile fileName c = render $
(Just "A copyright notice.")
True
- , fieldS "Stability" (either id display `fmap` stability c)
- (Just "Stability of the pakcage (experimental, provisional, stable...)")
- True
-
, fieldS "Category" (either id display `fmap` category c)
Nothing
True
diff --git a/cabal-install/Distribution/Client/Init/Types.hs b/cabal-install/Distribution/Client/Init/Types.hs
index 8496ceb..aace727 100644
--- a/cabal-install/Distribution/Client/Init/Types.hs
+++ b/cabal-install/Distribution/Client/Init/Types.hs
@@ -46,7 +46,6 @@ data InitFlags =
, license :: Flag License
, author :: Flag String
, email :: Flag String
- , stability :: Flag (Either String Stability)
, homepage :: Flag String
, synopsis :: Flag String
@@ -83,7 +82,6 @@ instance Monoid InitFlags where
, license = mempty
, author = mempty
, email = mempty
- , stability = mempty
, homepage = mempty
, synopsis = mempty
, category = mempty
@@ -106,7 +104,6 @@ instance Monoid InitFlags where
, license = combine license
, author = combine author
, email = combine email
- , stability = combine stability
, homepage = combine homepage
, synopsis = combine synopsis
, category = combine category
@@ -144,18 +141,6 @@ instance Text Category where
disp = Disp.text . show
parse = Parse.choice $ map (fmap read . Parse.string . show) [Codec .. ]
--- | Some common package stability indicators.
-data Stability
- = Stable
- | Provisional
- | Experimental
- | Alpha
- deriving (Read, Show, Eq, Ord, Bounded, Enum)
-
-instance Text Stability where
- disp = Disp.text . show
- parse = Parse.choice $ map (fmap read . Parse.string . show) [Stable .. ]
-
#if MIN_VERSION_base(3,0,0)
#else
-- Compat instance for ghc-6.6 era
diff --git a/cabal-install/Distribution/Client/Setup.hs b/cabal-install/Distribution/Client/Setup.hs
index 208e3f3..83d0385 100644
--- a/cabal-install/Distribution/Client/Setup.hs
+++ b/cabal-install/Distribution/Client/Setup.hs
@@ -753,12 +753,6 @@ initCommand = CommandUI {
IT.email (\v flags -> flags { IT.email = v })
(reqArgFlag "EMAIL")
- , option [] ["stability"]
- "Package stability."
- IT.stability (\v flags -> flags { IT.stability = v })
- (reqArg' "STABILITY" (\s -> toFlag $ maybe (Left s) Right (readMaybe s))
- (flagToList . fmap (either id show)))
-
, option ['u'] ["homepage"]
"Project homepage and/or repository."
IT.homepage (\v flags -> flags { IT.homepage = v })
More information about the Cvs-libraries
mailing list