[Pkg-haskell-commits] [tools] 01/01: Improve haskell-pkg-debcheck

Joachim Breitner nomeata at moszumanska.debian.org
Thu Jul 31 11:06:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to branch master
in repository tools.

commit 0dbe22e1fd35ec3a84b4021868d3aab3099b2f6e
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Jul 31 13:06:32 2014 +0200

    Improve haskell-pkg-debcheck
---
 haskell-pkg-debcheck.hs | 27 ++++++++++++++++++++-------
 mass-build.sh           |  2 ++
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/haskell-pkg-debcheck.hs b/haskell-pkg-debcheck.hs
index f2ecf42..53ac588 100644
--- a/haskell-pkg-debcheck.hs
+++ b/haskell-pkg-debcheck.hs
@@ -23,7 +23,7 @@ import Debian.Version
 import Debian.Version.ByteString
 import qualified Debian.Arch
 import qualified Data.HashMap.Strict as M
-import Text.PrettyPrint.ANSI.Leijen (pretty)
+import Debian.Pretty (pretty)
 -- import Data.Map ((!))
 import qualified Data.HashSet as S
 import Debug.Trace
@@ -31,10 +31,11 @@ import GHC.Generics
 import Text.Printf
 import qualified Data.Vector as V
 import qualified Data.Text as T
+import Data.Function
 
 m ! k = case M.lookup k m of
     Just x -> x
-    Nothing -> error $ "Could not find " ++ show k ++ " in map " ++ take 50 (show m) ++ "..."
+    Nothing -> error $ "Could not find " ++ show k ++ " in map " ++ take 250 (show m) ++ "..."
 
 type Arch = String
 
@@ -133,7 +134,8 @@ main = do
         guard (fst (wbMap ! (s,a)) == "Installed")
         return (s,(S.singleton a, sv, x))
     
-    forM (M.toList nmus) $ \(s,(as,sv,exp)) -> putStrLn $ "nmu " ++ show (pretty s) ++ "_" ++ show (prettyDebianVersion sv) ++ " . " ++ unwords (S.toList as) ++ " . -m '" ++ exp ++ "'"
+    forM (sortBy (compare `on` fst) $ 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
 
@@ -304,12 +306,23 @@ isNotIgnored pkg = not ("-doc" `isSuffixOf` unBinPkgName pkg || "-prof" `isSuffi
 
 formatReason :: Value -> String
 formatReason (Array rs) =
-    intercalate ", "
+    intercalate ", " $
     [ "missing " ++ T.unpack dep
     | Object r <- V.toList rs
-    , let Just (Object m) = M.lookup "missing" r
-    , let Just (Object p) = M.lookup "pkg" m
-    , let Just (String dep) = M.lookup "unsat-dependency" p
+    , Just (Object m) <- return $ M.lookup "missing" r
+    , let Object p = m ! "pkg"
+    , let String dep = p ! "unsat-dependency"
+    ] ++
+    [ printf "conflict between %s-%s and %s-%s"
+       (T.unpack p1) (T.unpack v1) (T.unpack p2) (T.unpack v2)
+    | Object r <- V.toList rs
+    , Just (Object c) <- return $ M.lookup "conflict" r
+    , let Object pk1 = c ! "pkg1"
+    , let Object pk2 = c ! "pkg2"
+    , let String p1 = pk1 ! "package"
+    , let String v1 = pk1 ! "version"
+    , let String p2 = pk2 ! "package"
+    , let String v2 = pk2 ! "version"
     ]
 
 filterExistingDepWaits wbMap = mapWithKey $ \(s,v) -> mapWithKey $ \a dw -> 
diff --git a/mass-build.sh b/mass-build.sh
index e29b591..b93e5ca 100755
--- a/mass-build.sh
+++ b/mass-build.sh
@@ -178,6 +178,8 @@ then
 	exit
 fi
 dpkg-scanpackages . > Packages
+
+echo "Upgrading schroot"
 sudo sbuild-update --update --upgrade $schroot
 popd >/dev/null
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/tools.git



More information about the Pkg-haskell-commits mailing list