From a18bbb2af92e9b4337e7f930cb80754f2408bcfd Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 11 Feb 2020 12:56:48 +0100 Subject: Revert "Fix Cabal version selection for Stack (esp. build-type:Custom)" This reverts commit 04c2d34f1874bc198288d33c784bc26f89280ee2. --- src/CabalHelper/Compiletime/Cabal.hs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/CabalHelper/Compiletime/Cabal.hs') 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 -- cgit v1.2.3