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
dd285b5a
Commit
dd285b5a
authored
8 years ago
by
ttuegel
Browse files
Options
Downloads
Patches
Plain Diff
cabal-install: make user config optional if possible
Fixes #3494.
parent
8f32ab44
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cabal-install/Main.hs
+9
-4
9 additions, 4 deletions
cabal-install/Main.hs
with
9 additions
and
4 deletions
cabal-install/Main.hs
+
9
−
4
View file @
dd285b5a
...
...
@@ -181,6 +181,7 @@ import Data.Maybe (listToMaybe)
import
Data.Monoid
(
Monoid
(
..
))
import
Control.Applicative
(
pure
,
(
<$>
))
#
endif
import
Control.Exception
(
SomeException
(
..
),
try
)
import
Control.Monad
(
when
,
unless
)
-- | Entry point
...
...
@@ -315,7 +316,8 @@ wrapperAction command verbosityFlag distPrefFlag =
commandAddAction
command
{
commandDefaultFlags
=
mempty
}
$
\
flags
extraArgs
globalFlags
->
do
let
verbosity
=
fromFlagOrDefault
normal
(
verbosityFlag
flags
)
(
_
,
config
)
<-
loadConfigOrSandboxConfig
verbosity
globalFlags
load
<-
try
(
loadConfigOrSandboxConfig
verbosity
globalFlags
)
let
config
=
either
(
\
(
SomeException
_
)
->
mempty
)
snd
load
distPref
<-
findSavedDistPref
config
(
distPrefFlag
flags
)
let
setupScriptOptions
=
defaultSetupScriptOptions
{
useDistPref
=
distPref
}
setupWrapper
verbosity
setupScriptOptions
Nothing
...
...
@@ -699,7 +701,8 @@ installAction :: (ConfigFlags, ConfigExFlags, InstallFlags, HaddockFlags)
installAction
(
configFlags
,
_
,
installFlags
,
_
)
_
globalFlags
|
fromFlagOrDefault
False
(
installOnly
installFlags
)
=
do
let
verbosity
=
fromFlagOrDefault
normal
(
configVerbosity
configFlags
)
(
_
,
config
)
<-
loadConfigOrSandboxConfig
verbosity
globalFlags
load
<-
try
(
loadConfigOrSandboxConfig
verbosity
globalFlags
)
let
config
=
either
(
\
(
SomeException
_
)
->
mempty
)
snd
load
distPref
<-
findSavedDistPref
config
(
configDistPref
configFlags
)
let
setupOpts
=
defaultSetupScriptOptions
{
useDistPref
=
distPref
}
setupWrapper
verbosity
setupOpts
Nothing
installCommand
(
const
mempty
)
[]
...
...
@@ -915,7 +918,8 @@ haddockAction haddockFlags extraArgs globalFlags = do
cleanAction
::
CleanFlags
->
[
String
]
->
Action
cleanAction
cleanFlags
extraArgs
globalFlags
=
do
(
_
,
config
)
<-
loadConfigOrSandboxConfig
verbosity
globalFlags
load
<-
try
(
loadConfigOrSandboxConfig
verbosity
globalFlags
)
let
config
=
either
(
\
(
SomeException
_
)
->
mempty
)
snd
load
distPref
<-
findSavedDistPref
config
(
cleanDistPref
cleanFlags
)
let
setupScriptOptions
=
defaultSetupScriptOptions
{
useDistPref
=
distPref
...
...
@@ -1148,7 +1152,8 @@ sdistAction (sdistFlags, sdistExFlags) extraArgs globalFlags = do
unless
(
null
extraArgs
)
$
die
$
"'sdist' doesn't take any extra arguments: "
++
unwords
extraArgs
let
verbosity
=
fromFlag
(
sDistVerbosity
sdistFlags
)
(
_
,
config
)
<-
loadConfigOrSandboxConfig
verbosity
globalFlags
load
<-
try
(
loadConfigOrSandboxConfig
verbosity
globalFlags
)
let
config
=
either
(
\
(
SomeException
_
)
->
mempty
)
snd
load
distPref
<-
findSavedDistPref
config
(
sDistDistPref
sdistFlags
)
let
sdistFlags'
=
sdistFlags
{
sDistDistPref
=
toFlag
distPref
}
sdist
sdistFlags'
sdistExFlags
...
...
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