Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
Cabal
Commits
94bed886
Commit
94bed886
authored
19 years ago
by
Isaac Potoczny-Jones
Browse files
Options
Downloads
Patches
Plain Diff
ross paterson: simplify consruction of pkg tool name
parent
16ba3527
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Distribution/Simple/Configure.hs
+4
-3
4 additions, 3 deletions
Distribution/Simple/Configure.hs
with
4 additions
and
3 deletions
Distribution/Simple/Configure.hs
+
4
−
3
View file @
94bed886
...
...
@@ -83,7 +83,8 @@ import Data.List (intersperse, nub, maximumBy, isPrefixOf)
import
Data.Char
(
isSpace
)
import
Data.Maybe
(
fromMaybe
)
import
System.Directory
import
Distribution.Compat.FilePath
(
splitFileName
,
joinFileName
)
import
Distribution.Compat.FilePath
(
splitFileName
,
joinFileName
,
joinFileExt
,
exeExtension
)
import
System.Cmd
(
system
)
import
System.Exit
(
ExitCode
(
..
)
)
import
Control.Monad
(
when
,
unless
)
...
...
@@ -345,8 +346,8 @@ pCheck rs = [ r | (r,s) <- rs, all isSpace s ]
guessPkgToolFromHCPath
::
Int
->
CompilerFlavor
->
FilePath
->
IO
FilePath
guessPkgToolFromHCPath
verbose
flavor
path
=
do
let
pkgToolName
=
compilerPkgToolName
flavor
(
dir
,
name
)
=
splitFileName
path
pkgtool
=
dir
`
joinFileName
`
pkgToolName
++
drop
(
length
(
compilerBinaryName
flavor
))
name
(
dir
,
_
)
=
splitFileName
path
pkgtool
=
dir
`
joinFileName
`
pkgToolName
`
joinFileExt
`
exeExtension
when
(
verbose
>
0
)
$
message
$
"looking for package tool: "
++
pkgToolName
++
" near compiler in "
++
path
exists
<-
doesFileExist
pkgtool
when
(
not
exists
)
$
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment