svn commit: r316960 - in head/cad/spice: . files

Hiroki Sato hrs at FreeBSD.org
Tue Apr 30 20:30:23 UTC 2013


Author: hrs
Date: Tue Apr 30 20:30:22 2013
New Revision: 316960
URL: http://svnweb.freebsd.org/changeset/ports/316960

Log:
  - Fix SIGSEGV when there are spaces after a comma like ".PRINT TRAN v(2, 1)".
  - Style clean-ups.
  
  PR:		ports/157313
  Spotted by:	Makoto Kishimoto

Added:
  head/cad/spice/files/patch-src_lib_cp_lexical.c   (contents, props changed)
  head/cad/spice/files/patch-src_lib_fte_dotcards.c   (contents, props changed)
  head/cad/spice/files/patch-src_lib_misc_string.c   (contents, props changed)
Modified:
  head/cad/spice/Makefile

Modified: head/cad/spice/Makefile
==============================================================================
--- head/cad/spice/Makefile	Tue Apr 30 20:10:53 2013	(r316959)
+++ head/cad/spice/Makefile	Tue Apr 30 20:30:22 2013	(r316960)
@@ -1,44 +1,45 @@
-# New ports collection makefile for:    spice
-# Date created:         26 Mar 96
-# Whom:                 Julian Jenkins <kaveman at magna.com.au>
-#
+# Created by: Julian Jenkins <kaveman at magna.com.au>
 # $FreeBSD$
-#
 
 PORTNAME=	spice
 PORTVERSION=	3f5.2
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	cad
 MASTER_SITES=	http://embedded.eecs.berkeley.edu/pubs/downloads/spice/:sources
+PKGNAMESUFFIX=	${NOX11SUFX}
 DISTFILES=	spice3f5${EXTRACT_SUFX}:sources	\
 		cp.ps toc.ps doc.ps
 DIST_SUBDIR=	spice
 EXTRACT_ONLY=	spice3f5${EXTRACT_SUFX}
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	hrs at FreeBSD.org
 COMMENT=	A general-purpose circuit simulation program
 
 LICENSE=	BSD
 
 WRKSRC=		${WRKDIR}/${PORTNAME}3f5
+MAKEFILE=	${FILESDIR}/Makefile
+MAKE_ENV+=	STRIP_CMD=${STRIP_CMD}
+MAKE_JOBS_UNSAFE=	yes
 MAN1=		sconvert.1 nutmeg.1 spice.1
 MAN3=		mfb.3
 MAN5=		mfbcap.5
 MLINKS=		spice.1 spice3.1
-MAKEFILE=	${FILESDIR}/Makefile
-MAKE_ENV+=	STRIP_CMD=${STRIP_CMD}
-MAKE_JOBS_UNSAFE=	yes
 
-.ifdef WITHOUT_X11
-PKGNAMESUFFIX=	-without-x11
+OPTIONS_DEFINE=	DOCS X11
+OPTIONS_DEFAULT=DOCS X11
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MX11}
+USE_XORG=	x11 xaw xext xmu xt
+NOX11SUFX=
+.else
+NOX11SUFX=	-nox11
 COMMENT=	A general-purpose circuit simulation program (non-X11 version)
 MAKE_ARGS+=	-DWITHOUT_X11
-.else
-USE_XORG=	x11 xaw xext xmu xt
 .endif
 
-.include <bsd.port.pre.mk>
-
 post-patch:
 	@${REINPLACE_CMD} -e 's|/usr/ucb|${LOCALBASE}/bin|' ${WRKSRC}/util/build
 
@@ -50,7 +51,7 @@ do-configure:
 	    ${WRKSRC}/conf/FreeBSD ${WRKSRC}/conf/FreeBSD.without_x11
 
 post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${DOCSDIR}
 	${CAT} ${DISTDIR}/${DIST_SUBDIR}/*.ps > ${DOCSDIR}/spice3f3.ps
 	${GZIP_CMD} ${DOCSDIR}/*.ps
@@ -58,4 +59,4 @@ post-install:
 	${MKDIR} ${EXAMPLESDIR}
 	${INSTALL_DATA} ${WRKSRC}/examples/*.cir ${EXAMPLESDIR}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Added: head/cad/spice/files/patch-src_lib_cp_lexical.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/spice/files/patch-src_lib_cp_lexical.c	Tue Apr 30 20:30:22 2013	(r316960)
@@ -0,0 +1,11 @@
+--- src/lib/cp/lexical.c.orig	2013-05-01 05:15:32.000000000 +0900
++++ src/lib/cp/lexical.c	2013-05-01 05:16:36.000000000 +0900
+@@ -145,7 +145,7 @@
+         switch (c) {
+ 	case ' ':
+ 	case '\t':
+-            if (i > 0) {
++            if (paren < 1 && i > 0) {
+                 newword;
+             }
+             break;

Added: head/cad/spice/files/patch-src_lib_fte_dotcards.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/spice/files/patch-src_lib_fte_dotcards.c	Tue Apr 30 20:30:22 2013	(r316960)
@@ -0,0 +1,31 @@
+--- src/lib/fte/dotcards.c.orig	1993-07-30 13:44:28.000000000 +0900
++++ src/lib/fte/dotcards.c	2013-05-01 05:07:55.000000000 +0900
+@@ -405,11 +405,17 @@
+     char *string;
+ {
+     char buf[BSIZE_SP], *s, *t, *ss = string;
++    char *e;
+ 
++    e = string + strlen(string);
+     if (ciprefix("v(", string) && index(string, ',')) {
+         for (s = string; *s && (*s != ','); s++)
+             ;
+         *s++ = '\0';
++	while (s + 1 < e && isspace(*(s + 1))) {
++		*(s + 1) = '\0';
++		s++;
++	}
+         for (t = s; *t && (*t != ')'); t++)
+             ;
+         *t = '\0';
+@@ -589,6 +595,10 @@
+ 
+ 	if (c)
+ 	    *c = 0;
++	while (c + 1 < r && isspace(*(c + 1))) {
++		c++;
++		*c = '\0';
++	}
+ 
+ 	wl = alloc(struct wordlist);
+ 

Added: head/cad/spice/files/patch-src_lib_misc_string.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cad/spice/files/patch-src_lib_misc_string.c	Tue Apr 30 20:30:22 2013	(r316960)
@@ -0,0 +1,19 @@
+--- src/lib/misc/string.c.orig	2013-05-01 03:50:59.000000000 +0900
++++ src/lib/misc/string.c	2013-05-01 03:58:30.000000000 +0900
+@@ -148,13 +148,15 @@
+         (*s)++;
+     if (!**s)
+         return (NULL);
+-    while ((c = **s) && !isspace(c)) {
++    while ((c = **s)) {
+ 	if (c == '('/*)*/)
+ 	    paren += 1;
+ 	else if (c == /*(*/')')
+ 	    paren -= 1;
+ 	else if (c == ',' && paren < 1)
+ 	    break;
++	else if (isspace(c) && paren < 1)
++	    break;
+         buf[i++] = *(*s)++;
+     }
+     buf[i] = '\0';


More information about the svn-ports-all mailing list