Skip to content
GitLab
Menu
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
e9ec08c5
Commit
e9ec08c5
authored
Sep 06, 2007
by
Duncan Coutts
Browse files
Fixups for recent cabal api changes
parent
397985f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
cabal-install/src/Network/Hackage/CabalInstall/BuildDep.hs
View file @
e9ec08c5
...
...
@@ -19,6 +19,7 @@ import Network.Hackage.CabalInstall.Types (ConfigFlags (..), UnresolvedDependenc
import
Distribution.PackageDescription
(
readPackageDescription
,
buildDepends
,
GenericPackageDescription
(
..
))
import
Distribution.Simple.Configure
(
getInstalledPackages
)
import
Distribution.Simple.Compiler
(
PackageDB
(
..
))
{-|
This function behaves exactly like 'Network.Hackage.CabalInstall.Install.install' except
...
...
@@ -26,8 +27,13 @@ import Distribution.Simple.Configure (getInstalledPackages)
-}
buildDep
::
ConfigFlags
->
[
String
]
->
[
UnresolvedDependency
]
->
IO
()
buildDep
cfg
globalArgs
deps
=
do
ipkgs
<-
getInstalledPackages
(
configCompiler
cfg
)
(
configUserIns
cfg
)
(
configVerbose
cfg
)
apkgs
<-
fmap
getPackages
(
fmap
(
getBuildDeps
ipkgs
)
(
resolveDependenciesAux
cfg
ipkgs
deps
))
=
do
Just
ipkgs
<-
getInstalledPackages
(
configVerbose
cfg
)
(
configCompiler
cfg
)
(
if
configUserIns
cfg
then
UserPackageDB
else
GlobalPackageDB
)
(
configPrograms
cfg
)
apkgs
<-
fmap
getPackages
(
fmap
(
getBuildDeps
ipkgs
)
(
resolveDependenciesAux
cfg
ipkgs
deps
))
mapM_
(
installPkg
cfg
globalArgs
)
apkgs
-- | Takes the path to a .cabal file, and installs the build-dependencies listed there.
...
...
cabal-install/src/Network/Hackage/CabalInstall/Configure.hs
View file @
e9ec08c5
...
...
@@ -132,6 +132,7 @@ mkConfigFlags cfg
outputGen
<-
defaultOutputGen
(
tempVerbose
cfg
)
let
config
=
ConfigFlags
{
configCompiler
=
comp
,
configPrograms
=
conf'''
,
configConfDir
=
confDir
,
configCacheDir
=
cacheDir
,
configPkgListDir
=
pkgListDir
...
...
cabal-install/src/Network/Hackage/CabalInstall/Info.hs
View file @
e9ec08c5
...
...
@@ -19,12 +19,17 @@ import Network.Hackage.CabalInstall.Types (ConfigFlags(..), ResolvedPackage(..)
import
Distribution.Package
(
PackageIdentifier
)
import
Distribution.Simple.Configure
(
getInstalledPackages
)
import
Distribution.Simple.Compiler
(
PackageDB
(
..
))
import
Data.Maybe
(
listToMaybe
)
info
::
ConfigFlags
->
[
String
]
->
[
UnresolvedDependency
]
->
IO
()
info
cfg
globalArgs
deps
=
do
ipkgs
<-
getInstalledPackages
(
configCompiler
cfg
)
(
configUserIns
cfg
)
(
configVerbose
cfg
)
=
do
Just
ipkgs
<-
getInstalledPackages
(
configVerbose
cfg
)
(
configCompiler
cfg
)
(
if
configUserIns
cfg
then
UserPackageDB
else
GlobalPackageDB
)
(
configPrograms
cfg
)
apkgs
<-
resolveDependencies
cfg
[]
deps
mapM_
(
infoPkg
cfg
ipkgs
globalArgs
)
apkgs
...
...
cabal-install/src/Network/Hackage/CabalInstall/Install.hs
View file @
e9ec08c5
...
...
@@ -28,6 +28,7 @@ import Network.Hackage.CabalInstall.TarUtils
import
Distribution.Simple.SetupWrapper
(
setupWrapper
)
import
Distribution.Simple.Configure
(
getInstalledPackages
)
import
Distribution.Simple.Compiler
(
PackageDB
(
..
))
import
Distribution.Package
(
showPackageId
,
PackageIdentifier
)
import
Distribution.Verbosity
import
System.FilePath
((
</>
),
splitFileName
)
...
...
@@ -44,7 +45,11 @@ import System.Posix.Signals
-- |Installs the packages needed to satisfy a list of dependencies.
install
::
ConfigFlags
->
[
String
]
->
[
UnresolvedDependency
]
->
IO
()
install
cfg
globalArgs
deps
=
do
ipkgs
<-
getInstalledPackages
(
configCompiler
cfg
)
(
configUserIns
cfg
)
(
configVerbose
cfg
)
=
do
Just
ipkgs
<-
getInstalledPackages
(
configVerbose
cfg
)
(
configCompiler
cfg
)
(
if
configUserIns
cfg
then
UserPackageDB
else
GlobalPackageDB
)
(
configPrograms
cfg
)
resolvedDeps
<-
resolveDependencies
cfg
ipkgs
deps
let
apkgs
=
getPackages
resolvedDeps
if
null
apkgs
...
...
cabal-install/src/Network/Hackage/CabalInstall/Types.hs
View file @
e9ec08c5
...
...
@@ -13,6 +13,7 @@
module
Network.Hackage.CabalInstall.Types
where
import
Distribution.Simple.Compiler
(
CompilerFlavor
(
..
),
Compiler
)
import
Distribution.Simple.Program
(
ProgramConfiguration
)
import
Distribution.Package
(
PackageIdentifier
)
import
Distribution.Version
(
Dependency
)
import
Distribution.Verbosity
...
...
@@ -57,6 +58,7 @@ data TempFlags = TempFlags {
data
ConfigFlags
=
ConfigFlags
{
configCompiler
::
Compiler
,
configPrograms
::
ProgramConfiguration
,
configConfDir
::
FilePath
,
configCacheDir
::
FilePath
,
configPkgListDir
::
FilePath
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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