From b7f92252b72e9fa65f8860e042247ec82a7b554c Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Fri, 13 Sep 2019 19:20:05 -0400 Subject: [PATCH 1/3] add entry for 3.0 to init script --- cabal-install/Distribution/Client/Init.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cabal-install/Distribution/Client/Init.hs b/cabal-install/Distribution/Client/Init.hs index 50e0a42f68f..704e306dc1c 100644 --- a/cabal-install/Distribution/Client/Init.hs +++ b/cabal-install/Distribution/Client/Init.hs @@ -194,6 +194,7 @@ displayCabalVersion v = case versionNumbers v of [2,0] -> "2.0 (+ support for Backpack, internal sub-libs, '^>=' operator)" [2,2] -> "2.2 (+ support for 'common', 'elif', redundant commas, SPDX)" [2,4] -> "2.4 (+ support for '**' globbing)" + [3,0] -> "3.0 (+ support for v2-* options as default, other bikesheddable content here)" _ -> display v -- | Ask if a simple project with sensible defaults should be created. @@ -221,12 +222,20 @@ getCabalVersion flags = do cabVer <- return (flagToMaybe $ cabalVersion flags) ?>> maybePrompt flags (either (const defaultCabalVersion) id `fmap` promptList "Please choose version of the Cabal specification to use" - [mkVersion [1,10], mkVersion [2,0], mkVersion [2,2], mkVersion [2,4]] + vlist (Just defaultCabalVersion) displayCabalVersion False) ?>> return (Just defaultCabalVersion) return $ flags { cabalVersion = maybeToFlag cabVer } + where + vlist = + [ mkVersion [1,10] + , mkVersion [2,0] + , mkVersion [2,2] + , mkVersion [2,4] + , mkVersion [3,0] + ] -- | Get the package name: use the package directory (supplied, or the current -- directory by default) as a guess. It looks at the SourcePackageDb to avoid From 94dacebdc19d0ea70cad9a2b52a08377af1f9475 Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Fri, 13 Sep 2019 19:26:25 -0400 Subject: [PATCH 2/3] add changelog entry --- cabal-install/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal-install/changelog b/cabal-install/changelog index a515e0aab3d..d7b2bbaaa72 100644 --- a/cabal-install/changelog +++ b/cabal-install/changelog @@ -1,7 +1,7 @@ -*-change-log-*- 3.1.0.0 (current development version) - * TODO + * Add entry for cabal version 3.0 to cabal initialization script 3.0.0.0 Mikhail Glushenkov August 2019 * Parse comma-separated lists for extra-prog-path, extra-lib-dirs, extra-framework-dirs, From 46b337226b8472589cb4ec3139032ca78badaa57 Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Sat, 14 Sep 2019 14:54:33 -0400 Subject: [PATCH 3/3] update 3.0 feature prompt --- cabal-install/Distribution/Client/Init.hs | 16 ++++++++-------- cabal-install/changelog | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cabal-install/Distribution/Client/Init.hs b/cabal-install/Distribution/Client/Init.hs index 704e306dc1c..bcba9e9a6cd 100644 --- a/cabal-install/Distribution/Client/Init.hs +++ b/cabal-install/Distribution/Client/Init.hs @@ -194,7 +194,7 @@ displayCabalVersion v = case versionNumbers v of [2,0] -> "2.0 (+ support for Backpack, internal sub-libs, '^>=' operator)" [2,2] -> "2.2 (+ support for 'common', 'elif', redundant commas, SPDX)" [2,4] -> "2.4 (+ support for '**' globbing)" - [3,0] -> "3.0 (+ support for v2-* options as default, other bikesheddable content here)" + [3,0] -> "3.0 (+ support for set-notation syntax for '==' and '^>=')" _ -> display v -- | Ask if a simple project with sensible defaults should be created. @@ -222,19 +222,19 @@ getCabalVersion flags = do cabVer <- return (flagToMaybe $ cabalVersion flags) ?>> maybePrompt flags (either (const defaultCabalVersion) id `fmap` promptList "Please choose version of the Cabal specification to use" - vlist + versionList (Just defaultCabalVersion) displayCabalVersion False) ?>> return (Just defaultCabalVersion) return $ flags { cabalVersion = maybeToFlag cabVer } where - vlist = - [ mkVersion [1,10] - , mkVersion [2,0] - , mkVersion [2,2] - , mkVersion [2,4] - , mkVersion [3,0] + versionList = fmap mkVersion + [ [1,10] + , [2,0] + , [2,2] + , [2,4] + , [3,0] ] -- | Get the package name: use the package directory (supplied, or the current diff --git a/cabal-install/changelog b/cabal-install/changelog index d7b2bbaaa72..8571eed9925 100644 --- a/cabal-install/changelog +++ b/cabal-install/changelog @@ -1,7 +1,7 @@ -*-change-log-*- 3.1.0.0 (current development version) - * Add entry for cabal version 3.0 to cabal initialization script + * Add entry for cabal version 3.0 to `cabal init` 3.0.0.0 Mikhail Glushenkov August 2019 * Parse comma-separated lists for extra-prog-path, extra-lib-dirs, extra-framework-dirs,