Do not reuse requiredby objects while updating pkgs.

--HG--
extra : convert_revision : 1bc0a25601b6ff1c4cd83de4dcd775ffdee1e9a1
This commit is contained in:
Juan RP 2009-04-06 17:00:52 +02:00
parent 4b3adf1db3
commit bb3240e4ac
4 changed files with 24 additions and 70 deletions

View file

@ -304,16 +304,16 @@ xbps_remove_binary_pkg(const char *pkgname, bool update)
free(buf);
/*
* Update the required_by array of all required dependencies
* and unregister package if this is really a removal and
* not an update.
* Update the requiredby array of all required dependencies.
*/
rv = xbps_requiredby_pkg_remove(pkgname);
if (rv != 0)
return rv;
if (update == false) {
rv = xbps_requiredby_pkg_remove(pkgname);
if (rv != 0)
return rv;
/*
* Unregister pkg from database.
* Unregister pkg from database only if it's a removal
* and not an update.
*/
rv = xbps_unregister_pkg(pkgname);
if (rv != 0)