33 #include "xbps_api_impl.h"
37 prop_dictionary_t instd,
38 prop_dictionary_t newd)
40 prop_array_t array, array2, obsoletes;
41 prop_object_t obj, obj2;
42 prop_string_t oldstr, newstr;
44 const char *array_str =
"files";
48 bool found, dodirs, dolinks, docffiles;
50 dodirs = dolinks = docffiles =
false;
52 assert(prop_object_type(instd) == PROP_TYPE_DICTIONARY);
53 assert(prop_object_type(newd) == PROP_TYPE_DICTIONARY);
55 obsoletes = prop_array_create();
59 array = prop_dictionary_get(instd, array_str);
60 if (array == NULL || prop_array_count(array) == 0)
66 for (i = 0; i < prop_array_count(array); i++) {
68 obj = prop_array_get(array, i);
69 if (prop_object_type(obj) != PROP_TYPE_DICTIONARY)
71 oldstr = prop_dictionary_get(obj,
"file");
76 prop_string_cstring_nocopy(oldstr));
78 if ((strcmp(array_str,
"files") == 0) ||
79 (strcmp(array_str,
"conf_files") == 0)) {
80 prop_dictionary_get_cstring_nocopy(obj,
83 if (rv == ENOENT || rv == ERANGE) {
92 array2 = prop_dictionary_get(newd, array_str);
93 if (array2 && prop_array_count(array2)) {
94 for (x = 0; x < prop_array_count(array2); x++) {
95 obj2 = prop_array_get(array2, x);
96 newstr = prop_dictionary_get(obj2,
"file");
101 if (prop_string_equals(oldstr, newstr)) {
115 if ((strcmp(file,
"./bin") == 0) ||
116 (strcmp(file,
"./bin/") == 0) ||
117 (strcmp(file,
"./sbin") == 0) ||
118 (strcmp(file,
"./sbin/") == 0) ||
119 (strcmp(file,
"./lib") == 0) ||
120 (strcmp(file,
"./lib/") == 0) ||
121 (strcmp(file,
"./lib64/") == 0) ||
122 (strcmp(file,
"./lib64") == 0)) {
129 xbps_dbg_printf(xhp,
"found obsolete: %s (%s)\n",
132 prop_array_add_cstring(obsoletes, file);
140 }
else if (!docffiles) {
142 array_str =
"conf_files";
144 }
else if (!dodirs) {