Skip to content

Commit 734dae4

Browse files
committed
fixup! Add --install-cabal option for stack setup.
1 parent c0942c6 commit 734dae4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Stack/Setup.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ ensureCompiler sopts = do
494494
unless needLocal $ do
495495
$logWarn "Trying to change a Cabal library on a GHC not installed by stack."
496496
$logWarn "This may fail, caveat emptor!"
497-
upgradeCabal menv wc (fromJust cabalVersion)
497+
forM_ cabalVersion (upgradeCabal menv wc)
498498

499499
case mtools of
500500
Just (Just (ToolGhcjs cv), _) -> ensureGhcjsBooted menv cv (soptsInstallIfMissing sopts)
@@ -660,10 +660,10 @@ upgradeCabal menv wc cabalVersion = do
660660
m <- unpackPackageIdents menv tmpdir Nothing (Map.singleton ident Nothing)
661661

662662
compilerPath <- join $ findExecutable menv (compilerExeName wc)
663-
newestDir <- parseRelDir $ versionString version
663+
versionDir <- parseRelDir $ versionString version
664664
let installRoot = toFilePath $ parent (parent compilerPath)
665665
</> $(mkRelDir "new-cabal")
666-
</> newestDir
666+
</> versionDir
667667
dir <-
668668
case Map.lookup ident m of
669669
Nothing -> error "upgradeCabal: Invariant violated, dir missing"

src/Stack/Types/Version.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ instance Exception VersionParseFail
6565
instance Show VersionParseFail where
6666
show (VersionParseFail bs) = "Invalid version: " ++ show bs
6767

68-
-- | A package version or the latest.
68+
-- | A Package upgrade; Latest or a specific version.
6969
data UpgradeTo = Specific Version | Latest deriving (Show)
7070

7171
-- | A package version.

0 commit comments

Comments
 (0)