Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cabal init: generate less for PublicDomain
  • Loading branch information
byorgey committed Jul 20, 2015
1 parent 060f91e commit 67ed3a6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions cabal-install/Distribution/Client/Init.hs
Expand Up @@ -116,7 +116,9 @@ initCabal verbosity packageDBs repos comp conf initFlags = do

initFlags' <- extendFlags installedPkgIndex sourcePkgDb initFlags

writeLicense initFlags'
case license initFlags' of
Flag PublicDomain -> return ()
_ -> writeLicense initFlags'
writeSetupFile initFlags'
writeChangeLog initFlags'
createSourceDirectories initFlags'
Expand Down Expand Up @@ -807,9 +809,11 @@ generateCabalFile fileName c =
(Just "The license under which the package is released.")
True

, fieldS "license-file" (Flag "LICENSE")
(Just "The file containing the license text.")
True
, case (license c) of
Flag PublicDomain -> empty
_ -> fieldS "license-file" (Flag "LICENSE")
(Just "The file containing the license text.")
True

, fieldS "author" (author c)
(Just "The package author(s).")
Expand All @@ -819,9 +823,11 @@ generateCabalFile fileName c =
(Just "An email address to which users can send suggestions, bug reports, and patches.")
True

, fieldS "copyright" NoFlag
(Just "A copyright notice.")
True
, case (license c) of
Flag PublicDomain -> empty
_ -> fieldS "copyright" NoFlag
(Just "A copyright notice.")
True

, fieldS "category" (either id display `fmap` category c)
Nothing
Expand Down

0 comments on commit 67ed3a6

Please sign in to comment.