Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Oct 2020 15:01:05 +0000 (UTC)
From:      =?UTF-8?Q?Stefan_E=c3=9fer?= <se@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r553696 - in head/deskutils/calendar: . files
Message-ID:  <202010301501.09UF15fR092744@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: se
Date: Fri Oct 30 15:01:04 2020
New Revision: 553696
URL: https://svnweb.freebsd.org/changeset/ports/553696

Log:
  Update to FreeBSD SVN revision r367167
  
  This update implements comment handling lost when calendar was changed
  from using an external cpp to an internal pre-processor

Deleted:
  head/deskutils/calendar/files/patch-calendar.h
Modified:
  head/deskutils/calendar/Makefile
  head/deskutils/calendar/distinfo
  head/deskutils/calendar/files/patch-io.c
  head/deskutils/calendar/files/patch-pathnames.h

Modified: head/deskutils/calendar/Makefile
==============================================================================
--- head/deskutils/calendar/Makefile	Fri Oct 30 14:59:03 2020	(r553695)
+++ head/deskutils/calendar/Makefile	Fri Oct 30 15:01:04 2020	(r553696)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=	calendar
-DISTVERSION=	0.3
+DISTVERSION=	0.5
 CATEGORIES=	deskutils
 
 MAINTAINER=	se@FreeBSD.org
@@ -15,7 +15,7 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	bsdimp
 GH_TAGNAME=	fcc5d31
 
-CFLAGS+=	-DLOCALBASE=${LOCALBASE}
+CFLAGS+=	-D_PATH_LOCALBASE=\"${LOCALBASE}\" -g -O0 # -DDEBUG
 LDFLAGS+=	-lm -lutil
 
 PLIST_FILES=	bin/calendar \

Modified: head/deskutils/calendar/distinfo
==============================================================================
--- head/deskutils/calendar/distinfo	Fri Oct 30 14:59:03 2020	(r553695)
+++ head/deskutils/calendar/distinfo	Fri Oct 30 15:01:04 2020	(r553696)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1603969583
-SHA256 (bsdimp-calendar-0.3-fcc5d31_GH0.tar.gz) = ad7d0b51c4b834241aebbf6c50d187e5720f6c46c02615b27841a923e082aebc
-SIZE (bsdimp-calendar-0.3-fcc5d31_GH0.tar.gz) = 132824
+TIMESTAMP = 1604068556
+SHA256 (bsdimp-calendar-0.5-fcc5d31_GH0.tar.gz) = ad7d0b51c4b834241aebbf6c50d187e5720f6c46c02615b27841a923e082aebc
+SIZE (bsdimp-calendar-0.5-fcc5d31_GH0.tar.gz) = 132824

Modified: head/deskutils/calendar/files/patch-io.c
==============================================================================
--- head/deskutils/calendar/files/patch-io.c	Fri Oct 30 14:59:03 2020	(r553695)
+++ head/deskutils/calendar/files/patch-io.c	Fri Oct 30 15:01:04 2020	(r553696)
@@ -1,6 +1,85 @@
---- io.c.orig	2020-10-29 11:04:06 UTC
+--- io.c.orig	2020-10-18 03:01:26 UTC
 +++ io.c
-@@ -209,26 +209,12 @@ token(char *line, FILE *out, int *skip)
+@@ -71,7 +71,7 @@ enum {
+ };
+ 
+ const char *calendarFile = "calendar";	/* default calendar file */
+-static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */
++static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, _PATH_INCLUDE}; /* HOME */
+ static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */
+ 
+ static char path[MAXPATHLEN];
+@@ -134,18 +134,66 @@ cal_fopen(const char *file)
+ }
+ 
+ static int
+-token(char *line, FILE *out, bool *skip)
++token(char *line, FILE *out, int *skip)
+ {
+ 	char *walk, c, a;
+ 
+ 	if (strncmp(line, "endif", 5) == 0) {
+-		*skip = false;
++		if (*skip > 0)
++			--*skip;
+ 		return (T_OK);
+ 	}
+ 
+-	if (*skip)
++	if (strncmp(line, "ifdef", 5) == 0) {
++		walk = line + 5;
++		trimlr(&walk);
++
++		if (*walk == '\0') {
++			warnx("Expecting arguments after #ifdef");
++			return (T_ERR);
++		}
++
++		if (*skip != 0 || definitions == NULL || sl_find(definitions, walk) == NULL)
++			++*skip;
++
+ 		return (T_OK);
++	}
+ 
++	if (strncmp(line, "ifndef", 6) == 0) {
++		walk = line + 6;
++		trimlr(&walk);
++
++		if (*walk == '\0') {
++			warnx("Expecting arguments after #ifndef");
++			return (T_ERR);
++		}
++
++		if (*skip != 0 || (definitions != NULL && sl_find(definitions, walk) != NULL))
++			++*skip;
++
++		return (T_OK);
++	}
++
++	if (strncmp(line, "else", 4) == 0) {
++		walk = line + 4;
++		trimlr(&walk);
++
++		if (*walk != '\0') {
++			warnx("Expecting no arguments after #else");
++			return (T_ERR);
++		}
++
++		if (*skip == 0)
++			*skip = 1;
++		else if (*skip == 1)
++			*skip = 0;
++
++		return (T_OK);
++	}
++
++	if (*skip != 0)
++		return (T_OK);
++
+ 	if (strncmp(line, "include", 7) == 0) {
+ 		walk = line + 7;
+ 
+@@ -161,26 +209,12 @@ token(char *line, FILE *out, bool *skip)
  			return (T_ERR);
  		}
  
@@ -30,3 +109,119 @@
  			return (T_ERR);
  		}
  		walk[strlen(walk) - 1] = '\0';
