pkg: fix sysroot_dir logic for github 213

master
Ariadne Conill 2022-06-26 19:16:00 +00:00
parent d68a867dc0
commit a61193c723
1 changed files with 3 additions and 6 deletions

View File

@ -414,15 +414,12 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pc_filedir_value, true); pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pc_filedir_value, true);
free(pc_filedir_value); free(pc_filedir_value);
/* If pc_filedir is outside of sysroot_dir, clear pc_filedir /* If pc_filedir is outside of sysroot_dir, override sysroot_dir for this
* package.
* See https://github.com/pkgconf/pkgconf/issues/213 * See https://github.com/pkgconf/pkgconf/issues/213
*/ */
if (client->sysroot_dir && strncmp(pkg->pc_filedir, client->sysroot_dir, strlen(client->sysroot_dir))) if (client->sysroot_dir && strncmp(pkg->pc_filedir, client->sysroot_dir, strlen(client->sysroot_dir)))
{ pkgconf_tuple_add(client, &pkg->vars, "pc_sysrootdir", "", false);
free(client->sysroot_dir);
client->sysroot_dir = NULL;
pkgconf_client_set_sysroot_dir(client, NULL);
}
/* make module id */ /* make module id */
if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL) if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL)