32 #include "xbps_api_impl.h"
47 prop_array_t provides;
50 assert(prop_object_type(d) == PROP_TYPE_DICTIONARY);
52 if ((provides = prop_dictionary_get(d,
"provides"))) {
63 prop_array_t provides)
65 prop_object_t obj, obj2;
66 prop_object_iterator_t iter, iter2;
67 const char *vpkgver, *pkgpattern;
70 iter = prop_array_iterator(provides);
73 while ((obj = prop_object_iterator_next(iter))) {
75 vpkgver = prop_string_cstring_nocopy(obj);
76 if (strchr(vpkgver,
'_') == NULL) {
80 iter2 = prop_array_iterator(rundeps);
82 while ((obj2 = prop_object_iterator_next(iter2))) {
83 pkgpattern = prop_string_cstring_nocopy(obj2);
88 prop_object_iterator_release(iter2);
89 prop_object_iterator_release(iter);
93 prop_object_iterator_release(iter2);
97 prop_object_iterator_release(iter);
103 match_string_in_array(prop_array_t array,
const char *str,
int mode)
105 prop_object_iterator_t iter;
108 char *curpkgname, *tmp;
111 assert(prop_object_type(array) == PROP_TYPE_ARRAY);
114 iter = prop_array_iterator(array);
117 while ((obj = prop_object_iterator_next(iter))) {
121 if (prop_string_equals_cstring(obj, str)) {
125 }
else if (mode == 1) {
127 pkgdep = prop_string_cstring_nocopy(obj);
128 if (strchr(pkgdep,
'_') == NULL) {
135 if (curpkgname == NULL)
137 if (strcmp(curpkgname, str) == 0) {
143 }
else if (mode == 2) {
145 pkgdep = prop_string_cstring_nocopy(obj);
146 if (strchr(pkgdep,
'_') == NULL) {
159 }
else if (mode == 3) {
161 pkgdep = prop_string_cstring_nocopy(obj);
162 if (strchr(pkgdep,
'_') == NULL) {
176 prop_object_iterator_release(iter);
184 return match_string_in_array(array, str, 0);
190 return match_string_in_array(array, pkgname, 1);
196 return match_string_in_array(array, pattern, 2);
202 return match_string_in_array(array, pkgver, 3);