+@@ -206,21 +240,6 @@ token(char *line, FILE *out, bool *skip)
+ 		return (T_OK);
+ 	}
+ 
+-	if (strncmp(line, "ifndef", 6) == 0) {
+-		walk = line + 6;
+-		trimlr(&walk);
+-
+-		if (*walk == '\0') {
+-			warnx("Expecting arguments after #ifndef");
+-			return (T_ERR);
+-		}
+-
+-		if (definitions != NULL && sl_find(definitions, walk) != NULL)
+-			*skip = true;
+-
+-		return (T_OK);
+-	}
+-
+ 	return (T_PROCESS);
+ 
+ }
+@@ -248,11 +267,13 @@ cal_parse(FILE *in, FILE *out)
+ 	int month[MAXCOUNT];
+ 	int day[MAXCOUNT];
+ 	int year[MAXCOUNT];
+-	bool skip = false;
++	int skip = 0;
+ 	char dbuf[80];
+ 	char *pp, p;
+ 	struct tm tm;
+ 	int flags;
++	char *c, *cc;
++	bool incomment = false;
+ 
+ 	/* Unused */
+ 	tm.tm_sec = 0;
+@@ -264,8 +285,58 @@ cal_parse(FILE *in, FILE *out)
+ 		return (1);
+ 
+ 	while ((linelen = getline(&line, &linecap, in)) > 0) {
+-		if (*line == '#') {
+-			switch (token(line+1, out, &skip)) {
++		buf = line;
++		if (buf[linelen - 1] == '\n')
++			buf[--linelen] = '\0';
++
++		if (incomment) {
++			c = strstr(buf, "*/");
++			if (c) {
++				c += 2;
++				linelen -= c - buf;
++				buf = c;
++				incomment = false;
++			} else {
++				continue;
++			}
++		}
++		if (!incomment) {
++			do {
++				c = strstr(buf, "//");
++				cc = strstr(buf, "/*");
++				if (c != NULL && (cc == NULL || c - cc < 0)) {
++					/* single line comment */
++					*c = '\0';
++					linelen = c - buf;
++					break;
++				} else if (cc != NULL) {
++					c = strstr(cc + 2, "*/");
++					if (c != NULL) {
++						/* multi-line comment ending on same line */
++						c += 2;
++						memmove(cc, c, buf + linelen + 1 - c);
++						linelen -= c - cc;
++					} else {
++						/* multi-line comment */
++						*cc = '\0';
++						linelen = cc - buf;
++						incomment = true;
++						break;
++					}
++				}
++			} while (c != NULL || cc != NULL);
++		}
++
++		for (l = linelen;
++		     l > 0 && isspace((unsigned char)buf[l - 1]);
++		     l--)
++			;
++		buf[l] = '\0';
++		if (buf[0] == '\0')
++			continue;
++
++		if (buf == line && *buf == '#') {
++			switch (token(buf+1, out, &skip)) {
+ 			case T_ERR:
+ 				free(line);
+ 				return (1);
+@@ -278,16 +349,7 @@ cal_parse(FILE *in, FILE *out)
+ 			}
+ 		}
+ 
+-		if (skip)
+-			continue;
+-
+-		buf = line;
+-		for (l = linelen;
+-		     l > 0 && isspace((unsigned char)buf[l - 1]);
+-		     l--)
+-			;
+-		buf[l] = '\0';
+-		if (buf[0] == '\0')
++		if (skip != 0)
+ 			continue;
+ 
+ 		/*

Modified: head/deskutils/calendar/files/patch-pathnames.h
==============================================================================
--- head/deskutils/calendar/files/patch-pathnames.h	Fri Oct 30 14:59:03 2020	(r553695)
+++ head/deskutils/calendar/files/patch-pathnames.h	Fri Oct 30 15:01:04 2020	(r553696)
@@ -1,16 +1,7 @@
---- pathnames.h.orig	2020-10-18 03:01:26 UTC
+--- pathnames.h.orig	2020-10-30 14:47:55 UTC
 +++ pathnames.h
-@@ -29,9 +29,12 @@
-  * SUCH DAMAGE.
-  *
-  *	@(#)pathnames.h	8.1 (Berkeley) 6/6/93
-- * $FreeBSD$
-+ * $FreeBSD: head/usr.bin/calendar/pathnames.h 366962 2020-10-23 09:22:23Z se $
-  */
- 
+@@ -35,3 +35,4 @@
  #include <paths.h>
  
-+#define s1(s)	#s
-+#define s2(s)	s1(s)
  #define	_PATH_INCLUDE	"/usr/share/calendar"
-+#define	_PATH_INCLUDE_LOCAL	s2(LOCALBASE) "/share/calendar"
++#define	_PATH_INCLUDE_LOCAL	_PATH_LOCALBASE "/share/calendar"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010301501.09UF15fR092744>