From e20bc0a239e3ab08d605c12bcce2f25cefa5b1b6 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 14 Aug 2009 07:11:09 +0200 Subject: [PATCH] xbps_configure_pkg: use a bool to know if pkg is installed or not. --HG-- extra : convert_revision : 799b0e741c8660d84c68ec63c99dea8b52c093d7 --- lib/configure.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/configure.c b/lib/configure.c index 7e93222c5b..77a5984913 100644 --- a/lib/configure.c +++ b/lib/configure.c @@ -43,6 +43,7 @@ xbps_configure_pkg(const char *pkgname) char *buf; int rv = 0, flags = 0; pkg_state_t state = 0; + bool reconfigure = false; assert(pkgname != NULL); @@ -55,6 +56,8 @@ xbps_configure_pkg(const char *pkgname) if (state == XBPS_PKG_STATE_INSTALLED) { if ((flags & XBPS_FLAG_FORCE) == 0) return 0; + + reconfigure = true; } else if (state != XBPS_PKG_STATE_UNPACKED) return EINVAL; @@ -66,7 +69,7 @@ xbps_configure_pkg(const char *pkgname) prop_object_release(pkgd); printf("%sonfiguring package %s-%s...\n", - flags & XBPS_FLAG_FORCE ? "Rec" : "C", pkgname, version); + reconfigure ? "Rec" : "C", pkgname, version); if (strcmp(rootdir, "") == 0) rootdir = "/";