libxbps: return success when requiredby entry already exists.

This commit is contained in:
Juan RP 2011-11-17 12:57:43 +01:00
parent 435aa84fb0
commit 19664f624a
2 changed files with 5 additions and 8 deletions

View File

@ -55,7 +55,7 @@
*/
#define XBPS_PKGINDEX_VERSION "1.3"
#define XBPS_API_VERSION "20111111"
#define XBPS_API_VERSION "20111117"
#define XBPS_VERSION "0.11.0"
/**

View File

@ -46,12 +46,9 @@ add_pkg_into_reqby(prop_dictionary_t pkgd, const char *pkgver)
return ENOMEM;
}
if (xbps_match_string_in_array(reqby, pkgver)) {
if (alloc)
prop_object_release(reqby);
return EEXIST;
}
/* the entry already exists, do nothing */
if (xbps_match_string_in_array(reqby, pkgver))
return 0;
reqstr = prop_string_create_cstring(pkgver);
if (reqstr == NULL) {
@ -176,7 +173,7 @@ xbps_requiredby_pkg_add(prop_array_t pkgs_array, prop_dictionary_t pkgd)
return EINVAL;
rv = add_pkg_into_reqby(pkgd_regpkgdb, pkgver);
if (rv != 0 && rv != EEXIST)
if (rv != 0)
break;
}
prop_object_iterator_release(iter);