Simplify xbps_transaction_prepare()/commit() and related API changes.
- xbps_handle::transd -> new member with transaction dictionary. - xbps_transaction_prepare: returns an int. - xbps_transaction_commit: doesn't need any arg now. - xbps_repository_pool_sync: doesn't need any arg now. - xbps_pkgdb_update: removed xbps_handle * arg. - xbps_transaction_missingdeps_get: removed, missing_deps array is in xbps_handle::transd("missing_deps") array object.
This commit is contained in:
@ -64,7 +64,7 @@ xbps_pkgdb_init(struct xbps_handle *xhp)
|
||||
if (xhp->pkgdb != NULL)
|
||||
return 0;
|
||||
|
||||
if ((rv = xbps_pkgdb_update(xhp, false)) != 0) {
|
||||
if ((rv = xbps_pkgdb_update(false)) != 0) {
|
||||
if (rv != ENOENT)
|
||||
xbps_dbg_printf("[pkgdb] cannot internalize "
|
||||
"pkgdb array: %s\n", strerror(rv));
|
||||
@ -77,8 +77,9 @@ xbps_pkgdb_init(struct xbps_handle *xhp)
|
||||
}
|
||||
|
||||
int
|
||||
xbps_pkgdb_update(struct xbps_handle *xhp, bool flush)
|
||||
xbps_pkgdb_update(bool flush)
|
||||
{
|
||||
struct xbps_handle *xhp = xbps_handle_get();
|
||||
char *plist, *metadir;
|
||||
int rv = 0;
|
||||
|
||||
@ -213,7 +214,7 @@ xbps_pkgdb_remove_pkgd(const char *pkg, bool bypattern, bool flush)
|
||||
if (!flush || !rv)
|
||||
return rv;
|
||||
|
||||
if ((xbps_pkgdb_update(xhp, true)) != 0)
|
||||
if ((xbps_pkgdb_update(true)) != 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -239,7 +240,7 @@ xbps_pkgdb_replace_pkgd(prop_dictionary_t pkgd,
|
||||
if (!flush)
|
||||
return rv != 0 ? false : true;
|
||||
|
||||
if ((xbps_pkgdb_update(xhp, true)) != 0)
|
||||
if ((xbps_pkgdb_update(true)) != 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user