[Pkg-haskell-commits] [tools] 01/01: binNMUs: More concise presentation of changes in NMU changelogs

Joachim Breitner nomeata at moszumanska.debian.org
Tue Jun 2 20:21:52 UTC 2015


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

nomeata pushed a commit to branch master
in repository tools.

commit c0fb2920950034b6f2b537d91458860483a7a495
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Jun 2 22:21:48 2015 +0200

    binNMUs: More concise presentation of changes in NMU changelogs
---
 binNMUs.hs            | 16 +++++++++-------
 make-static-binary.sh |  2 +-
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/binNMUs.hs b/binNMUs.hs
index 20cc94b..28e2628 100644
--- a/binNMUs.hs
+++ b/binNMUs.hs
@@ -44,9 +44,9 @@ type Version = String
 type Arch = String
 
 data VirtPackage = VirtPackage
-    { vpFull :: String
-    , vpBase :: VirtPackageBase
-    , vpHash :: String
+    { vpFull   :: String
+    , vpBase   :: VirtPackageBase
+    , vpHashes :: [String]
     }
     deriving (Eq, Ord, Show)
 type VirtPackageBase = String -- just the part without the hash (and without libghc-)
@@ -195,8 +195,10 @@ formatReason :: Reason -> String
 formatReason (MissingDep d)
     = printf "%s has disappeared" (vpFull d)
 formatReason (UpgradedDep d1 d2)
-    = printf "%s changed from %s to %s" (vpBase d1) (vpHash d1) (vpHash d2)
-
+    = printf "%s changed from %s to %s" base hash1 hash2
+  where
+    base = intercalate "-" $ vpBase d1 : map fst commonHashes
+    (commonHashes, (hash1,hash2):_) = span (uncurry (==)) $ zip (vpHashes d1) (vpHashes d2)
 
 ordGroupBy :: Ord b => (a -> b) -> [a] -> [(b, [a])]
 ordGroupBy f = M.toAscList . M.fromListWith (++) . map (f &&& (:[]))
@@ -256,7 +258,7 @@ needsRebuild available b
 
 parseVirtPackage :: Conf -> String -> Maybe VirtPackage
 parseVirtPackage conf p = case match (regex conf) p of
-    [[_,a,b]] -> Just (VirtPackage p a b)
+    [(_:id:hashes)] -> Just (VirtPackage p id hashes)
     _ -> Nothing
 
 -- Reading wannabuild dumps
@@ -561,7 +563,7 @@ conf = mkConf
     )
 
 haskellRegex :: String
-haskellRegex = "libghc-(.*)-dev-([0-9.]+-[0-9a-f]{5})"
+haskellRegex = "libghc-(.*)-dev-([0-9.]+)-([0-9a-f]{5})"
 
 -- Parsing package relations with flattening
 -- (this should be faster than flatRels . parseRels)
diff --git a/make-static-binary.sh b/make-static-binary.sh
index 606dc92..c54f05c 100755
--- a/make-static-binary.sh
+++ b/make-static-binary.sh
@@ -1,3 +1,3 @@
-ghc -O2 -optl-static -optl-pthread -package transformers --make haskell-pkg-debcheck.hs
+#ghc -O2 -optl-static -optl-pthread -package transformers --make haskell-pkg-debcheck.hs
 #ghc -O2 -optl-static -optl-pthread -package transformers --make haskell-pkg-debcheck-exp.hs
 ghc -O2 -optl-static -optl-pthread --make binNMUs

-- 
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