~mmach/netext73/pkgconf

« back to all changes in this revision

Viewing changes to debian/patches/sysroot_dir-logic.patch

  • Committer: mmach
  • Date: 2024-02-21 19:22:23 UTC
  • Revision ID: netbit73@gmail.com-20240221192223-5l809fiqh21udwrd
1.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
 
 
5
---
 
6
 libpkgconf/pkg.c | 9 +++------
 
7
 1 file changed, 3 insertions(+), 6 deletions(-)
 
8
 
 
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);
 
16
 
 
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
 
19
+        * package.
 
20
         * See https://github.com/pkgconf/pkgconf/issues/213
 
21
         */
 
22
        if (client->sysroot_dir && strncmp(pkg->pc_filedir, client->sysroot_dir, strlen(client->sysroot_dir)))
 
23
-       {
 
24
-               free(client->sysroot_dir);
 
25
-               client->sysroot_dir = NULL;
 
26
-               pkgconf_client_set_sysroot_dir(client, NULL);
 
27
-       }
 
28
+               pkgconf_tuple_add(client, &pkg->vars, "pc_sysrootdir", "", false);
 
29
 
 
30
        /* make module id */
 
31
        if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL)