lib: add binary package internalization step

- internalize scripts so we can use them before unpacking packages.
- moves some required metadata checks out of the package unpack stage
  so errors do not leave the system in a half unpacked state.

xbps_transaction_files will be changed later to use the loaded
files.plist instead of opening each binary package on its own again.
This commit is contained in:
Duncan Overbruck
2021-06-24 17:08:53 +02:00
parent c00fe9f3e1
commit ab3fb82a7f
5 changed files with 252 additions and 79 deletions

View File

@ -110,6 +110,15 @@ xbps_transaction_commit(struct xbps_handle *xhp)
*/
xbps_fetch_unset_cache_connection();
/*
* Internalize metadata of downloaded binary packages.
*/
if ((rv = xbps_transaction_internalize(xhp, iter)) < 0) {
xbps_dbg_printf(xhp, "[trans] failed to internalize transaction binpkgs: "
"%s\n", strerror(-rv));
goto out;
}
/*
* Collect files in the transaction and find some issues
* like multiple packages installing the same file.