1
From: Ariadne Conill <ariadne@dereferenced.org>
2
Date: Sun, 26 Jun 2022 19:16:00 +0000
3
Subject: pkg: fix sysroot_dir logic for github 213
6
libpkgconf/pkg.c | 9 +++------
7
1 file changed, 3 insertions(+), 6 deletions(-)
9
diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c
10
index 0150852..3b21cbd 100644
11
--- a/libpkgconf/pkg.c
12
+++ b/libpkgconf/pkg.c
13
@@ -406,15 +406,12 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
14
pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pc_filedir_value, true);
15
free(pc_filedir_value);
17
- /* If pc_filedir is outside of sysroot_dir, clear pc_filedir
18
+ /* If pc_filedir is outside of sysroot_dir, override sysroot_dir for this
20
* See https://github.com/pkgconf/pkgconf/issues/213
22
if (client->sysroot_dir && strncmp(pkg->pc_filedir, client->sysroot_dir, strlen(client->sysroot_dir)))
24
- free(client->sysroot_dir);
25
- client->sysroot_dir = NULL;
26
- pkgconf_client_set_sysroot_dir(client, NULL);
28
+ pkgconf_tuple_add(client, &pkg->vars, "pc_sysrootdir", "", false);
31
if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL)