From a265f8a42bf60894fbe492862deab5f00968fedc Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 17 Aug 2023 11:53:07 -0700 Subject: [PATCH] libpkgconf: pkg: fix long-standing bug where -uninstalled pkg-config files would have the wrong identifier --- libpkgconf/pkg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index 1897600..886174f 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -457,6 +457,13 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE * if (idptr) *idptr = '\0'; + if (pkg->flags & PKGCONF_PKG_PROPF_UNINSTALLED) + { + idptr = strrchr(pkg->id, '-'); + if (idptr) + *idptr = '\0'; + } + pkgconf_parser_parse(f, pkg, pkg_parser_funcs, (pkgconf_parser_warn_func_t) pkg_warn_func, pkg->filename); if (!pkgconf_pkg_validate(client, pkg))