diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2020-02-11 12:56:48 +0100 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2020-02-11 13:00:35 +0100 |
commit | a18bbb2af92e9b4337e7f930cb80754f2408bcfd (patch) | |
tree | da77dab383110a6c2fae82c8aa04f0e79fa3f3f4 /src/CabalHelper/Compiletime/Cabal.hs | |
parent | 4ca6570ecda0a39fc056c239ada6c2368b4dd698 (diff) |
Revert "Fix Cabal version selection for Stack (esp. build-type:Custom)"
This reverts commit 04c2d34f1874bc198288d33c784bc26f89280ee2.
Diffstat (limited to 'src/CabalHelper/Compiletime/Cabal.hs')
-rw-r--r-- | src/CabalHelper/Compiletime/Cabal.hs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/CabalHelper/Compiletime/Cabal.hs b/src/CabalHelper/Compiletime/Cabal.hs index 88e53a7..b565152 100644 --- a/src/CabalHelper/Compiletime/Cabal.hs +++ b/src/CabalHelper/Compiletime/Cabal.hs @@ -268,18 +268,9 @@ complainIfNoCabalFile pkgdir Nothing = bultinCabalVersion :: Version bultinCabalVersion = parseVer VERSION_Cabal -readSetupConfigHeader :: FilePath -> IO UnitHeader +readSetupConfigHeader :: FilePath -> IO (Maybe UnitHeader) readSetupConfigHeader file = bracket (openFile file ReadMode) hClose $ \h -> do - mhdr <- parseSetupHeader <$> BS.hGetLine h - case mhdr of - Just hdr@(UnitHeader _PkgId ("Cabal", _hdrCabalVersion) _compId) -> do - return hdr - Just UnitHeader {uhSetupId=(setup_name, _)} -> panicIO $ - printf "Unknown Setup package-id in setup-config header '%s': '%s'" - (BS8.unpack setup_name) file - Nothing -> panicIO $ - printf "Could not read '%s' header" file - + parseSetupHeader <$> BS.hGetLine h parseSetupHeader :: BS.ByteString -> Maybe UnitHeader parseSetupHeader header = case BS8.words header of |