libxbps: print in verbose mode what pkgs are added to the transaction.
Useful to know why a transaction cannot be completed when there are unresolved reverse dependencies. Requested by @chris2.
This commit is contained in:
@ -65,6 +65,10 @@ state_cb(const struct xbps_state_cb_data *xscd, void *cbdata _unused)
|
|||||||
case XBPS_STATE_REPOSYNC:
|
case XBPS_STATE_REPOSYNC:
|
||||||
printf("[*] Updating `%s' ...\n", xscd->arg);
|
printf("[*] Updating `%s' ...\n", xscd->arg);
|
||||||
break;
|
break;
|
||||||
|
case XBPS_STATE_TRANS_ADDPKG:
|
||||||
|
if (xscd->xhp->flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf("%s\n", xscd->desc);
|
||||||
|
break;
|
||||||
case XBPS_STATE_VERIFY:
|
case XBPS_STATE_VERIFY:
|
||||||
printf("%s\n", xscd->desc);
|
printf("%s\n", xscd->desc);
|
||||||
break;
|
break;
|
||||||
|
@ -327,7 +327,8 @@ typedef enum xbps_state {
|
|||||||
XBPS_STATE_SHOW_REMOVE_MSG,
|
XBPS_STATE_SHOW_REMOVE_MSG,
|
||||||
XBPS_STATE_UNPACK_FILE_PRESERVED,
|
XBPS_STATE_UNPACK_FILE_PRESERVED,
|
||||||
XBPS_STATE_PKGDB,
|
XBPS_STATE_PKGDB,
|
||||||
XBPS_STATE_PKGDB_DONE
|
XBPS_STATE_PKGDB_DONE,
|
||||||
|
XBPS_STATE_TRANS_ADDPKG
|
||||||
} xbps_state_t;
|
} xbps_state_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -129,7 +129,7 @@ bool HIDDEN xbps_transaction_shlibs(struct xbps_handle *, xbps_array_t,
|
|||||||
xbps_array_t);
|
xbps_array_t);
|
||||||
int HIDDEN xbps_transaction_init(struct xbps_handle *);
|
int HIDDEN xbps_transaction_init(struct xbps_handle *);
|
||||||
int HIDDEN xbps_transaction_store(struct xbps_handle *, xbps_array_t,
|
int HIDDEN xbps_transaction_store(struct xbps_handle *, xbps_array_t,
|
||||||
xbps_dictionary_t, bool);
|
xbps_dictionary_t, const char *, bool);
|
||||||
char HIDDEN *xbps_get_remote_repo_string(const char *);
|
char HIDDEN *xbps_get_remote_repo_string(const char *);
|
||||||
int HIDDEN xbps_repo_sync(struct xbps_handle *, const char *);
|
int HIDDEN xbps_repo_sync(struct xbps_handle *, const char *);
|
||||||
int HIDDEN xbps_file_hash_check_dictionary(struct xbps_handle *,
|
int HIDDEN xbps_file_hash_check_dictionary(struct xbps_handle *,
|
||||||
|
@ -330,7 +330,7 @@ find_repo_deps(struct xbps_handle *xhp,
|
|||||||
* Package is on repo, add it into the transaction dictionary.
|
* Package is on repo, add it into the transaction dictionary.
|
||||||
*/
|
*/
|
||||||
xbps_dictionary_set_cstring_nocopy(curpkgd, "transaction", reason);
|
xbps_dictionary_set_cstring_nocopy(curpkgd, "transaction", reason);
|
||||||
rv = xbps_transaction_store(xhp, unsorted, curpkgd, true);
|
rv = xbps_transaction_store(xhp, unsorted, curpkgd, reason, true);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
xbps_dbg_printf(xhp, "xbps_transaction_store failed for `%s': %s\n", reqpkg, strerror(rv));
|
xbps_dbg_printf(xhp, "xbps_transaction_store failed for `%s': %s\n", reqpkg, strerror(rv));
|
||||||
break;
|
break;
|
||||||
@ -359,7 +359,7 @@ find_repo_deps(struct xbps_handle *xhp,
|
|||||||
* Package is on repo, add it into the transaction dictionary.
|
* Package is on repo, add it into the transaction dictionary.
|
||||||
*/
|
*/
|
||||||
xbps_dictionary_set_cstring_nocopy(curpkgd, "transaction", reason);
|
xbps_dictionary_set_cstring_nocopy(curpkgd, "transaction", reason);
|
||||||
rv = xbps_transaction_store(xhp, unsorted, curpkgd, true);
|
rv = xbps_transaction_store(xhp, unsorted, curpkgd, reason, true);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
xbps_dbg_printf(xhp, "xbps_transaction_store failed for `%s': %s\n", reqpkg, strerror(rv));
|
xbps_dbg_printf(xhp, "xbps_transaction_store failed for `%s': %s\n", reqpkg, strerror(rv));
|
||||||
break;
|
break;
|
||||||
|
@ -216,7 +216,7 @@ trans_find_pkg(struct xbps_handle *xhp, const char *pkg, bool reinstall,
|
|||||||
free(pkgname);
|
free(pkgname);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
if ((rv = xbps_transaction_store(xhp, pkgs, pkg_repod, false)) != 0) {
|
if ((rv = xbps_transaction_store(xhp, pkgs, pkg_repod, reason, false)) != 0) {
|
||||||
free(pkgname);
|
free(pkgname);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -342,7 +342,7 @@ xbps_transaction_remove_pkg(struct xbps_handle *xhp,
|
|||||||
obj = xbps_array_get(orphans, i);
|
obj = xbps_array_get(orphans, i);
|
||||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||||
xbps_dictionary_set_cstring_nocopy(obj, "transaction", "remove");
|
xbps_dictionary_set_cstring_nocopy(obj, "transaction", "remove");
|
||||||
if ((rv = xbps_transaction_store(xhp, pkgs, obj, false)) != 0)
|
if ((rv = xbps_transaction_store(xhp, pkgs, obj, "remove", false)) != 0)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
xbps_dbg_printf(xhp, "%s: added into transaction (remove).\n", pkgver);
|
xbps_dbg_printf(xhp, "%s: added into transaction (remove).\n", pkgver);
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ rmpkg:
|
|||||||
*/
|
*/
|
||||||
xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
|
xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
|
||||||
xbps_dictionary_set_cstring_nocopy(pkgd, "transaction", "remove");
|
xbps_dictionary_set_cstring_nocopy(pkgd, "transaction", "remove");
|
||||||
if ((rv = xbps_transaction_store(xhp, pkgs, pkgd, false)) != 0)
|
if ((rv = xbps_transaction_store(xhp, pkgs, pkgd, "remove", false)) != 0)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
xbps_dbg_printf(xhp, "%s: added into transaction (remove).\n", pkgver);
|
xbps_dbg_printf(xhp, "%s: added into transaction (remove).\n", pkgver);
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
int HIDDEN
|
int HIDDEN
|
||||||
xbps_transaction_store(struct xbps_handle *xhp, xbps_array_t pkgs,
|
xbps_transaction_store(struct xbps_handle *xhp, xbps_array_t pkgs,
|
||||||
xbps_dictionary_t pkgd, bool autoinst)
|
xbps_dictionary_t pkgd, const char *tract, bool autoinst)
|
||||||
{
|
{
|
||||||
xbps_array_t replaces;
|
xbps_array_t replaces;
|
||||||
const char *pkgver, *repo;
|
const char *pkgver, *repo;
|
||||||
@ -70,6 +70,9 @@ xbps_transaction_store(struct xbps_handle *xhp, xbps_array_t pkgs,
|
|||||||
if (!xbps_array_add(pkgs, pkgd))
|
if (!xbps_array_add(pkgs, pkgd))
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
|
xbps_set_cb_state(xhp, XBPS_STATE_TRANS_ADDPKG, 0, pkgver,
|
||||||
|
"Found %s (%s) in repository %s", pkgver, tract, repo);
|
||||||
|
|
||||||
xbps_dbg_printf(xhp, "Added `%s' into the dependency list (%s)\n",
|
xbps_dbg_printf(xhp, "Added `%s' into the dependency list (%s)\n",
|
||||||
pkgver, repo);
|
pkgver, repo);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user