libpkgconf: pkg: consistently use pc_sysrootdir for path munging

In some cases, client.sysroot_dir would be used instead of the
package-specific override.

Fixes: https://github.com/pkgconf/pkgconf/pull/280
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
master
Ariadne Conill 2025-03-05 16:54:52 -08:00
parent 97072df584
commit 3611b056fb
1 changed files with 8 additions and 0 deletions

View File

@ -192,7 +192,15 @@ static void
pkgconf_pkg_parser_fragment_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value)
{
pkgconf_list_t *dest = (pkgconf_list_t *)((char *) pkg + offset);
/* we patch client-wide sysroot dir and then patch it back when it is overridden */
char *sysroot_dir = client->sysroot_dir;
char *pkg_sysroot_dir = pkgconf_tuple_find(client, &pkg->vars, "pc_sysrootdir");
if (pkg_sysroot_dir != NULL)
client->sysroot_dir = pkg_sysroot_dir;
bool ret = pkgconf_fragment_parse(client, dest, &pkg->vars, value, pkg->flags);
client->sysroot_dir = sysroot_dir;
if (!ret)
{