libxbps: fixed xbps_remove_pkg_from_array_by_{name,pattern,pkgver}.

The correct index wasn't being passed to prop_array_remove.
This commit is contained in:
Juan RP 2012-06-01 10:53:28 +02:00
parent 65b5e328d8
commit 652e9afcef
2 changed files with 10 additions and 4 deletions

View File

@ -56,7 +56,7 @@
*/
#define XBPS_PKGINDEX_VERSION "1.5"
#define XBPS_API_VERSION "20120531"
#define XBPS_API_VERSION "20120601"
#define XBPS_VERSION "0.16"
/**

View File

@ -79,8 +79,10 @@ remove_obj_from_array(prop_array_t array, const char *str, int mode,
/* match by pkgname, obj is a dictionary */
chkarch = prop_dictionary_get_cstring_nocopy(obj,
"architecture", &arch);
if (chkarch && !xbps_pkg_arch_match(arch, targetarch))
if (chkarch && !xbps_pkg_arch_match(arch, targetarch)) {
idx++;
continue;
}
prop_dictionary_get_cstring_nocopy(obj,
"pkgname", &curname);
if (strcmp(curname, str) == 0) {
@ -90,8 +92,10 @@ remove_obj_from_array(prop_array_t array, const char *str, int mode,
} else if (mode == 3) {
chkarch = prop_dictionary_get_cstring_nocopy(obj,
"architecture", &arch);
if (chkarch && !xbps_pkg_arch_match(arch, targetarch))
if (chkarch && !xbps_pkg_arch_match(arch, targetarch)) {
idx++;
continue;
}
/* match by pkgver, obj is a dictionary */
prop_dictionary_get_cstring_nocopy(obj,
"pkgver", &curname);
@ -102,8 +106,10 @@ remove_obj_from_array(prop_array_t array, const char *str, int mode,
} else if (mode == 4) {
chkarch = prop_dictionary_get_cstring_nocopy(obj,
"architecture", &arch);
if (chkarch && !xbps_pkg_arch_match(arch, targetarch))
if (chkarch && !xbps_pkg_arch_match(arch, targetarch)) {
idx++;
continue;
}
/* match by pattern, obj is a dictionary */
prop_dictionary_get_cstring_nocopy(obj,
"pkgver", &curname);