Fix #438201 "Upgrading essential pkgs results in duplicated reqby entries"

Always remove reqby entries while upgrading "essential" packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091001053542-amaw61ib23hy453n
This commit is contained in:
Juan RP 2009-10-01 07:35:42 +02:00
parent c56e2931db
commit e668ba5193

View File

@ -369,11 +369,19 @@ exec_transaction(struct transaction *trans)
prop_object_release(instpkgd);
/*
* If this package is not 'essential', just remove
* the old package and install the new one. Otherwise
* we just overwrite the files.
* If package is marked as 'essential' remove old
* requiredby entries and overwrite pkg files; otherwise
* remove old package and install new one.
*/
if (essential == false) {
if (essential) {
rv = xbps_requiredby_pkg_remove(pkgname);
if (rv != 0) {
printf("error: couldn't remove reqby"
" entries for %s-%s (%s)\n",
pkgname, instver, strerror(rv));
return rv;
}
} else {
rv = xbps_remove_pkg(pkgname, version, true);
if (rv != 0) {
printf("error: removing %s-%s (%s)\n",