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
a4c0be01
Commit
a4c0be01
authored
4 years ago
by
Oleg Grenrus
Browse files
Options
Downloads
Patches
Plain Diff
Resolve #6809: v2-update supports -z
parent
02859ae9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/Distribution/Client/CmdUpdate.hs
+16
-8
16 additions, 8 deletions
cabal-install/Distribution/Client/CmdUpdate.hs
cabal-install/Distribution/Client/ProjectFlags.hs
+1
-0
1 addition, 0 deletions
cabal-install/Distribution/Client/ProjectFlags.hs
with
17 additions
and
8 deletions
cabal-install/Distribution/Client/CmdUpdate.hs
+
16
−
8
View file @
a4c0be01
...
...
@@ -24,7 +24,9 @@ import Distribution.Client.ProjectConfig
(
ProjectConfig
(
..
)
,
ProjectConfigShared
(
projectConfigConfigFile
)
,
projectConfigWithSolverRepoContext
,
withProjectOrGlobalConfig
)
,
withProjectOrGlobalConfigIgn
)
import
Distribution.Client.ProjectFlags
(
ProjectFlags
(
..
),
defaultProjectFlags
,
projectFlagsOptions
)
import
Distribution.Client.Types
(
Repo
(
..
),
RepoName
(
..
),
unRepoName
,
RemoteRepo
(
..
),
isRepoRemote
)
import
Distribution.Client.HttpUtils
...
...
@@ -61,11 +63,11 @@ import Distribution.Client.GZipUtils (maybeDecompress)
import
System.FilePath
((
<.>
),
dropExtension
)
import
Data.Time
(
getCurrentTime
)
import
Distribution.Simple.Command
(
CommandUI
(
..
),
usageAlternatives
)
(
CommandUI
(
..
),
usageAlternatives
,
optionName
)
import
qualified
Hackage.Security.Client
as
Sec
updateCommand
::
CommandUI
(
NixStyleFlags
()
)
updateCommand
::
CommandUI
(
NixStyleFlags
ProjectFlags
)
updateCommand
=
CommandUI
{
commandName
=
"v2-update"
,
commandSynopsis
=
"Updates list of known packages."
...
...
@@ -96,8 +98,12 @@ updateCommand = CommandUI
++
"https://github.com/haskell/cabal/issues and if you
\n
have any time "
++
"to get involved and help with testing, fixing bugs etc then
\n
that "
++
"is very much appreciated.
\n
"
,
commandOptions
=
nixStyleOptions
(
const
[]
)
-- clientInstallOptions
,
commandDefaultFlags
=
defaultNixStyleFlags
()
-- defaultClientInstallFlags
-- TODO: Add ProjectFlags to NixStyleFlags,
-- so project-file won't be ambiguous
,
commandOptions
=
nixStyleOptions
$
const
$
filter
(
\
o
->
optionName
o
`
notElem
`
[
"project-file"
])
$
projectFlagsOptions
,
commandDefaultFlags
=
defaultNixStyleFlags
defaultProjectFlags
}
data
UpdateRequest
=
UpdateRequest
...
...
@@ -114,9 +120,11 @@ instance Parsec UpdateRequest where
state
<-
P
.
char
','
*>
parsec
<|>
pure
IndexStateHead
return
(
UpdateRequest
name
state
)
updateAction
::
NixStyleFlags
()
->
[
String
]
->
GlobalFlags
->
IO
()
updateAction
NixStyleFlags
{
..
}
extraArgs
globalFlags
=
do
projectConfig
<-
withProjectOrGlobalConfig
verbosity
globalConfigFlag
updateAction
::
NixStyleFlags
ProjectFlags
->
[
String
]
->
GlobalFlags
->
IO
()
updateAction
NixStyleFlags
{
extraFlags
=
projectFlags
,
..
}
extraArgs
globalFlags
=
do
let
ignoreProject
=
fromFlagOrDefault
False
(
flagIgnoreProject
projectFlags
)
projectConfig
<-
withProjectOrGlobalConfigIgn
ignoreProject
verbosity
globalConfigFlag
(
projectConfig
<$>
establishProjectBaseContext
verbosity
cliConfig
OtherCommand
)
(
\
globalConfig
->
return
$
globalConfig
<>
cliConfig
)
...
...
This diff is collapsed.
Click to expand it.
cabal-install/Distribution/Client/ProjectFlags.hs
+
1
−
0
View file @
a4c0be01
...
...
@@ -17,6 +17,7 @@ data ProjectFlags = ProjectFlags
{
flagProjectFileName
::
Flag
FilePath
,
flagIgnoreProject
::
Flag
Bool
}
deriving
(
Show
)
defaultProjectFlags
::
ProjectFlags
defaultProjectFlags
=
ProjectFlags
...
...
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