Commit 03636cad authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Remove stability feature from cabal init

The stability field in .cabal files is deprecated since it's mostly useless.
parent 2a2a5973
......@@ -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
......
......@@ -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
......
......@@ -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 })
......
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