Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
1e534d1a
Commit
1e534d1a
authored
Feb 01, 2014
by
Mikhail Glushenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support MPL-2.0 and BSD2 in 'cabal init'.
parent
cb61663a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
cabal-install/Distribution/Client/Init.hs
cabal-install/Distribution/Client/Init.hs
+11
-7
No files found.
cabal-install/Distribution/Client/Init.hs
View file @
1e534d1a
...
...
@@ -67,7 +67,7 @@ import Language.Haskell.Extension ( Language(..) )
import
Distribution.Client.Init.Types
(
InitFlags
(
..
),
PackageType
(
..
),
Category
(
..
)
)
import
Distribution.Client.Init.Licenses
(
bsd3
,
gplv2
,
gplv3
,
lgpl2
,
lgpl3
,
agplv3
,
apache20
)
(
bsd2
,
bsd3
,
gplv2
,
gplv3
,
lgpl2
,
lgpl3
,
agplv3
,
apache20
,
mpl20
)
import
Distribution.Client.Init.Heuristics
(
guessPackageName
,
guessAuthorNameMail
,
SourceFileEntry
(
..
),
scanForModules
,
neededBuildPrograms
)
...
...
@@ -534,14 +534,15 @@ readMaybe s = case reads s of
writeLicense
::
InitFlags
->
IO
()
writeLicense
flags
=
do
message
flags
"
\n
Generating LICENSE..."
year
<-
getYear
year
<-
show
<$>
getYear
let
authors
=
fromMaybe
"???"
.
flagToMaybe
.
author
$
flags
let
licenseFile
=
case
license
flags
of
Flag
BSD
3
->
Just
$
bsd3
(
fromMaybe
"???"
.
flagToMaybe
.
author
$
flags
)
(
show
year
)
Flag
BSD
2
->
Just
$
bsd2
authors
year
Flag
BSD3
->
Just
$
bsd3
authors
year
Flag
(
GPL
(
Just
(
Version
{
versionBranch
=
[
2
]})))
->
Just
gplv2
...
...
@@ -561,6 +562,9 @@ writeLicense flags = do
Flag
(
Apache
(
Just
(
Version
{
versionBranch
=
[
2
,
0
]})))
->
Just
apache20
Flag
(
MPL
(
Version
{
versionBranch
=
[
2
,
0
]}))
->
Just
mpl20
_
->
Nothing
case
licenseFile
of
...
...
Write
Preview
Markdown
is supported
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