Sanitize debian changelog version before putting it into cabal file. Closes: #708619

This commit is contained in:
Joey Hess 2013-05-17 11:24:18 -04:00
parent ebe10edf67
commit 39ac8d18ed
2 changed files with 10 additions and 1 deletions

View file

@ -10,6 +10,7 @@ import System.FilePath
import System.Environment
import Data.Maybe
import Control.Monad.IfElse
import Data.Char
import Build.TestConfig
import Utility.SafeCommand
@ -129,7 +130,8 @@ getSshConnectionCaching = Config "sshconnectioncaching" . BoolConfig <$>
{- Set up cabal file with version. -}
cabalSetup :: IO ()
cabalSetup = do
version <- takeWhile (/= '~') <$> getChangelogVersion
version <- takeWhile (\c -> isDigit c || c == '.')
<$> getChangelogVersion
cabal <- readFile cabalfile
writeFile tmpcabalfile $ unlines $
map (setfield "Version" version) $