From 6484dcb0c25ac6f3aa01e81da77fb21c3bb25d3a Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 16 Sep 2016 09:59:41 -0500 Subject: [PATCH 1/5] pkg: pkgconf_pkg_free(): be sure to free the Provides list --- libpkgconf/pkg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index 02392e8..1ef2aac 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -348,6 +348,7 @@ pkgconf_pkg_free(pkgconf_pkg_t *pkg) pkgconf_dependency_free(&pkg->requires); pkgconf_dependency_free(&pkg->requires_private); pkgconf_dependency_free(&pkg->conflicts); + pkgconf_dependency_free(&pkg->provides); pkgconf_fragment_free(&pkg->cflags); pkgconf_fragment_free(&pkg->cflags_private); From a05cc65a4bff3b3353f93e2c236589a8de076802 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 18 Sep 2016 22:12:25 -0500 Subject: [PATCH 2/5] README: change distfiles location to an https one (closes #98) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8e80ab..1df2ead 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ to make this determination themselves. ## release tarballs -Release tarballs are available at . +Release tarballs are available at . Please do not use the github tarballs as they are not pristine (instead generated by github everytime a download occurs). From 9a89bd051d1b02b1a893411b86189cd5936d8b76 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 25 Oct 2016 14:03:08 -0500 Subject: [PATCH 3/5] testsuite: add a test for #99 --- tests/lib1/cflags-whitespace-trailing.pc | 4 ++++ tests/run.sh.in | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 tests/lib1/cflags-whitespace-trailing.pc diff --git a/tests/lib1/cflags-whitespace-trailing.pc b/tests/lib1/cflags-whitespace-trailing.pc new file mode 100644 index 0000000..2e66035 --- /dev/null +++ b/tests/lib1/cflags-whitespace-trailing.pc @@ -0,0 +1,4 @@ +Name: CFlags Trailing Whitespace Bug +Description: Demonstrates problems with -I with spaces +Version: 1 +Cflags: -I/usr/include -I/usr/include/foo diff --git a/tests/run.sh.in b/tests/run.sh.in index 79e9f6c..4af05c7 100644 --- a/tests/run.sh.in +++ b/tests/run.sh.in @@ -291,6 +291,8 @@ run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/test' ${1} run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/test' ${1} --cflags cflags-whitespace" \ "-I /test/opt/bad/include" +run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSTEM_INCLUDE_PATH='/usr/include' ${1} --cflags cflags-whitespace-trailing" \ + "-I/usr/include/foo" # 10) tests for Provides system run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --print-provides provides" \ From ce165646dedd57f5ab098e172942eb70bb87bdf1 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 25 Oct 2016 13:57:42 -0500 Subject: [PATCH 4/5] fragment: skip empty tokens (closes #99) Due to the way that tokens are merged together for arguments which require explicit whitespace, an empty token could result in a fragment like: {.type = 'I', .data = '/usr/include '} Such a fragment would be treated differently than: {.type = 'I', .data = '/usr/include'} This difference causes the compiler to include a system include path as part of the additional includes, thus breaking things like include path shadowing, resulting in random build failures. As such, we skip empty tokens from the tokenizer as they do not have any relevance anyway. --- libpkgconf/fragment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libpkgconf/fragment.c b/libpkgconf/fragment.c index 032b006..e596a10 100644 --- a/libpkgconf/fragment.c +++ b/libpkgconf/fragment.c @@ -105,6 +105,9 @@ pkgconf_fragment_add(pkgconf_list_t *list, const char *string, unsigned int flag { pkgconf_fragment_t *frag; + if (*string == '\0') + return; + if (!pkgconf_fragment_is_special(string)) { frag = calloc(sizeof(pkgconf_fragment_t), 1); From 1ce35f8bbb2c5ad1fe113b390d97016fc797c26d Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 25 Oct 2016 14:08:39 -0500 Subject: [PATCH 5/5] buildsystem: add new testsuite files --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 0c679b2..15fae88 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,6 +56,7 @@ EXTRA_DIST = Kyuafile \ tests/lib1/isystem.pc \ tests/lib1/depgraph-break.pc \ tests/lib1/cflags-whitespace.pc \ + tests/lib1/cflags-whitespace-trailing.pc \ tests/lib1/provides.pc \ tests/lib1/provides-request-simple.pc