Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
c978dd07
Commit
c978dd07
authored
Aug 25, 2004
by
ijones
Browse files
toward -Wall cleanliness Install, Register
parent
9a73bb19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Distribution/Simple/Install.hs
View file @
c978dd07
...
...
@@ -64,7 +64,6 @@ import Distribution.Simple.Utils(setupMessage, moveSources,
import
Distribution.Setup
(
CompilerFlavor
(
..
),
Compiler
(
..
))
import
Control.Monad
(
when
)
import
System.Cmd
(
system
)
#
ifdef
DEBUG
import
HUnit
(
Test
)
...
...
@@ -100,8 +99,8 @@ installExeGhc pref buildPref pkg_descr
installLibGHC
::
FilePath
-- ^install location
->
FilePath
-- ^Build location
->
PackageDescription
->
IO
()
installLibGHC
pref
buildPref
pkg_descr
@
PackageDescription
{
library
=
Just
l
,
package
=
p
}
installLibGHC
pref
buildPref
PackageDescription
{
library
=
Just
l
,
package
=
p
}
=
do
moveSources
(
pathJoin
[
buildPref
,
hsSourceDir
l
])
pref
(
modules
l
)
[
"hi"
]
copyFile
(
mkLibName
buildPref
(
showPackageId
p
))
(
mkLibName
pref
(
showPackageId
p
))
...
...
@@ -110,7 +109,7 @@ installLibGHC pref buildPref pkg_descr@PackageDescription{library=Just l,
installHugs
::
FilePath
-- ^Install location
->
FilePath
-- ^Build location
->
PackageDescription
->
IO
()
installHugs
pref
buildPref
pkg_descr
@
PackageDescription
{
library
=
Just
l
}
installHugs
pref
buildPref
PackageDescription
{
library
=
Just
l
}
=
moveSources
(
pathJoin
[
buildPref
,
hsSourceDir
l
])
pref
(
modules
l
)
[
"lhs"
,
"hs"
]
-- -----------------------------------------------------------------------------
...
...
@@ -126,7 +125,7 @@ mkLibDir pkg_descr lbi install_prefixM =
]
mkBinDir
::
PackageDescription
->
LocalBuildInfo
->
Maybe
FilePath
->
FilePath
mkBinDir
pkg_descr
lbi
install_prefixM
=
mkBinDir
_
lbi
install_prefixM
=
pathJoin
[(
maybe
(
prefix
lbi
)
id
install_prefixM
),
"bin"
]
-- ------------------------------------------------------------
...
...
Distribution/Simple/Register.hs
View file @
c978dd07
...
...
@@ -60,7 +60,6 @@ import Distribution.Simple.Utils (setupMessage, rawSystemExit, die)
import
Distribution.Simple.GHCPackageConfig
(
mkGHCPackageConfig
,
showGHCPackageConfig
)
import
qualified
Distribution.Simple.GHCPackageConfig
as
GHC
(
localPackageConfig
)
import
System
(
getEnv
)
import
System.Directory
(
doesFileExist
)
import
Control.Monad
(
when
,
unless
)
...
...
@@ -80,8 +79,7 @@ register pkg_descr lbi userInst = do
setupMessage
"Registering"
pkg_descr
case
compilerFlavor
(
compiler
lbi
)
of
GHC
->
do
let
pkg_config
=
mkGHCPackageConfig
pkg_descr
lbi
(
localConf
,
pkgConfExists
)
<-
GHC
.
localPackageConfig
GHC
->
do
(
localConf
,
pkgConfExists
)
<-
GHC
.
localPackageConfig
unless
pkgConfExists
$
writeFile
localConf
"[]
\n
"
instConfExists
<-
doesFileExist
installedPkgConfigFile
unless
instConfExists
(
writeInstalledConfig
pkg_descr
lbi
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment