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

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 ...@@ -49,7 +49,7 @@ import Distribution.Version
( orLaterVersion ) ( orLaterVersion )
import Distribution.Client.Init.Types import Distribution.Client.Init.Types
( InitFlags(..), PackageType(..), Category(..), Stability(..) ) ( InitFlags(..), PackageType(..), Category(..) )
import Distribution.Client.Init.Licenses import Distribution.Client.Init.Licenses
( bsd3, gplv2, gplv3, lgpl2, lgpl3 ) ( bsd3, gplv2, gplv3, lgpl2, lgpl3 )
import Distribution.Client.Init.Heuristics import Distribution.Client.Init.Heuristics
...@@ -92,7 +92,6 @@ extendFlags = getPackageName ...@@ -92,7 +92,6 @@ extendFlags = getPackageName
>=> getAuthorInfo >=> getAuthorInfo
>=> getHomepage >=> getHomepage
>=> getSynopsis >=> getSynopsis
>=> getStability
>=> getCategory >=> getCategory
>=> getLibOrExec >=> getLibOrExec
>=> getSrcDir >=> getSrcDir
...@@ -185,15 +184,6 @@ getSynopsis flags = do ...@@ -185,15 +184,6 @@ getSynopsis flags = do
return $ flags { synopsis = maybeToFlag syn } 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. -- | Prompt for a package category.
-- Note that it should be possible to do some smarter guessing here too, i.e. -- 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. -- look at the name of the top level source directory.
...@@ -458,10 +448,6 @@ generateCabalFile fileName c = render $ ...@@ -458,10 +448,6 @@ generateCabalFile fileName c = render $
(Just "A copyright notice.") (Just "A copyright notice.")
True 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) , fieldS "Category" (either id display `fmap` category c)
Nothing Nothing
True True
......
...@@ -46,7 +46,6 @@ data InitFlags = ...@@ -46,7 +46,6 @@ data InitFlags =
, license :: Flag License , license :: Flag License
, author :: Flag String , author :: Flag String
, email :: Flag String , email :: Flag String
, stability :: Flag (Either String Stability)
, homepage :: Flag String , homepage :: Flag String
, synopsis :: Flag String , synopsis :: Flag String
...@@ -83,7 +82,6 @@ instance Monoid InitFlags where ...@@ -83,7 +82,6 @@ instance Monoid InitFlags where
, license = mempty , license = mempty
, author = mempty , author = mempty
, email = mempty , email = mempty
, stability = mempty
, homepage = mempty , homepage = mempty
, synopsis = mempty , synopsis = mempty
, category = mempty , category = mempty
...@@ -106,7 +104,6 @@ instance Monoid InitFlags where ...@@ -106,7 +104,6 @@ instance Monoid InitFlags where
, license = combine license , license = combine license
, author = combine author , author = combine author
, email = combine email , email = combine email
, stability = combine stability
, homepage = combine homepage , homepage = combine homepage
, synopsis = combine synopsis , synopsis = combine synopsis
, category = combine category , category = combine category
...@@ -144,18 +141,6 @@ instance Text Category where ...@@ -144,18 +141,6 @@ instance Text Category where
disp = Disp.text . show disp = Disp.text . show
parse = Parse.choice $ map (fmap read . Parse.string . show) [Codec .. ] 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) #if MIN_VERSION_base(3,0,0)
#else #else
-- Compat instance for ghc-6.6 era -- Compat instance for ghc-6.6 era
......
...@@ -753,12 +753,6 @@ initCommand = CommandUI { ...@@ -753,12 +753,6 @@ initCommand = CommandUI {
IT.email (\v flags -> flags { IT.email = v }) IT.email (\v flags -> flags { IT.email = v })
(reqArgFlag "EMAIL") (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"] , option ['u'] ["homepage"]
"Project homepage and/or repository." "Project homepage and/or repository."
IT.homepage (\v flags -> flags { IT.homepage = v }) IT.homepage (\v flags -> flags { IT.homepage = v })
......
Markdown is supported
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