pkgdb: foreach_xxx_pkg_cb -> foreach_xxx_cb.
This commit is contained in:
parent
4758635f15
commit
38db570c19
@ -68,7 +68,7 @@ check_pkg_integrity_all(void)
|
|||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
memset(&cpkg, 0, sizeof(cpkg));
|
memset(&cpkg, 0, sizeof(cpkg));
|
||||||
(void)xbps_pkgdb_foreach_pkg_cb(cb_pkg_integrity, &cpkg);
|
(void)xbps_pkgdb_foreach_cb(cb_pkg_integrity, &cpkg);
|
||||||
if (cpkg.flush) {
|
if (cpkg.flush) {
|
||||||
if ((rv = xbps_pkgdb_update(xhp, true)) != 0) {
|
if ((rv = xbps_pkgdb_update(xhp, true)) != 0) {
|
||||||
xbps_error_printf("failed to write pkgdb: %s\n",
|
xbps_error_printf("failed to write pkgdb: %s\n",
|
||||||
|
@ -163,7 +163,7 @@ check_pkg_requiredby(const char *pkgname, void *arg, bool *pkgdb_update)
|
|||||||
crd.pkgdb_update = false;
|
crd.pkgdb_update = false;
|
||||||
prop_dictionary_get_cstring_nocopy(crd.pkgd, "pkgver", &crd.pkgver);
|
prop_dictionary_get_cstring_nocopy(crd.pkgd, "pkgver", &crd.pkgver);
|
||||||
|
|
||||||
rv = xbps_pkgdb_foreach_pkg_cb(check_reqby_pkg_cb, &crd);
|
rv = xbps_pkgdb_foreach_cb(check_reqby_pkg_cb, &crd);
|
||||||
*pkgdb_update = crd.pkgdb_update;
|
*pkgdb_update = crd.pkgdb_update;
|
||||||
|
|
||||||
if (crd.pkgdb_update) {
|
if (crd.pkgdb_update) {
|
||||||
|
@ -203,7 +203,7 @@ main(int argc, char **argv)
|
|||||||
* Find the longest pkgver string to pretty print the output.
|
* Find the longest pkgver string to pretty print the output.
|
||||||
*/
|
*/
|
||||||
lpc.pkgver_len = find_longest_pkgver(NULL);
|
lpc.pkgver_len = find_longest_pkgver(NULL);
|
||||||
rv = xbps_pkgdb_foreach_pkg_cb(list_pkgs_in_dict, &lpc);
|
rv = xbps_pkgdb_foreach_cb(list_pkgs_in_dict, &lpc);
|
||||||
if (rv == ENOENT) {
|
if (rv == ENOENT) {
|
||||||
printf("No packages currently registered.\n");
|
printf("No packages currently registered.\n");
|
||||||
rv = 0;
|
rv = 0;
|
||||||
@ -342,7 +342,7 @@ main(int argc, char **argv)
|
|||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
rv = xbps_pkgdb_foreach_pkg_cb(list_manual_pkgs, NULL);
|
rv = xbps_pkgdb_foreach_cb(list_manual_pkgs, NULL);
|
||||||
|
|
||||||
} else if (strcasecmp(argv[0], "show-revdeps") == 0) {
|
} else if (strcasecmp(argv[0], "show-revdeps") == 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -187,7 +187,7 @@ find_longest_pkgver(prop_object_t o)
|
|||||||
(void)xbps_callback_array_iter(o,
|
(void)xbps_callback_array_iter(o,
|
||||||
_find_longest_pkgver_cb, &len);
|
_find_longest_pkgver_cb, &len);
|
||||||
else
|
else
|
||||||
(void)xbps_pkgdb_foreach_pkg_cb(
|
(void)xbps_pkgdb_foreach_cb(
|
||||||
_find_longest_pkgver_cb, &len);
|
_find_longest_pkgver_cb, &len);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
|
@ -668,8 +668,8 @@ prop_array_t xbps_find_pkg_orphans(prop_array_t orphans);
|
|||||||
* @return 0 on success (all objects were processed), otherwise
|
* @return 0 on success (all objects were processed), otherwise
|
||||||
* the value returned by the function callback.
|
* the value returned by the function callback.
|
||||||
*/
|
*/
|
||||||
int xbps_pkgdb_foreach_pkg_cb(int (*fn)(prop_object_t, void *, bool *),
|
int xbps_pkgdb_foreach_cb(int (*fn)(prop_object_t, void *, bool *),
|
||||||
void *arg);
|
void *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a function callback per a package dictionary registered
|
* Executes a function callback per a package dictionary registered
|
||||||
@ -681,7 +681,7 @@ int xbps_pkgdb_foreach_pkg_cb(int (*fn)(prop_object_t, void *, bool *),
|
|||||||
* @return 0 on success (all objects were processed), otherwise
|
* @return 0 on success (all objects were processed), otherwise
|
||||||
* the value returned by the funcion callback.
|
* the value returned by the funcion callback.
|
||||||
*/
|
*/
|
||||||
int xbps_pkgdb_foreach_reverse_pkg_cb(
|
int xbps_pkgdb_foreach_reverse_cb(
|
||||||
int (*fn)(prop_object_t, void *, bool *),
|
int (*fn)(prop_object_t, void *, bool *),
|
||||||
void *arg);
|
void *arg);
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ xbps_configure_packages(bool flush)
|
|||||||
struct xbps_handle *xhp = xbps_handle_get();
|
struct xbps_handle *xhp = xbps_handle_get();
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
rv = xbps_pkgdb_foreach_pkg_cb(configure_pkgs_cb, NULL);
|
rv = xbps_pkgdb_foreach_cb(configure_pkgs_cb, NULL);
|
||||||
if (rv == 0 && flush)
|
if (rv == 0 && flush)
|
||||||
rv = xbps_pkgdb_update(xhp, true);
|
rv = xbps_pkgdb_update(xhp, true);
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ xbps_find_pkg_orphans(prop_array_t orphans_user)
|
|||||||
* order in which packages were installed.
|
* order in which packages were installed.
|
||||||
*/
|
*/
|
||||||
od.orphans_user = orphans_user;
|
od.orphans_user = orphans_user;
|
||||||
rv = xbps_pkgdb_foreach_reverse_pkg_cb(find_orphan_pkg, &od);
|
rv = xbps_pkgdb_foreach_reverse_cb(find_orphan_pkg, &od);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
errno = rv;
|
errno = rv;
|
||||||
prop_object_release(od.array);
|
prop_object_release(od.array);
|
||||||
|
@ -103,7 +103,7 @@ int HIDDEN
|
|||||||
xbps_requiredby_pkg_remove(const char *pkgname)
|
xbps_requiredby_pkg_remove(const char *pkgname)
|
||||||
{
|
{
|
||||||
assert(pkgname != NULL);
|
assert(pkgname != NULL);
|
||||||
return xbps_pkgdb_foreach_pkg_cb(remove_pkg_from_reqby, __UNCONST(pkgname));
|
return xbps_pkgdb_foreach_cb(remove_pkg_from_reqby, __UNCONST(pkgname));
|
||||||
}
|
}
|
||||||
|
|
||||||
int HIDDEN
|
int HIDDEN
|
||||||
|
@ -163,15 +163,15 @@ foreach_pkg_cb(int (*fn)(prop_object_t, void *, bool *),
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xbps_pkgdb_foreach_reverse_pkg_cb(int (*fn)(prop_object_t, void *, bool *),
|
xbps_pkgdb_foreach_reverse_cb(int (*fn)(prop_object_t, void *, bool *),
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
return foreach_pkg_cb(fn, arg, true);
|
return foreach_pkg_cb(fn, arg, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
xbps_pkgdb_foreach_pkg_cb(int (*fn)(prop_object_t, void *, bool *),
|
xbps_pkgdb_foreach_cb(int (*fn)(prop_object_t, void *, bool *),
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
return foreach_pkg_cb(fn, arg, false);
|
return foreach_pkg_cb(fn, arg, false);
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ xbps_transaction_update_packages(void)
|
|||||||
bool newpkg_found = false;
|
bool newpkg_found = false;
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
rv = xbps_pkgdb_foreach_pkg_cb(update_pkgs_cb, &newpkg_found);
|
rv = xbps_pkgdb_foreach_cb(update_pkgs_cb, &newpkg_found);
|
||||||
if (!newpkg_found)
|
if (!newpkg_found)
|
||||||
rv = EEXIST;
|
rv = EEXIST;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user