xbps_configure_pkg: use a bool to know if pkg is installed or not.
--HG-- extra : convert_revision : 799b0e741c8660d84c68ec63c99dea8b52c093d7
This commit is contained in:
parent
99384e1f5e
commit
e20bc0a239
1 changed files with 4 additions and 1 deletions
|
@ -43,6 +43,7 @@ xbps_configure_pkg(const char *pkgname)
|
||||||
char *buf;
|
char *buf;
|
||||||
int rv = 0, flags = 0;
|
int rv = 0, flags = 0;
|
||||||
pkg_state_t state = 0;
|
pkg_state_t state = 0;
|
||||||
|
bool reconfigure = false;
|
||||||
|
|
||||||
assert(pkgname != NULL);
|
assert(pkgname != NULL);
|
||||||
|
|
||||||
|
@ -55,6 +56,8 @@ xbps_configure_pkg(const char *pkgname)
|
||||||
if (state == XBPS_PKG_STATE_INSTALLED) {
|
if (state == XBPS_PKG_STATE_INSTALLED) {
|
||||||
if ((flags & XBPS_FLAG_FORCE) == 0)
|
if ((flags & XBPS_FLAG_FORCE) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
reconfigure = true;
|
||||||
} else if (state != XBPS_PKG_STATE_UNPACKED)
|
} else if (state != XBPS_PKG_STATE_UNPACKED)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
|
@ -66,7 +69,7 @@ xbps_configure_pkg(const char *pkgname)
|
||||||
prop_object_release(pkgd);
|
prop_object_release(pkgd);
|
||||||
|
|
||||||
printf("%sonfiguring package %s-%s...\n",
|
printf("%sonfiguring package %s-%s...\n",
|
||||||
flags & XBPS_FLAG_FORCE ? "Rec" : "C", pkgname, version);
|
reconfigure ? "Rec" : "C", pkgname, version);
|
||||||
|
|
||||||
if (strcmp(rootdir, "") == 0)
|
if (strcmp(rootdir, "") == 0)
|
||||||
rootdir = "/";
|
rootdir = "/";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue