Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed Feb 10, 2024
1 parent 373f318 commit 5b2a125
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cabal-install/src/Distribution/Client/SetupWrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ cabalLibVersionToUse verbosity options pkgId bt =
writeSetupVersionFile options version
return (version, Nothing, options)
Nothing -> do
savedVer <- savedVersion options
savedVer <- readSetupVersionFile options
case savedVer of
Just version | version `withinRange` useCabalVersion options ->
do
Expand Down Expand Up @@ -756,10 +756,10 @@ writeSetupVersionFile :: SetupScriptOptions -> Version -> IO ()
writeSetupVersionFile options version =
writeFile setupVersionFile (show version ++ "\n")
where
SetupPaths{..} = getSetupPaths options
SetupPaths{setupVersionFile} = getSetupPaths options

savedVersion :: SetupScriptOptions -> IO (Maybe Version)
savedVersion options = do
readSetupVersionFile :: SetupScriptOptions -> IO (Maybe Version)
readSetupVersionFile options = do
versionString <- readFile setupVersionFile `catchIO` \_ -> return ""
case reads versionString of
[(version, s)] | all isSpace s -> return (Just version)
Expand All @@ -775,7 +775,7 @@ installedVersion
-> IO (Version, Maybe InstalledPackageId, SetupScriptOptions)
installedVersion verbosity options pkgId bt = do
let SetupScriptOptions{useCompiler, usePlatform, useProgramDb, usePackageIndex, usePackageDB} = options
(comp, _platform, progdb, index) <- configureCompiler verbosity useCompiler usePlatform useProgramDb usePackageIndex usePackageDB
(_comp, _platform, _progdb, index) <- configureCompiler verbosity useCompiler usePlatform useProgramDb usePackageIndex usePackageDB
let options' = options{usePackageIndex = Just index}
(version, mipkgid) <- installedCabalVersion verbosity index (useCabalVersion options') pkgId bt
updateSetupScript verbosity (workingDir options') setupHs version bt
Expand Down

0 comments on commit 5b2a125

Please sign in to comment.