From 20e5b07b8b1c930d5d353b214a2407fa5fbc647e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 13 Jul 2014 09:34:19 +0200 Subject: [PATCH] lib/package_conflicts.c: do not add dups unnecessarily. --- lib/package_conflicts.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/package_conflicts.c b/lib/package_conflicts.c index a784d63c..22e5f4d7 100644 --- a/lib/package_conflicts.c +++ b/lib/package_conflicts.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Juan Romero Pardines. + * Copyright (c) 2012-2014 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,7 +95,9 @@ xbps_pkg_find_conflicts(struct xbps_handle *xhp, repopkgver); buf = xbps_xasprintf("CONFLICT: %s with " "installed pkg %s", repopkgver, pkgver); - xbps_array_add_cstring(trans_cflicts, buf); + if (!xbps_match_string_in_array(trans_cflicts, buf)) + xbps_array_add_cstring(trans_cflicts, buf); + free(buf); continue; } @@ -117,7 +119,9 @@ xbps_pkg_find_conflicts(struct xbps_handle *xhp, "transaction %s <-> %s\n", pkgver, repopkgver); buf = xbps_xasprintf("CONFLICT: %s with " "%s in transaction", repopkgver, pkgver); - xbps_array_add_cstring(trans_cflicts, buf); + if (!xbps_match_string_in_array(trans_cflicts, buf)) + xbps_array_add_cstring(trans_cflicts, buf); + free(buf); continue; }