d24f9ed
From 36878992ebdd08f0f9b37017f347f5eab18ce9ed Mon Sep 17 00:00:00 2001
d24f9ed
From: Pino Toscano <ptoscano@redhat.com>
d24f9ed
Date: Wed, 23 Jan 2019 12:23:02 +0100
d24f9ed
Subject: [PATCH 2/2] Print Librpm.Multiple_matches exceptions
d24f9ed
d24f9ed
Print a better diagnostic for them, so it is more clear which package
d24f9ed
is detected as present multiple times.
d24f9ed
---
d24f9ed
 src/supermin.ml | 2 ++
d24f9ed
 1 file changed, 2 insertions(+)
d24f9ed
d24f9ed
diff --git a/src/supermin.ml b/src/supermin.ml
d24f9ed
index f9798f9..71d8b64 100644
d24f9ed
--- a/src/supermin.ml
d24f9ed
+++ b/src/supermin.ml
d24f9ed
@@ -298,6 +298,8 @@ let () =
d24f9ed
     error "error: %s: %s: %s" fname (Unix.error_message code) param
d24f9ed
   | Failure msg ->                      (* from failwith/failwithf *)
d24f9ed
     error "failure: %s" msg
d24f9ed
+  | Librpm.Multiple_matches (package, count) -> (* from librpm *)
d24f9ed
+    error "RPM error: %d occurrences for %s" count package
d24f9ed
   | Invalid_argument msg ->             (* probably should never happen *)
d24f9ed
     error "internal error: invalid argument: %s" msg
d24f9ed
   | Assert_failure (file, line, char) -> (* should never happen *)
d24f9ed
-- 
d24f9ed
2.20.1
d24f9ed