From c899572bd4a8d155f40d29a8d526418f801d5960 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 17 Nov 2012 18:25:18 +0100 Subject: [PATCH] xbps-pkgdb: don't forget to update pkgdb; some printf fixes. --- bin/xbps-pkgdb/check.c | 3 +++ bin/xbps-pkgdb/check_pkg_requiredby.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/xbps-pkgdb/check.c b/bin/xbps-pkgdb/check.c index 0be0a367..84bdeeed 100644 --- a/bin/xbps-pkgdb/check.c +++ b/bin/xbps-pkgdb/check.c @@ -163,5 +163,8 @@ do { \ #undef RUN_PKG_CHECK + if (pkgd == NULL) + (void)xbps_pkgdb_update(xhp, true); + return 0; } diff --git a/bin/xbps-pkgdb/check_pkg_requiredby.c b/bin/xbps-pkgdb/check_pkg_requiredby.c index 7bb6d1e7..7a5b265d 100644 --- a/bin/xbps-pkgdb/check_pkg_requiredby.c +++ b/bin/xbps-pkgdb/check_pkg_requiredby.c @@ -119,7 +119,7 @@ check_reqby_pkg_cb(struct xbps_handle *xhp, if (!prop_array_add(pkgd_reqby, curpkgver)) return -1; - printf("%s: added requiredby entry for %s.\n\n", + printf("%s: added requiredby entry for %s.\n", pkgver, prop_string_cstring_nocopy(curpkgver)); return 0; @@ -132,7 +132,8 @@ static void remove_stale_entries_in_reqby(struct xbps_handle *xhp, prop_dictionary_t pkgd) { prop_array_t reqby; - const char *str, *pkgver; + const char *pkgver; + char *str; size_t i; reqby = prop_dictionary_get(pkgd, "requiredby"); @@ -142,7 +143,7 @@ remove_stale_entries_in_reqby(struct xbps_handle *xhp, prop_dictionary_t pkgd) prop_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver); for (i = 0; i < prop_array_count(reqby); i++) { - prop_array_get_cstring_nocopy(reqby, i, &str); + prop_array_get_cstring(reqby, i, &str); if ((pkgd = xbps_pkgdb_get_pkgd_by_pkgver(xhp, str)) != NULL) continue;