[Pkg-haskell-commits] darcs: tools: show is a nogo

Joachim Breitner mail at joachim-breitner.de
Sat Nov 9 08:14:31 UTC 2013


Wed Oct 30 08:54:38 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * show is a nogo

    M ./haskell-pkg-debcheck.hs -3 +4

Wed Oct 30 08:54:38 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * show is a nogo
diff -rN -u old-tools/haskell-pkg-debcheck.hs new-tools/haskell-pkg-debcheck.hs
--- old-tools/haskell-pkg-debcheck.hs	2013-11-09 08:14:31.206195577 +0000
+++ new-tools/haskell-pkg-debcheck.hs	2013-11-09 08:14:31.317551637 +0000
@@ -24,6 +24,7 @@
 import Debian.Version.ByteString
 import qualified Debian.Arch
 import qualified Data.HashMap.Lazy as M
+import Text.PrettyPrint.ANSI.Leijen (pretty)
 -- import Data.Map ((!))
 import qualified Data.HashSet as S
 import Debug.Trace
@@ -131,7 +132,7 @@
         guard (fst (wbMap ! (s,a)) == "Installed")
         return (s,(S.singleton a, sv, formatReason x))
     
-    forM (M.toList nmus) $ \(s,(as,sv,exp)) -> putStrLn $ "nmu " ++ show s ++ "_" ++ show sv ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ exp ++ "'"
+    forM (M.toList nmus) $ \(s,(as,sv,exp)) -> putStrLn $ "nmu " ++ show (pretty s) ++ "_" ++ show (prettyDebianVersion sv) ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ exp ++ "'"
     
     let buildingSources = unionWith mergeArches outdatedSources nmus
 
@@ -176,7 +177,7 @@
                     _ -> return ()
             when (not f) $ putStr "# "
             -}
-            when f $ putStrLn $ "dw " ++ show s ++ "_" ++ show sv ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ showRelations dws ++ "'"
+            when f $ putStrLn $ "dw " ++ show (pretty s) ++ "_" ++ show (prettyDebianVersion sv) ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ showRelations dws ++ "'"
 
 interestingSource si = BinPkgName "haskell-devscripts" `elem` (flattenRelations (siBuildDepends si)) &&
                        BinPkgName "ghc6" `notElem` (flattenRelations (siBuildDepends si)) 
@@ -350,7 +351,7 @@
 
 samePkg (Rel p1 _ _) (Rel p2 _ _) = p1 == p2
  
-showRelations = intercalate ", " . map (intercalate " | " . map show)
+showRelations = intercalate ", " . map (intercalate " | " . map (show.pretty))
 
 -- Functions from Data.Map missing in Data.HashMap
 unions :: (Hashable k, Eq k) => [M.HashMap k v] -> M.HashMap k v




More information about the Pkg-haskell-commits mailing list