libxbps: make sure to remove pkg metadata file on upgrades with skip-obsoletes.

This fixes the following case:

 - A-1.0_1 is installed and owns bin/foo.
 - A-1.1_1 is in the transaction and depends on B-1.0_1 that owns bin/foo.
 - B-1.0_1 is in the transaction and replaces A<1.1_1.
 - A-1.1_1 in the transaction now has "skip-obsoletes".
 - A is updated to 1.1_1, its metadata file (<pkgname>-files.plist) wasn't removed.

Added two new test cases to verify moving files from/to a dependency.
This commit is contained in:
Juan RP
2015-01-27 17:53:37 +01:00
parent f324ea5352
commit 571d96fa92
3 changed files with 53 additions and 6 deletions

View File

@ -478,6 +478,7 @@ unpack_archive(struct xbps_handle *xhp,
xbps_object_release(obj);
}
xbps_object_release(pkg_filesd);
out:
/*
* If unpacked pkg has no files, remove its files metadata plist.
*/
@ -486,7 +487,6 @@ unpack_archive(struct xbps_handle *xhp,
unlink(buf);
free(buf);
}
out:
if (xbps_object_type(binpkg_filesd) == XBPS_TYPE_DICTIONARY)
xbps_object_release(binpkg_filesd);
if (pkgname != NULL)