xbps_pkg_reverts: return bool instead of int.
This commit is contained in:
parent
0c333d574b
commit
a421bf7db5
@ -1846,9 +1846,9 @@ int xbps_humanize_number(char *buf, int64_t bytes);
|
|||||||
* @param[in] pkg a package which is a candidate to revert pkgver.
|
* @param[in] pkg a package which is a candidate to revert pkgver.
|
||||||
* @param[in] pkgver a package version string
|
* @param[in] pkgver a package version string
|
||||||
*
|
*
|
||||||
* @return 1 if pkg reverts pkgver, 0 otherwise.
|
* @return true if pkg reverts pkgver, false otherwise.
|
||||||
*/
|
*/
|
||||||
int xbps_pkg_reverts(xbps_dictionary_t pkg, const char *pkgver);
|
bool xbps_pkg_reverts(xbps_dictionary_t pkg, const char *pkgver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares package version strings.
|
* Compares package version strings.
|
||||||
|
@ -429,7 +429,7 @@ xbps_humanize_number(char *buf, int64_t bytes)
|
|||||||
/*
|
/*
|
||||||
* Check if pkg is explicitly marked to replace a specific installed version.
|
* Check if pkg is explicitly marked to replace a specific installed version.
|
||||||
*/
|
*/
|
||||||
int
|
bool
|
||||||
xbps_pkg_reverts(xbps_dictionary_t pkg, const char *pkgver) {
|
xbps_pkg_reverts(xbps_dictionary_t pkg, const char *pkgver) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
xbps_array_t reverts;
|
xbps_array_t reverts;
|
||||||
@ -437,14 +437,14 @@ xbps_pkg_reverts(xbps_dictionary_t pkg, const char *pkgver) {
|
|||||||
const char *revertver;
|
const char *revertver;
|
||||||
|
|
||||||
if ((reverts = xbps_dictionary_get(pkg, "reverts")) == NULL)
|
if ((reverts = xbps_dictionary_get(pkg, "reverts")) == NULL)
|
||||||
return 0;
|
return false;
|
||||||
|
|
||||||
for (i = 0; i < xbps_array_count(reverts); i++) {
|
for (i = 0; i < xbps_array_count(reverts); i++) {
|
||||||
xbps_array_get_cstring_nocopy(reverts, i, &revertver);
|
xbps_array_get_cstring_nocopy(reverts, i, &revertver);
|
||||||
if (strcmp(version, revertver) == 0) {
|
if (strcmp(version, revertver) == 0) {
|
||||||
return 1;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user