Commit 026efa8f authored by Joachim Breitner's avatar Joachim Breitner

debian: Preserve newlines at the beginning of fields.

parent a9c80ca5
haskell-debian (3.87.2-2) unstable; urgency=medium
* debian/patches/preserve-newlines: Preserve newlines at the beginning of
fields.
-- Joachim Breitner <nomeata@debian.org> Wed, 12 Aug 2015 17:15:02 +0200
haskell-debian (3.87.2-1) unstable; urgency=medium
* New upstream release
......
commit 26cc6a56bd4a7d8b31673f1ee47198a2949b3af3
Author: Joachim Breitner <mail@joachim-breitner.de>
Date: Wed Aug 12 11:43:34 2015 +0200
Do not use T.strip
as it strips newlines, which are significant (otherwise round-tripping a
Comment field starting in the second line is broken). Use T.dropAround
instead.
Index: haskell-debian/Debian/Control/Text.hs
===================================================================
--- haskell-debian.orig/Debian/Control/Text.hs 2015-08-12 17:13:45.922235347 +0200
+++ haskell-debian/Debian/Control/Text.hs 2015-08-12 17:14:06.478389653 +0200
@@ -29,7 +29,7 @@
import qualified Data.ByteString.Char8 as B
import Data.Char (toLower, chr)
import Data.List (find)
-import qualified Data.Text as T (Text, pack, unpack, map, strip, reverse)
+import qualified Data.Text as T (Text, pack, unpack, map, dropAround, reverse)
import Data.Text.Encoding (decodeUtf8With, encodeUtf8)
--import Data.Text.IO as T (readFile)
import qualified Debian.Control.ByteString as B
@@ -92,7 +92,8 @@
where hasFieldName :: String -> Field' T.Text -> Bool
hasFieldName name (Field (fieldName',_)) = T.pack name == T.map toLower fieldName'
hasFieldName _ _ = False
- stripWS = T.reverse . T.strip . T.reverse . T.strip
+ stripWS = T.dropAround (`elem` " \t")
+ -- T.strip would also strip newlines
protectFieldText = protectFieldText'
asString = T.unpack
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment