Skip to content

Commit

Permalink
Don't allow package uploads with x-revision fields
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoutts committed Jul 21, 2015
1 parent 781b132 commit 10bbd33
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Distribution/Server/Packages/Unpack.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import Distribution.Server.Util.Parse
import Distribution.License
( License(..) )

import Data.Maybe
( isJust )
import Data.List
( nub, (\\), partition, intercalate )
import Data.Time
Expand Down Expand Up @@ -196,6 +198,12 @@ extraChecks genPkgDesc = do
throwError $ "This server does not accept packages with 'license' "
++ "field set to AllRightsReserved."

-- Check for an existing x-revision
when (isJust (lookup "x-revision" (customFieldsPD pkgDesc))) $
throwError $ "Newly uploaded packages must not specify the 'x-revision' "
++ "field in their .cabal file. This is only used for "
++ "post-release revisions."

-- Check reasonableness of names of exposed modules
let topLevel = case library pkgDesc of
Nothing -> []
Expand Down

0 comments on commit 10bbd33

Please sign in to comment.