When installing a new package with dpkg dependencies are checked
correctly. But when I try to update an existing package, the
dependencies are checked against the old package, not against new
package. Thus the new package can break dependencies.
return -1;
}
num = search_package_hashtable(new_node->name, new_node->version, VER_EQUAL);
- if (package_hashtable[num] == NULL) {
- package_hashtable[num] = new_node;
- } else {
- free_package(new_node);
- }
+ if (package_hashtable[num] != NULL)
+ free_package(package_hashtable[num]);
+ package_hashtable[num] = new_node;
return num;
}