Skip to content

Commit

Permalink
Only use gtar on OpenBSD for xz archives (#2283)
Browse files Browse the repository at this point in the history
Since OpenBSD's tar does not support xz, use only `gtar` there. Prefer
`gtar` elsewhere so I can test this.

The UX is not adequate but it might be useful.
  • Loading branch information
Blaisorblade committed Aug 6, 2016
1 parent 8e61e9a commit 90ecd0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Stack/Setup.hs
Expand Up @@ -804,10 +804,16 @@ installGHCPosix version _ archiveFile archiveType destDir = do
TarBz2 -> return "bzip2"
TarGz -> return "gzip"
SevenZ -> error "Don't know how to deal with .7z files on non-Windows"
-- Slight hack: OpenBSD's tar doesn't support xz.
-- https://github.com/commercialhaskell/stack/issues/2283#issuecomment-237980986
let tarDep =
case (platform, archiveType) of
(Platform _ Cabal.OpenBSD, TarXz) -> checkDependency "gtar"
_ -> checkDependency "gtar" <|> checkDependency "tar"
(zipTool, makeTool, tarTool) <- checkDependencies $ (,,)
<$> checkDependency zipTool'
<*> (checkDependency "gmake" <|> checkDependency "make")
<*> checkDependency "tar"
<*> tarDep

$logDebug $ "ziptool: " <> T.pack zipTool
$logDebug $ "make: " <> T.pack makeTool
Expand Down

0 comments on commit 90ecd0c

Please sign in to comment.