Skip to content

Commit

Permalink
Die when the LBI is unreadable.
Browse files Browse the repository at this point in the history
  • Loading branch information
23Skidoo committed Aug 15, 2016
1 parent 4b4c6a6 commit d3ff4a9
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions cabal-install/Distribution/Client/Status.hs
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,12 @@ status verbosity globalFlags statusFlags = do
(defaultComp, platform, defaultConf) <- configCompilerAux'
$ savedConfigureFlags config
let distPref = useDistPref defaultSetupScriptOptions
-- TODO: this currently only works if the cabal version used for configuring
-- is the same as the one doing the status. would be cool if it would
-- either work or at least indicate this otherwise.
buildConfig <- tryGetPersistBuildConfig distPref
let (comp, conf) = case buildConfig of
Left _ -> (defaultComp, defaultConf)
Right c -> (LBI.compiler c, LBI.withPrograms c)
(comp, conf, dbs) <- case buildConfig of
Left _ -> die $ "Couldn't load the saved package config file. "
++ "Most likely reason: the package was configured with a different "
++ "version of Cabal than the one cabal-install was built with."
Right c -> return (LBI.compiler c, LBI.withPrograms c, LBI.withPackageDB c)
let globalFlags' = savedGlobalFlags config `Monoid.mappend` globalFlags
sandboxConfigPath <- getSandboxConfigFilePath globalFlags
sandboxConfigExists <- doesFileExist sandboxConfigPath
Expand All @@ -157,13 +156,6 @@ status verbosity globalFlags statusFlags = do
return $ ( Just sandboxPath
, Just $ sandboxPackageDBPath sandboxPath comp platform)
else return (Nothing, Nothing)
let dbs :: [PackageDB] -- TODO: it might be better to inspect the currently
-- configured dbs instead of a static global,local,..
dbs = GlobalPackageDB
: UserPackageDB
: case sandboxDbPath of
Nothing -> []
Just p -> [SpecificPackageDB p]
let noFlags = not $ any Cabal.fromFlag [ statusVersion statusFlags
, statusProgVersions statusFlags
, statusCompiler statusFlags
Expand Down

0 comments on commit d3ff4a9

Please sign in to comment.