[tools] 01/01: binNMUs: Make more robust

Joachim Breitner nomeata at moszumanska.debian.org
Sun Feb 7 10:29:24 UTC 2016


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

nomeata pushed a commit to branch master
in repository tools.

commit d695f8d98232ce32c23f562181da416d38599ee6
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Sun Feb 7 11:29:17 2016 +0100

    binNMUs: Make more robust
---
 binNMUs.hs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/binNMUs.hs b/binNMUs.hs
index d37e724..697b0cd 100644
--- a/binNMUs.hs
+++ b/binNMUs.hs
@@ -207,10 +207,14 @@ formatReason (UpgradedDep base hash1 hash2)
     = printf "%s changed from %s to %s" base hash1 hash2
 
 mkUpgradedDep :: VirtPackage -> VirtPackage -> Reason
-mkUpgradedDep d1 d2 = UpgradedDep base hash1 hash2
+mkUpgradedDep d1 d2 =
+    case differingHashes of
+        ((hash1,hash2):_) -> UpgradedDep base hash1 hash2
+        [] -> UpgradedDep (vpBase d1) (dash (vpHashes d1)) (dash (vpHashes d2))
   where
-    base = intercalate "-" $ vpBase d1 : map fst commonHashes
-    (commonHashes, (hash1,hash2):_) = span (uncurry (==)) $ zip (vpHashes d1) (vpHashes d2)
+    base = dash $ vpBase d1 : map fst commonHashes
+    (commonHashes, differingHashes) = span (uncurry (==)) $ zip (vpHashes d1) (vpHashes d2)
+    dash = intercalate "-"
 
 -- | Data aquisition and processing
 getNMUs :: Conf -> [SourceName] -> Arch -> IO [CBinNMU]

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