From 298305c1d5a66972d858d922b2d1590b897e464c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 29 Jan 2011 01:55:52 +0100 Subject: [PATCH] Make some xbps_printf()s conditioned on XBPS_FLAG_VERBOSE. --- lib/package_purge.c | 5 +++-- lib/package_remove.c | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/package_purge.c b/lib/package_purge.c index 847e7305..83e2e0fb 100644 --- a/lib/package_purge.c +++ b/lib/package_purge.c @@ -129,7 +129,7 @@ int xbps_purge_pkg(const char *pkgname, bool check_state) { prop_dictionary_t dict, pkgd; - int rv = 0; + int rv = 0, flags = xbps_get_flags(); pkg_state_t state = 0; assert(pkgname != NULL); @@ -187,7 +187,8 @@ xbps_purge_pkg(const char *pkgname, bool check_state) if ((rv = xbps_unregister_pkg(pkgname)) != 0) goto out; - xbps_printf("Package %s purged successfully.\n", pkgname); + if (flags & XBPS_FLAG_VERBOSE) + xbps_printf("Package %s purged successfully.\n", pkgname); out: xbps_regpkgdb_dictionary_release(); diff --git a/lib/package_remove.c b/lib/package_remove.c index f4d7a765..53eb783d 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -79,13 +79,11 @@ xbps_remove_pkg_files(prop_dictionary_t dict, const char *key) prop_object_t obj; const char *file, *sha256, *curobj = NULL; char *path = NULL; - int flags = 0, rv = 0; + int flags = xbps_get_flags(), rv = 0; assert(dict != NULL); assert(key != NULL); - flags = xbps_get_flags(); - array = prop_dictionary_get(dict, key); if (array == NULL) return EINVAL; @@ -158,7 +156,8 @@ xbps_remove_pkg_files(prop_dictionary_t dict, const char *key) } else { /* Success */ - xbps_printf("Removed %s: `%s'\n", curobj, file); + if (flags & XBPS_FLAG_VERBOSE) + xbps_printf("Removed %s: `%s'\n", curobj, file); } free(path); }