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
Glasgow Haskell Compiler
Packages
Cabal
Commits
bc8bb400
Commit
bc8bb400
authored
12 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Patches
Plain Diff
Add a function for listing packages installed in a sandbox.
parent
b90107d4
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
cabal-install/Distribution/Client/Sandbox.hs
+12
-1
12 additions, 1 deletion
cabal-install/Distribution/Client/Sandbox.hs
with
12 additions
and
1 deletion
cabal-install/Distribution/Client/Sandbox.hs
+
12
−
1
View file @
bc8bb400
...
...
@@ -29,6 +29,7 @@ module Distribution.Client.Sandbox (
tryGetIndexFilePath
,
sandboxBuildDir
,
getInstalledPackagesInSandbox
,
-- FIXME: move somewhere else
configPackageDB'
,
configCompilerAux'
...
...
@@ -69,7 +70,8 @@ import Distribution.PackageDescription.Parse ( readPackageDescription )
import
Distribution.Simple.Compiler
(
Compiler
(
..
),
PackageDB
(
..
)
,
PackageDBStack
)
import
Distribution.Simple.Configure
(
configCompilerAux
,
interpretPackageDbFlags
)
,
interpretPackageDbFlags
,
getPackageDBContents
)
import
Distribution.Simple.PreProcess
(
knownSuffixHandlers
)
import
Distribution.Simple.Program
(
ProgramConfiguration
)
import
Distribution.Simple.Setup
(
Flag
(
..
)
...
...
@@ -86,6 +88,7 @@ import Distribution.Verbosity ( Verbosity, lessVerbose )
import
Distribution.Compat.Env
(
lookupEnv
,
setEnv
)
import
Distribution.Compat.FilePerms
(
setFileHidden
)
import
qualified
Distribution.Client.Sandbox.Index
as
Index
import
qualified
Distribution.Simple.PackageIndex
as
InstalledPackageIndex
import
qualified
Distribution.Simple.Register
as
Register
import
Control.Exception
(
assert
,
bracket_
)
import
Control.Monad
(
forM
,
liftM2
,
unless
,
when
)
...
...
@@ -177,6 +180,14 @@ tryGetIndexFilePath config = do
checkConfiguration
=
"Please check your configuration ('"
++
userPackageEnvironmentFile
++
"')."
-- | Which packages are installed in the sandbox package DB?
getInstalledPackagesInSandbox
::
Verbosity
->
ConfigFlags
->
Compiler
->
ProgramConfiguration
->
IO
InstalledPackageIndex
.
PackageIndex
getInstalledPackagesInSandbox
verbosity
configFlags
comp
conf
=
do
let
[
Just
sandboxDB
@
(
SpecificPackageDB
_
)]
=
configPackageDBs
configFlags
getPackageDBContents
verbosity
comp
sandboxDB
conf
-- | Temporarily add $SANDBOX_DIR/bin to $PATH.
withSandboxBinDirOnSearchPath
::
FilePath
->
IO
a
->
IO
a
withSandboxBinDirOnSearchPath
sandboxDir
=
bracket_
addBinDir
rmBinDir
...
...
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