From a456ca5fec522342981e65443193759355b77b3c Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Mon, 5 Nov 2018 23:35:40 +0100 Subject: Formatting/indent changes [ci skip] --- src/CabalHelper/Compiletime/Cabal.hs | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/CabalHelper/Compiletime/Cabal.hs b/src/CabalHelper/Compiletime/Cabal.hs index 9e6fbeb..8f55473 100644 --- a/src/CabalHelper/Compiletime/Cabal.hs +++ b/src/CabalHelper/Compiletime/Cabal.hs @@ -38,34 +38,36 @@ import Paths_cabal_helper (version) -- | Cabal library version we're compiling the helper exe against. data CabalVersion - = CabalHEAD { cvCommitId :: CommitId } + = CabalHEAD { cvCommitId :: CommitId } | CabalVersion { cabalVersion :: Version } newtype CommitId = CommitId { unCommitId :: String } showCabalVersion :: CabalVersion -> String showCabalVersion (CabalHEAD commitid) = - "HEAD-" ++ unCommitId commitid + "HEAD-" ++ unCommitId commitid showCabalVersion CabalVersion {cabalVersion} = - showVersion cabalVersion + showVersion cabalVersion exeName :: CabalVersion -> String exeName (CabalHEAD commitid) = intercalate "--" - [ "cabal-helper-" ++ showVersion version - , "Cabal-HEAD" ++ unCommitId commitid - ] + [ "cabal-helper-" ++ showVersion version + , "Cabal-HEAD" ++ unCommitId commitid + ] exeName CabalVersion {cabalVersion} = intercalate "--" - [ "cabal-helper-" ++ showVersion version - , "Cabal-" ++ showVersion cabalVersion - ] - -data CabalPatchDescription = CabalPatchDescription { - cpdVersions :: [Version], - cpdUnpackVariant :: UnpackCabalVariant, - cpdPatchFn :: FilePath -> IO () - } + [ "cabal-helper-" ++ showVersion version + , "Cabal-" ++ showVersion cabalVersion + ] + +data CabalPatchDescription = CabalPatchDescription + { cpdVersions :: [Version] + , cpdUnpackVariant :: UnpackCabalVariant + , cpdPatchFn :: FilePath -> IO () + } + nopCabalPatchDescription :: CabalPatchDescription -nopCabalPatchDescription = CabalPatchDescription [] LatestRevision (const (return ())) +nopCabalPatchDescription = + CabalPatchDescription [] LatestRevision (const (return ())) patchyCabalVersions :: [CabalPatchDescription] patchyCabalVersions = [ @@ -119,11 +121,7 @@ patchyCabalVersions = [ renameFile versionFileTmp versionFile -unpackPatchedCabal - :: Env - => Version - -> FilePath - -> IO CabalSourceDir +unpackPatchedCabal :: Env => Version -> FilePath -> IO CabalSourceDir unpackPatchedCabal cabalVer tmpdir = do res@(CabalSourceDir dir) <- unpackCabal cabalVer tmpdir variant patch dir -- cgit v1.2.3