Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkglist: Canonicalize "no packages" to "no database found" #3183

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/app/rpmostree-builtin-shlib-backend.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ impl_packagelist_from_commit (OstreeRepo *repo, const char *commit, GError **err
}

g_autoptr(GVariant) pkgs = rpmostree_variant_pkgs_from_sack (rsack);
// It can happen that we successfully query zero packages. For example,
// when rpm-ostree on RHEL8 (assuming bdb database) is trying to parse an
// ostree commit generated from fedora (sqlite rpmdb), librpm will just give us
// nothing. Eventually perhaps we may need to fall back to actually running
// the target commit as a container just to get this data for cases like that.
if (g_variant_n_children (pkgs) == 0)
return g_variant_new_maybe ((GVariantType*) RPMOSTREE_SHLIB_IPC_PKGLIST, NULL);
return g_variant_ref_sink (g_variant_new_maybe ((GVariantType*) RPMOSTREE_SHLIB_IPC_PKGLIST, pkgs));
}

Expand Down