From ec764ffec8b800395e0c52bb93bb161a87c2c21f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 24 Jan 2012 18:43:43 +0100 Subject: [PATCH] xbps_transaction_package_replace: improved debug output. --- lib/transaction_package_replace.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/transaction_package_replace.c b/lib/transaction_package_replace.c index d74d1b04..4f8560aa 100644 --- a/lib/transaction_package_replace.c +++ b/lib/transaction_package_replace.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Juan Romero Pardines. + * Copyright (c) 2011-2012 Juan Romero Pardines. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ xbps_transaction_package_replace(prop_dictionary_t transd) prop_dictionary_t instd, pkg_repod, reppkgd; prop_object_t obj; prop_object_iterator_t iter; - const char *pattern, *pkgname, *curpkgname; + const char *pattern, *pkgname, *curpkgname, *pkgver, *curpkgver; bool instd_auto; size_t idx; @@ -75,16 +75,20 @@ xbps_transaction_package_replace(prop_dictionary_t transd) if (instd == NULL) continue; } - xbps_dbg_printf("installed pkg to be replaced " - "matched with `%s'\n", pattern); + prop_dictionary_get_cstring_nocopy(pkg_repod, + "pkgname", &pkgname); + prop_dictionary_get_cstring_nocopy(pkg_repod, + "pkgver", &pkgver); + prop_dictionary_get_cstring_nocopy(instd, + "pkgname", &curpkgname); + prop_dictionary_get_cstring_nocopy(instd, + "pkgver", &curpkgver); + xbps_dbg_printf("Package `%s' will be replaced by `%s', " + "matched with `%s'\n", curpkgver, pkgver, pattern); /* * Check that we are not replacing the same package, * due to virtual packages. */ - prop_dictionary_get_cstring_nocopy(pkg_repod, - "pkgname", &pkgname); - prop_dictionary_get_cstring_nocopy(instd, - "pkgname", &curpkgname); if (strcmp(pkgname, curpkgname) == 0) { xbps_dbg_printf("replaced and new package " "are equal (%s)\n", pkgname);