summaryrefslogtreecommitdiff
path: root/deskutils
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2020-10-30 15:01:04 +0000
committerStefan Eßer <se@FreeBSD.org>2020-10-30 15:01:04 +0000
commit320ace80a32358a3bf3e805f706c0a8c039da8b2 (patch)
treea27c7b563f23f2b012b10c0993049c8aacb58541 /deskutils
parentFix the way of linking with OpenGL, fixing compatibility with glvnd (diff)
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
Notes
Notes: svn path=/head/; revision=553696
Diffstat (limited to 'deskutils')
-rw-r--r--deskutils/calendar/Makefile4
-rw-r--r--deskutils/calendar/distinfo6
-rw-r--r--deskutils/calendar/files/patch-calendar.h11
-rw-r--r--deskutils/calendar/files/patch-io.c199
-rw-r--r--deskutils/calendar/files/patch-pathnames.h15
5 files changed, 205 insertions, 30 deletions
diff --git a/deskutils/calendar/Makefile b/deskutils/calendar/Makefile
index 237654db5906..b2b46106121a 100644
--- a/deskutils/calendar/Makefile
+++ b/deskutils/calendar/Makefile
@@ -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 \
diff --git a/deskutils/calendar/distinfo b/deskutils/calendar/distinfo
index bcb6a5a7ce3f..c41ee82628a1 100644
--- a/deskutils/calendar/distinfo
+++ b/deskutils/calendar/distinfo
@@ -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
diff --git a/deskutils/calendar/files/patch-calendar.h b/deskutils/calendar/files/patch-calendar.h
deleted file mode 100644
index 3e95c74e8bc2..000000000000
--- a/deskutils/calendar/files/patch-calendar.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- calendar.h.orig 2020-10-18 03:01:26 UTC
-+++ calendar.h
-@@ -28,7 +28,7 @@
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
-- * $FreeBSD$
-+ * $FreeBSD: head/usr.bin/calendar/calendar.h 358562 2020-03-03 00:20:08Z cem $
- */
-
- #include <sys/types.h>
diff --git a/deskutils/calendar/files/patch-io.c b/deskutils/calendar/files/patch-io.c
index e6cd983530a8..6e7f13136a3d 100644
--- a/deskutils/calendar/files/patch-io.c
+++ b/deskutils/calendar/files/patch-io.c
@@ -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;
+
+ /*
diff --git a/deskutils/calendar/files/patch-pathnames.h b/deskutils/calendar/files/patch-pathnames.h
index 53d72d887f78..a50c17706453 100644
--- a/deskutils/calendar/files/patch-pathnames.h
+++ b/deskutils/calendar/files/patch-pathnames.h
@@ -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"