Skip to content

Commit

Permalink
Fix parsing of the 'allow-newer' config field.
Browse files Browse the repository at this point in the history
Was accidentally broken in #3165.
  • Loading branch information
23Skidoo committed Feb 20, 2016
1 parent e4b5416 commit 67fc825
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cabal-install/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import Distribution.Simple.Compiler
( DebugInfoLevel(..), OptimisationLevel(..) )
import Distribution.Simple.Setup
( ConfigFlags(..), configureOptions, defaultConfigFlags
, AllowNewer(..), isAllowNewer
, HaddockFlags(..), haddockOptions, defaultHaddockFlags
, installDirsOptions, optionDistPref
, programConfigurationPaths', programConfigurationOptions
Expand All @@ -74,7 +75,7 @@ import Distribution.ParseUtils
, ParseResult(..), PError(..), PWarning(..)
, locatedErrorMsg, showPWarning
, readFields, warning, lineNo
, simpleField, listField, spaceListField
, simpleField, boolField, listField, spaceListField
, parseFilePathQ, parseTokenQ )
import Distribution.Client.ParseUtils
( parseFields, ppFields, ppSection )
Expand Down Expand Up @@ -668,6 +669,10 @@ configFieldDescriptions src =
[simpleField "compiler"
(fromFlagOrDefault Disp.empty . fmap Text.disp) (optional Text.parse)
configHcFlavor (\v flags -> flags { configHcFlavor = v })
,let toAllowNewer True = AllowNewerAll
toAllowNewer False = AllowNewerNone in
boolField "allow-newer" (isAllowNewer . configAllowNewer)
(\v flags -> flags { configAllowNewer = toAllowNewer v })
-- TODO: The following is a temporary fix. The "optimization"
-- and "debug-info" fields are OptArg, and viewAsFieldDescr
-- fails on that. Instead of a hand-written hackaged parser
Expand Down

0 comments on commit 67fc825

Please sign in to comment.