Friday, July 07, 2017

UPDATE: math/wcalc 2.4 => 2.5

Index: Makefile
===================================================================
RCS file: /cvs/ports/math/wcalc/Makefile,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 Makefile
--- Makefile 13 Apr 2014 01:01:39 -0000 1.7
+++ Makefile 1 Jul 2017 01:49:44 -0000
@@ -3,12 +3,12 @@

COMMENT = natural-expression command-line calculator

-DISTNAME = wcalc-2.4
+DISTNAME = wcalc-2.5
CATEGORIES = math
HOMEPAGE = http://w-calc.sourceforge.net/
MAINTAINER = Amarendra Godbole <amarendra.godbole@gmail.com>

-# GPLv2
+# GPLv2+
PERMIT_PACKAGE_CDROM = Yes

MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=w-calc/}
Index: distinfo
===================================================================
RCS file: /cvs/ports/math/wcalc/distinfo,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 distinfo
--- distinfo 18 Jan 2015 03:14:30 -0000 1.2
+++ distinfo 1 Jul 2017 01:49:44 -0000
@@ -1,2 +1,2 @@
-SHA256 (wcalc-2.4.tar.gz) = /6J17501ZOi8jx2/Y/5cSl0Mt31Cf1XcyZP0onmpgSU=
-SIZE (wcalc-2.4.tar.gz) = 408961
+SHA256 (wcalc-2.5.tar.gz) = LBiM1aWOkOwdheTIzIkcLCWW2Ub8xKQJbIeK2R2sd8c=
+SIZE (wcalc-2.5.tar.gz) = 493747
Index: patches/patch-files_c
===================================================================
RCS file: patches/patch-files_c
diff -N patches/patch-files_c
--- patches/patch-files_c 3 Feb 2009 22:46:14 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
---- files.c.orig 27 Aug 2007 20:48:58 -0000 1.23
-+++ files.c 31 Dec 2008 22:17:48 -0000 1.25
-@@ -31,7 +31,7 @@ char *open_file = NULL;
-
- int saveState(char *filename)
- { /*{{{ */
-- int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC,
-+ int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
- int return_error = 0;
-
-@@ -208,12 +208,17 @@ int storeVar(const char *variable)
- { /*{{{ */
- int fd, retval = 0, return_error = 0;
- char filename[PATH_MAX];
-+ const char *preloadfile = "/.wcalc_preload";
-
- if (!varexists(variable)) {
- report_error("Variable is not defined.");
- return -1;
- }
-- snprintf(filename, PATH_MAX, "%s/.wcalc_preload", getenv("HOME"));
-+ if (strlen(getenv("HOME")) > PATH_MAX - strlen(preloadfile) - 1) {
-+ report_error("HOME environment variable is too long.");
-+ return -1;
-+ }
-+ snprintf(filename, PATH_MAX, "%s%s", getenv("HOME"), preloadfile);
- fd = open(filename, O_WRONLY | O_CREAT | O_APPEND,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
- if (fd >= 0) {
Index: patches/patch-main_c
===================================================================
RCS file: patches/patch-main_c
diff -N patches/patch-main_c
--- patches/patch-main_c 3 Feb 2009 22:46:14 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,132 +0,0 @@
---- main.c.orig 26 Oct 2008 20:02:21 -0000 1.93
-+++ main.c 31 Dec 2008 22:08:35 -0000 1.94
-@@ -332,6 +332,9 @@ int main(int argc, char *argv[])
- #else
- char readme[BIG_STRING];
- #endif
-+#ifdef HAVE_READLINE_HISTORY
-+ char * historyfile = "/.wcalc_history";
-+#endif
- int tty, i;
- short cmdline_input = 0;
-
-@@ -375,13 +378,24 @@ int main(int argc, char *argv[])
- }
-
- if (foundflag == 0) {
-- snprintf(filename, PATH_MAX, "%s/.wcalcrc", getenv("HOME"));
-- if (read_prefs(filename)) {
-- perror("Writing Preferences");
-- }
-- snprintf(filename, PATH_MAX, "%s/.wcalc_preload", getenv("HOME"));
-- if (read_preload(filename)) {
-- perror("Reading Preload File");
-+ char * home = getenv("HOME");
-+ char * rcfile = "/.wcalcrc";
-+ char * preloadfile = "/.wcalc_preload";
-+ if (strlen(home) < PATH_MAX - strlen(rcfile) - 1) {
-+ snprintf(filename, PATH_MAX, "%s%s", home, rcfile);
-+ if (read_prefs(filename)) {
-+ perror("Writing Preferences");
-+ }
-+ } else {
-+ perror("HOME is too long to read preferences");
-+ }
-+ if (strlen(home) < PATH_MAX - strlen(preloadfile) - 1) {
-+ snprintf(filename, PATH_MAX, "%s%s", home, preloadfile);
-+ if (read_preload(filename)) {
-+ perror("Reading Preload File");
-+ }
-+ } else {
-+ perror("HOME is too long to read preload file");
- }
- }
- }
-@@ -542,13 +556,16 @@ int main(int argc, char *argv[])
- if (!cmdline_input) {
- #ifdef HAVE_READLINE_HISTORY
- char filename[PATH_MAX];
-+ char * home = getenv("HOME");
-
- using_history();
-- snprintf(filename, PATH_MAX, "%s/.wcalc_history",
-- getenv("HOME"));
-- if (read_history(filename)) {
-- if (errno != ENOENT) {
-- perror("Reading History");
-+ if (strlen(home) < PATH_MAX - strlen(historyfile) - 1) {
-+ snprintf(filename, PATH_MAX, "%s%s",
-+ home, historyfile);
-+ if (read_history(filename)) {
-+ if (errno != ENOENT) {
-+ perror("Reading History");
-+ }
- }
- }
- #endif
-@@ -581,13 +598,16 @@ int main(int argc, char *argv[])
- if (envinput) {
- #ifdef HAVE_READLINE_HISTORY
- char filename[PATH_MAX];
-+ char * home = getenv("HOME");
-
- using_history();
-- snprintf(filename, PATH_MAX, "%s/.wcalc_history",
-- getenv("HOME"));
-- if (read_history(filename)) {
-- if (errno != ENOENT) {
-- perror("Reading History");
-+ if (strlen(home) < PATH_MAX - strlen(historyfile) - 1) {
-+ snprintf(filename, PATH_MAX, "%s%s",
-+ home, historyfile);
-+ if (read_history(filename)) {
-+ if (errno != ENOENT) {
-+ perror("Reading History");
-+ }
- }
- }
- #endif
-@@ -616,13 +636,16 @@ int main(int argc, char *argv[])
- if (cmdline_input) {
- #ifdef HAVE_READLINE_HISTORY
- char filename[PATH_MAX];
-+ char * home = getenv("HOME");
-
-- snprintf(filename, PATH_MAX, "%s/.wcalc_history", getenv("HOME"));
-- if (write_history(filename))
-- perror("Saving History");
-- if (conf.history_limit) {
-- if (history_truncate_file(filename, conf.history_limit_len))
-- perror("Truncating History");
-+ if (strlen(home) < PATH_MAX - strlen(historyfile) - 1) {
-+ snprintf(filename, PATH_MAX, "%s%s", home, historyfile);
-+ if (write_history(filename))
-+ perror("Saving History");
-+ if (conf.history_limit) {
-+ if (history_truncate_file(filename, conf.history_limit_len))
-+ perror("Truncating History");
-+ }
- }
- #endif
- clearHistory();
-@@ -637,12 +660,15 @@ int main(int argc, char *argv[])
- /* if stdin is a keyboard or terminal, then use readline and prompts */
- #ifdef HAVE_READLINE_HISTORY
- char filename[PATH_MAX];
-+ char * home = getenv("HOME");
-
-- snprintf(filename, PATH_MAX, "%s/.wcalc_history", getenv("HOME"));
-- using_history();
-- if (read_history(filename)) {
-- if (errno != ENOENT) {
-- perror("Reading History");
-+ if (strlen(home) < PATH_MAX - strlen(historyfile) - 1) {
-+ snprintf(filename, PATH_MAX, "%s%s", home, historyfile);
-+ using_history();
-+ if (read_history(filename)) {
-+ if (errno != ENOENT) {
-+ perror("Reading History");
-+ }
- }
- }
- #endif
Hi ports --

Attached is a diff to update math/wcalc to its latest version. It
appears upstream fixed the things we have patches for, although in a
different way than these patches.

MAINTAINER timeout.

OK?

~Brian

No comments:

Post a Comment