Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Aug 2014 10:00:37 +0000 (UTC)
From:      Jean-Sebastien Pedron <dumbbell@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r363986 - in head/devel/pkgconf: . files
Message-ID:  <53df59c5.57c4.42f72122@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell (src committer)
Date: Mon Aug  4 10:00:37 2014
New Revision: 363986
URL: http://svnweb.freebsd.org/changeset/ports/363986
QAT: https://qat.redports.org/buildarchive/r363986/

Log:
  devel/pkgconf: Import patch to support non-newline-terminated .pc files
  
  It fixes a bug in pkgconf(1) where the last line, if not terminated by a
  newline character, would be chopped by one byte. This could lead to
  incorrect flags returned by pkgconf(1).
  
  An example is cppunit.pc from devel/cppunit: the cppunit.pc.in, used to
  generate cppunit.pc, isn't newline-terminated. Our sed(1) currently adds
  a newline to the last line, no matter what the input stream has. But
  that's not the case with GNU sed and our sed should be soon fixed too. In
  this case, "pkgconf --cflags cppunit" returned "-I" before this fix,
  instead of "-I/usr/local/include" now.
  
  This patch is already committed upstream.
  
  Reviewed by:	bapt@
  Approved by:	bapt@
  Phabric:	https://phabric.freebsd.org/D532

Added:
  head/devel/pkgconf/files/
  head/devel/pkgconf/files/patch-fileio.c   (contents, props changed)
  head/devel/pkgconf/files/patch-pkg.c   (contents, props changed)
Modified:
  head/devel/pkgconf/Makefile

Modified: head/devel/pkgconf/Makefile
==============================================================================
--- head/devel/pkgconf/Makefile	Mon Aug  4 09:49:45 2014	(r363985)
+++ head/devel/pkgconf/Makefile	Mon Aug  4 10:00:37 2014	(r363986)
@@ -2,6 +2,7 @@
 
 PORTNAME=	pkgconf
 PORTVERSION=	0.9.6
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://rabbit.dereferenced.org/~nenolod/distfiles/ \
 		http://files.etoilebsd.net/pkgconf/

Added: head/devel/pkgconf/files/patch-fileio.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pkgconf/files/patch-fileio.c	Mon Aug  4 10:00:37 2014	(r363986)
@@ -0,0 +1,23 @@
+--- ./fileio.c.orig	2014-06-07 22:32:08.000000000 +0200
++++ ./fileio.c	2014-08-04 11:24:32.522803742 +0200
+@@ -83,10 +83,18 @@
+ 
+ 	}
+ 
+-	*s = '\0';
+-
+ 	if (c == EOF && (s == line || ferror(stream)))
+ 		return NULL;
+ 
++	*s = '\0';
++
++	/* Remove newline character. */
++	if (s > line && *(--s) == '\n') {
++		*s = '\0';
++
++		if (s > line && *(--s) == '\r')
++			*s = '\0';
++	}
++
+ 	return line;
+ }

Added: head/devel/pkgconf/files/patch-pkg.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/pkgconf/files/patch-pkg.c	Mon Aug  4 10:00:37 2014	(r363986)
@@ -0,0 +1,11 @@
+--- ./pkg.c.orig	2014-06-07 22:32:08.000000000 +0200
++++ ./pkg.c	2014-08-04 11:24:32.524802321 +0200
+@@ -212,8 +212,6 @@
+ 	{
+ 		char op, *p, *key, *value;
+ 
+-		readbuf[strlen(readbuf) - 1] = '\0';
+-
+ 		p = readbuf;
+ 		while (*p && (isalpha(*p) || isdigit(*p) || *p == '_' || *p == '.'))
+ 			p++;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53df59c5.57c4.42f72122>