From 8ddaf0bbd622b69eb0ab993bd462da5eee42bdf4 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 6 Feb 2021 20:13:27 +0000 Subject: [PATCH] Make failure to find packages fatal, add more error prefixing To help debug https://bugzilla.redhat.com/show_bug.cgi?id=1925584 --- src/daemon/rpmostree-sysroot-core.cxx | 4 ++-- src/libpriv/rpmostree-core.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/daemon/rpmostree-sysroot-core.cxx b/src/daemon/rpmostree-sysroot-core.cxx index 6a71ff8e..f5f2070b 100644 --- a/src/daemon/rpmostree-sysroot-core.cxx +++ b/src/daemon/rpmostree-sysroot-core.cxx @@ -123,7 +123,7 @@ add_package_refs_to_set (RpmOstreeRefSack *rsack, /* TODO: convert this to an iterator to avoid lots of malloc */ if (pkglist->len == 0) - sd_journal_print (LOG_WARNING, "Failed to find any packages in root"); + return glnx_throw (error, "Failed to find any packages in root"); else { for (guint i = 0; i < pkglist->len; i++) @@ -187,7 +187,7 @@ generate_pkgcache_refs (OstreeSysroot *sysroot, return FALSE; if (!add_package_refs_to_set (rsack, FALSE, referenced_pkgs, cancellable, error)) - return FALSE; + return glnx_prefix_error (error, "Deployment index=%d", i); } /* In rojig mode, we need to also reference packages from the base; this * is a different refspec format. diff --git a/src/libpriv/rpmostree-core.cxx b/src/libpriv/rpmostree-core.cxx index 1c10826d..c2cebf21 100644 --- a/src/libpriv/rpmostree-core.cxx +++ b/src/libpriv/rpmostree-core.cxx @@ -2260,7 +2260,7 @@ rpmostree_context_prepare (RpmOstreeContext *self, DNF_PACKAGE_INFO_UPDATE, DNF_PACKAGE_INFO_DOWNGRADE, -1); if (!sort_packages (self, self->pkgs, cancellable, error)) - return FALSE; + return glnx_prefix_error (error, "Sorting packages"); } return TRUE;