rpms/pkgconfig/devel escape-whitespace-revert.patch, NONE, 1.1 pkgconfig.spec, 1.56, 1.57
Matthias Clasen
mclasen at fedoraproject.org
Wed May 26 16:41:07 UTC 2010
Author: mclasen
Update of /cvs/pkgs/rpms/pkgconfig/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv384
Modified Files:
pkgconfig.spec
Added Files:
escape-whitespace-revert.patch
Log Message:
Revert escaping change
escape-whitespace-revert.patch:
check/Makefile.am | 4 +-
check/check-whitespace | 20 ----------
check/whitespace.pc | 11 -----
parse.c | 94 +++++++++++++++++++++++++------------------------
4 files changed, 51 insertions(+), 78 deletions(-)
--- NEW FILE escape-whitespace-revert.patch ---
diff -up pkg-config-0.24/check/check-whitespace.escape pkg-config-0.24/check/check-whitespace
--- pkg-config-0.24/check/check-whitespace.escape 2010-05-23 16:57:37.000000000 -0400
+++ pkg-config-0.24/check/check-whitespace 2010-05-26 12:37:22.879786257 -0400
@@ -1,20 +0,0 @@
-#! /bin/sh
-
-# Make sure we're POSIX
-if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
- PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
-fi
-
-set -e
-
-. ${srcdir}/common
-
-# expect cflags from whitespace
-ARGS="--cflags whitespace"
-RESULT="-I/usr/white\\ space/include -Iinclude\\ dir -Iother\\ include\\ dir"
-run_test
-
-# expect libs from whitespace
-ARGS="--libs whitespace"
-RESULT="-L/usr/white\\ space/lib -lfoo\\ bar -lbar\\ baz"
-run_test
diff -up pkg-config-0.24/check/Makefile.am.escape pkg-config-0.24/check/Makefile.am
--- pkg-config-0.24/check/Makefile.am.escape 2010-05-23 17:29:58.000000000 -0400
+++ pkg-config-0.24/check/Makefile.am 2010-05-26 12:37:46.585018199 -0400
@@ -1,10 +1,10 @@
TESTS = check-cflags check-libs check-define-variable \
check-libs-private check-requires-private check-includedir \
- check-conflicts check-missing check-idirafter check-whitespace
+ check-conflicts check-missing check-idirafter
EXTRA_DIST = $(TESTS) common simple.pc requires-test.pc public-dep.pc \
private-dep.pc includedir.pc missing-requires-private.pc \
- missing-requires.pc idirafter.pc conflicts-test.pc whitespace.pc
+ missing-requires.pc idirafter.pc conflicts-test.pc
DISTCLEANFILES = config.sh
diff -up pkg-config-0.24/check/whitespace.pc.escape pkg-config-0.24/check/whitespace.pc
--- pkg-config-0.24/check/whitespace.pc.escape 2010-05-23 16:56:50.000000000 -0400
+++ pkg-config-0.24/check/whitespace.pc 2010-05-26 12:37:22.880785838 -0400
@@ -1,11 +0,0 @@
-prefix=/usr
-exec_prefix=${prefix}
-libdir="${exec_prefix}/white space/lib"
-includedir="${prefix}/white space/include"
-
-Name: Whitespace test
-Description: Dummy pkgconfig test package for testing pkgconfig
-Version: 1.0.0
-Requires:
-Libs: -L${libdir} -lfoo\ bar "-lbar baz"
-Cflags: -I${includedir} -Iinclude\ dir "-Iother include dir"
diff -up pkg-config-0.24/parse.c.escape pkg-config-0.24/parse.c
--- pkg-config-0.24/parse.c.escape 2010-05-26 12:37:22.839019809 -0400
+++ pkg-config-0.24/parse.c 2010-05-26 12:37:22.881780670 -0400
@@ -633,31 +633,6 @@ parse_conflicts (Package *pkg, const cha
g_free (trimmed);
}
-static char *strdup_escape_shell(const char *s)
-{
- size_t r_s = strlen(s)+10, c = 0;
- char *r = g_malloc(r_s);
- while (s[0]) {
- if ((s[0] < '+') ||
- (s[0] > '9' && s[0] < '@') ||
- (s[0] > 'Z' && s[0] < '^') ||
- (s[0] == '`') ||
- (s[0] > 'z')) {
- r[c] = '\\';
- c++;
- }
- r[c] = *s;
- c++;
- if (c+2 >= r_s) {
- r_s *= 2;
- r = g_realloc(r, r_s);
- }
- s++;
- }
- r[c] = 0;
- return r;
-}
-
static void _do_parse_libs (Package *pkg, int argc, char **argv)
{
int i;
@@ -674,11 +649,12 @@ static void _do_parse_libs (Package *pkg
i = 0;
while (i < argc)
{
- char *tmp = trim_string (argv[i]);
- char *arg = strdup_escape_shell(tmp);
+ char *arg = trim_string (argv[i]);
char *p;
- p = arg;
- g_free(tmp);
+ char *start;
+
+ start = arg;
+ p = start;
if (p[0] == '-' &&
p[1] == 'l' &&
@@ -686,23 +662,43 @@ static void _do_parse_libs (Package *pkg
flag. */
(strncmp(p, "-lib:", 5) != 0))
{
+ char *libname;
+
p += 2;
while (*p && isspace ((guchar)*p))
++p;
+
+ start = p;
+ while (*p && !isspace ((guchar)*p))
+ ++p;
+ libname = g_strndup (start, p - start);
+
pkg->l_libs = g_slist_prepend (pkg->l_libs,
- g_strconcat (l_flag, p, lib_suffix, NULL));
+ g_strconcat (l_flag, libname, lib_suffix, NULL));
+ g_free (libname);
}
else if (p[0] == '-' &&
p[1] == 'L')
{
+ char *libname;
+
p += 2;
while (*p && isspace ((guchar)*p))
++p;
- pkg->L_libs = g_slist_prepend (pkg->L_libs,
- g_strconcat (L_flag, p, NULL));
- }
+
+ start = p;
+ while (*p && !isspace ((guchar)*p))
+ ++p;
+
+ libname = g_strndup (start, p - start);
+
+ pkg->L_libs = g_slist_prepend (pkg->L_libs,
+ g_strconcat (L_flag, libname, NULL));
+
+ g_free (libname);
+ }
else if (strcmp("-framework",p) == 0 && i+1 < argc)
{
/* Mac OS X has a -framework Foo which is really one option,
@@ -710,14 +706,12 @@ static void _do_parse_libs (Package *pkg
* -framework Bar being changed into -framework Foo Bar
* later
*/
- gchar *framework, *tmp = trim_string (argv[i+1]);
+ gchar *framework = trim_string (argv[i+1]);
- framework = strdup_escape_shell(tmp);
pkg->other_libs = g_slist_prepend (pkg->other_libs,
g_strconcat(arg, " ", framework, NULL));
i++;
g_free(framework);
- g_free(tmp);
}
else
{
@@ -727,7 +721,7 @@ static void _do_parse_libs (Package *pkg
}
g_free (arg);
-
+
++i;
}
@@ -762,6 +756,7 @@ parse_libs (Package *pkg, const char *st
exit (1);
}
+
_do_parse_libs(pkg, argc, argv);
g_free (trimmed);
@@ -849,30 +844,39 @@ parse_cflags (Package *pkg, const char *
i = 0;
while (i < argc)
{
- char *tmp = trim_string (argv[i]);
- char *arg = strdup_escape_shell(tmp);
- char *p = arg;
- g_free(tmp);
+ char *arg = trim_string (argv[i]);
+ char *p;
+ char *start;
+
+ start = arg;
+ p = start;
if (p[0] == '-' &&
p[1] == 'I')
{
+ char *libname;
+
p += 2;
while (*p && isspace ((guchar)*p))
++p;
+
+ start = p;
+ while (*p && !isspace ((guchar)*p))
+ ++p;
+ libname = g_strndup (start, p - start);
+
pkg->I_cflags = g_slist_prepend (pkg->I_cflags,
- g_strconcat ("-I", p, NULL));
+ g_strconcat ("-I", libname, NULL));
+ g_free (libname);
} else {
if (*arg != '\0')
pkg->other_cflags = g_slist_prepend (pkg->other_cflags,
g_strdup (arg));
if (strcmp("-idirafter", arg) == 0) {
- tmp = trim_string(argv[++i]);
- char *n = strdup_escape_shell(tmp);
+ char *n = trim_string(argv[++i]);
pkg->other_cflags = g_slist_prepend(pkg->other_cflags, n);
- g_free(tmp);
}
}
Index: pkgconfig.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pkgconfig/devel/pkgconfig.spec,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -p -r1.56 -r1.57
--- pkgconfig.spec 24 May 2010 02:25:20 -0000 1.56
+++ pkgconfig.spec 26 May 2010 16:41:07 -0000 1.57
@@ -1,7 +1,7 @@
Summary: A tool for determining compilation options
Name: pkgconfig
Version: 0.24
-Release: 2%{?dist}
+Release: 3%{?dist}
Epoch: 1
License: GPLv2+
URL: http://pkgconfig.freedesktop.org
@@ -14,6 +14,8 @@ BuildRequires: popt-devel
Patch2: pkg-config-0.21-compat-loop.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=16095
Patch3: pkg-config-lib64-excludes.patch
+# revert a last-minute upstream change that is causing many problems
+Patch4: escape-whitespace-revert.patch
Provides: pkgconfig(pkg-config) = %{version}
@@ -26,6 +28,7 @@ compiler and linker flags.
%setup -n pkg-config-%{version} -q
%patch2 -p1 -b .compat-loop
%patch3 -p0 -b .lib64
+%patch4 -p1 -b .no-escape
%build
%configure \
@@ -52,6 +55,9 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/pk
%{_datadir}/aclocal/*
%changelog
+* Wed May 26 2010 Matthias Clasen <mclasen at redhat.com> 0.24-3
+- Revert the escaping change that is causing a lot of problems
+
* Sun May 23 2010 Matthias Clasen <mclasen at redhat.com> 0.24-2
- Go back to using the included popt
More information about the scm-commits
mailing list