From b3e214febb14295338679c1b15051c9663a5a958 Mon Sep 17 00:00:00 2001 From: sturm Date: Thu, 10 Apr 2003 16:51:21 +0000 Subject: [PATCH] update to ddd 3.3.1 - minor bug fixes - improved temp file handling from Andrew Dalgleish --- devel/ddd/Makefile | 8 ++- devel/ddd/distinfo | 6 +-- devel/ddd/patches/patch-ddd_PlotAgent_C | 21 -------- devel/ddd/patches/patch-ddd_comm-manag_C | 27 ++-------- devel/ddd/patches/patch-ddd_exit_C | 17 ------ devel/ddd/patches/patch-ddd_plotter_C | 19 ------- devel/ddd/patches/patch-ddd_print_C | 17 ------ devel/ddd/patches/patch-ddd_show_C | 25 ++------- devel/ddd/patches/patch-ddd_strclass_C | 12 ----- devel/ddd/pkg/PLIST | 68 ++++++++++++------------ devel/ddd/pkg/SECURITY | 11 ++-- 11 files changed, 56 insertions(+), 175 deletions(-) delete mode 100644 devel/ddd/patches/patch-ddd_PlotAgent_C delete mode 100644 devel/ddd/patches/patch-ddd_exit_C delete mode 100644 devel/ddd/patches/patch-ddd_plotter_C delete mode 100644 devel/ddd/patches/patch-ddd_print_C delete mode 100644 devel/ddd/patches/patch-ddd_strclass_C diff --git a/devel/ddd/Makefile b/devel/ddd/Makefile index 00bf08a480f..9453a7d1d7c 100644 --- a/devel/ddd/Makefile +++ b/devel/ddd/Makefile @@ -1,13 +1,14 @@ -# $OpenBSD: Makefile,v 1.34 2002/10/13 21:45:46 naddy Exp $ +# $OpenBSD: Makefile,v 1.35 2003/04/10 16:51:21 sturm Exp $ COMMENT= "Data Display Debugger, graphical front-end for GDB, etc" -DISTNAME= ddd-3.3 +DISTNAME= ddd-3.3.1 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_GNU:=ddd/} HOMEPAGE= http://www.gnu.org/software/ddd/ +# GPL PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes @@ -16,6 +17,9 @@ PERMIT_DISTFILES_FTP= Yes USE_MOTIF= any USE_GMAKE= Yes CONFIGURE_STYLE=gnu + +SUBST_VARS+= DISTNAME + MODGNU_CONFIG_GUESS_DIRS= ${WRKSRC} ${WRKSRC}/libiberty \ ${WRKSRC}/readline/support CONFIGURE_ARGS= --with-readline-libraries=/usr/lib diff --git a/devel/ddd/distinfo b/devel/ddd/distinfo index 024d422d29d..77a4e8de107 100644 --- a/devel/ddd/distinfo +++ b/devel/ddd/distinfo @@ -1,3 +1,3 @@ -MD5 (ddd-3.3.tar.gz) = 0454f8b986223168c7148a84afeb416c -RMD160 (ddd-3.3.tar.gz) = e3782a85af33100c9520d2b576c1db579349d9c3 -SHA1 (ddd-3.3.tar.gz) = 889c435bed8f16cb618dc56a85be6f6384d5df24 +MD5 (ddd-3.3.1.tar.gz) = 38589618d7cd02a03d062bb116bbf1d2 +RMD160 (ddd-3.3.1.tar.gz) = 5753988c15da13b154bd5138a21f7381906f6bce +SHA1 (ddd-3.3.1.tar.gz) = 60327a4097718acc1c095844d043dea0c14343ce diff --git a/devel/ddd/patches/patch-ddd_PlotAgent_C b/devel/ddd/patches/patch-ddd_PlotAgent_C deleted file mode 100644 index 83ab007de58..00000000000 --- a/devel/ddd/patches/patch-ddd_PlotAgent_C +++ /dev/null @@ -1,21 +0,0 @@ -$OpenBSD: patch-ddd_PlotAgent_C,v 1.1 2000/10/30 13:54:50 espie Exp $ ---- ddd/PlotAgent.C.orig Mon Oct 30 14:28:07 2000 -+++ ddd/PlotAgent.C Mon Oct 30 14:33:54 2000 -@@ -83,11 +83,14 @@ void PlotAgent::start_plot(const string& - - while (files.size() < titles.size()) - { -- // Open a new temporary file -- files += tmpnam(0); -+ // Create a new temporary file -+ char temp_name[] = "/tmp/dplot.XXXXXXXXXX"; -+ int temp_fd = mkstemp(temp_name); -+ close(temp_fd); -+ files += temp_name; - } - -- // Open plot stream -+ // Re-Open plot stream - plot_os.open(files[titles.size() - 1]); - - // Issue initial line diff --git a/devel/ddd/patches/patch-ddd_comm-manag_C b/devel/ddd/patches/patch-ddd_comm-manag_C index a1050f797ab..df3be8af059 100644 --- a/devel/ddd/patches/patch-ddd_comm-manag_C +++ b/devel/ddd/patches/patch-ddd_comm-manag_C @@ -1,7 +1,7 @@ -$OpenBSD: patch-ddd_comm-manag_C,v 1.3 2002/10/13 21:45:46 naddy Exp $ ---- ddd/comm-manag.C.orig Tue Jan 16 05:51:37 2001 -+++ ddd/comm-manag.C Fri Oct 11 12:13:38 2002 -@@ -85,6 +85,7 @@ char comm_manager_rcsid[] = +$OpenBSD: patch-ddd_comm-manag_C,v 1.4 2003/04/10 16:51:21 sturm Exp $ +--- ddd/comm-manag.C.orig Tue Mar 27 02:40:05 2001 ++++ ddd/comm-manag.C Fri Mar 28 10:35:57 2003 +@@ -86,6 +86,7 @@ char comm_manager_rcsid[] = #include #include @@ -9,22 +9,3 @@ $OpenBSD: patch-ddd_comm-manag_C,v 1.3 2002/10/13 21:45:46 naddy Exp $ //----------------------------------------------------------------------------- -@@ -800,13 +801,16 @@ void init_session(const string& restart, - info = new InitSessionInfo; - info->restart = restart; - info->settings = settings; -- info->tempfile = tmpnam(0); -+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX"; -+ int temp_fd = mkstemp(temp_name); -+ info->tempfile = temp_name; - - string file_commands = "set confirm off\n"; - bool recording_defines = false; - - { -- ofstream os(info->tempfile); -+ close(temp_fd); // hack but how to mix mkstemp & ofstream ... -+ ofstream os(info->tempfile); // without a ctor ofstream(fd) ? - while (init_commands != "") - { - string cmd = init_commands.before('\n'); diff --git a/devel/ddd/patches/patch-ddd_exit_C b/devel/ddd/patches/patch-ddd_exit_C deleted file mode 100644 index bf2ae5206b0..00000000000 --- a/devel/ddd/patches/patch-ddd_exit_C +++ /dev/null @@ -1,17 +0,0 @@ -$OpenBSD: patch-ddd_exit_C,v 1.3 2002/10/13 21:45:46 naddy Exp $ ---- ddd/exit.C.orig Tue Dec 19 08:45:49 2000 -+++ ddd/exit.C Fri Oct 11 12:20:34 2002 -@@ -1149,8 +1149,11 @@ void report_core(ostream& log) - if (!is_core_file("core")) - return; - -- string tempfile = tmpnam(0); -- ofstream os(tempfile); -+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX"; -+ int temp_fd = mkstemp(temp_name); -+ string tempfile = temp_name; -+ close(temp_fd); // hack ... -+ ofstream os(temp_name); // ... no ofstream(fd) ctor - os << - "set verbose off\n" - "set height 0\n" diff --git a/devel/ddd/patches/patch-ddd_plotter_C b/devel/ddd/patches/patch-ddd_plotter_C deleted file mode 100644 index 4316aef9f07..00000000000 --- a/devel/ddd/patches/patch-ddd_plotter_C +++ /dev/null @@ -1,19 +0,0 @@ -$OpenBSD: patch-ddd_plotter_C,v 1.2 2002/03/21 05:28:21 fgsch Exp $ ---- ddd/plotter.C.orig Tue Jan 9 15:15:22 2001 -+++ ddd/plotter.C Wed Mar 13 04:32:03 2002 -@@ -429,7 +429,14 @@ static void configure_plot(PlotWindowInf - new StatusDelay("Retrieving Plot Settings"); - - // Save settings... -- plot->settings_file = tmpnam(0); -+ // gnuplot has no compunction about saving twice to the same -+ // file, so we can make this safe -+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX"; -+ int fd = mkstemp(temp_name); -+ if (fd == 0) -+ return; -+ close(fd); -+ plot->settings_file = temp_name; - string cmd = "save " + quote(plot->settings_file) + "\n"; - send(plot, cmd); - diff --git a/devel/ddd/patches/patch-ddd_print_C b/devel/ddd/patches/patch-ddd_print_C deleted file mode 100644 index 710cb144542..00000000000 --- a/devel/ddd/patches/patch-ddd_print_C +++ /dev/null @@ -1,17 +0,0 @@ -$OpenBSD: patch-ddd_print_C,v 1.1 2000/10/30 13:54:51 espie Exp $ ---- ddd/print.C.orig Mon Oct 30 13:36:27 2000 -+++ ddd/print.C Mon Oct 30 13:39:17 2000 -@@ -212,7 +212,12 @@ static void printOutputHP(Agent *, void - static int print_to_printer(string command, PrintGC& gc, - bool selectedOnly, bool displays) - { -- string tempfile = tmpnam(0); -+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX"; -+ int temp_fd = mkstemp(temp_name); -+ if (temp_fd == -1) -+ return 1; -+ close(temp_fd); -+ string tempfile = temp_name; - int ret = print_to_file(tempfile, gc, selectedOnly, displays); - if (ret) - return ret; diff --git a/devel/ddd/patches/patch-ddd_show_C b/devel/ddd/patches/patch-ddd_show_C index 40700fd6d7a..69219c96054 100644 --- a/devel/ddd/patches/patch-ddd_show_C +++ b/devel/ddd/patches/patch-ddd_show_C @@ -1,7 +1,7 @@ -$OpenBSD: patch-ddd_show_C,v 1.2 2002/03/21 05:28:21 fgsch Exp $ ---- ddd/show.C.orig Tue Jan 9 15:00:51 2001 -+++ ddd/show.C Wed Mar 13 04:32:04 2002 -@@ -58,6 +58,7 @@ char show_rcsid[] = +$OpenBSD: patch-ddd_show_C,v 1.3 2003/04/10 16:51:21 sturm Exp $ +--- ddd/show.C.orig Fri Apr 27 00:17:19 2001 ++++ ddd/show.C Fri Mar 28 10:35:58 2003 +@@ -59,6 +59,7 @@ char show_rcsid[] = #include #include #include @@ -9,20 +9,3 @@ $OpenBSD: patch-ddd_show_C,v 1.2 2002/03/21 05:28:21 fgsch Exp $ #include "Xpm.h" #include "HelpCB.h" -@@ -403,11 +404,14 @@ void show_configuration(ostream& os) - - static int uncompress(ostream& os, const char *text, int size) - { -- string tempfile = tmpnam(0); -- FILE *fp = fopen(tempfile, "w"); -+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX"; -+ int temp_fd = mkstemp(temp_name); -+ string tempfile = temp_name; -+ FILE *fp = fdopen(temp_fd, "w"); - if (fp == 0) - { - os << tempfile << ": " << strerror(errno); -+ close(temp_fd); - return -1; - } - diff --git a/devel/ddd/patches/patch-ddd_strclass_C b/devel/ddd/patches/patch-ddd_strclass_C deleted file mode 100644 index 4d69fba3897..00000000000 --- a/devel/ddd/patches/patch-ddd_strclass_C +++ /dev/null @@ -1,12 +0,0 @@ -$OpenBSD: patch-ddd_strclass_C,v 1.1 2002/10/13 21:45:46 naddy Exp $ ---- ddd/strclass.C.orig Sun Oct 13 19:56:55 2002 -+++ ddd/strclass.C Sun Oct 13 19:59:42 2002 -@@ -1431,7 +1431,7 @@ istream& operator>>(istream& s, string& - } - x.rep->s[i] = 0; - x.rep->len = i; -- int new_state = s.rdstate(); -+ ios::iostate new_state = s.rdstate(); - if (i == 0) - new_state |= ios::failbit; - if (ch == EOF) diff --git a/devel/ddd/pkg/PLIST b/devel/ddd/pkg/PLIST index 92667854c89..014e04e3c9e 100644 --- a/devel/ddd/pkg/PLIST +++ b/devel/ddd/pkg/PLIST @@ -1,4 +1,4 @@ -@comment $OpenBSD: PLIST,v 1.6 2002/03/21 05:28:21 fgsch Exp $ +@comment $OpenBSD: PLIST,v 1.7 2003/04/10 16:51:21 sturm Exp $ @unexec install-info --delete --info-dir=%D/info %D/info/ddd-themes.info @unexec install-info --delete --info-dir=%D/info %D/info/ddd.info bin/ddd @@ -19,35 +19,35 @@ info/ddd.info-7 info/ddd.info-8 info/ddd.info-9 man/man1/ddd.1 -share/ddd-3.3/COPYING -share/ddd-3.3/NEWS -share/ddd-3.3/ddd/Ddd -share/ddd-3.3/themes/green.vsl -share/ddd-3.3/themes/red.vsl -share/ddd-3.3/themes/smalltitles.vsl -share/ddd-3.3/themes/smallvalues.vsl -share/ddd-3.3/themes/suppress.vsl -share/ddd-3.3/themes/tinyvalues.vsl -share/ddd-3.3/vsllib/arcs.vsl -share/ddd-3.3/vsllib/builtin.vsl -share/ddd-3.3/vsllib/colors.vsl -share/ddd-3.3/vsllib/ctree.vsl -share/ddd-3.3/vsllib/ddd.vsl -share/ddd-3.3/vsllib/flow.vsl -share/ddd-3.3/vsllib/flowplus.vsl -share/ddd-3.3/vsllib/fonts.vsl -share/ddd-3.3/vsllib/linebreak.vsl -share/ddd-3.3/vsllib/list.vsl -share/ddd-3.3/vsllib/slopes.vsl -share/ddd-3.3/vsllib/std.vsl -share/ddd-3.3/vsllib/struct.vsl -share/ddd-3.3/vsllib/symbols.vsl -share/ddd-3.3/vsllib/tab.vsl -share/ddd-3.3/vsllib/tree.vsl -share/ddd-3.3/vsllib/verbose.vsl -share/ddd-3.3/vsllib/vsl.vsl -share/ddd-3.3/vsllib/vsldef.vsl -share/ddd-3.3/vsllib/vsllib.vsl +share/${DISTNAME}/COPYING +share/${DISTNAME}/NEWS +share/${DISTNAME}/ddd/Ddd +share/${DISTNAME}/themes/green.vsl +share/${DISTNAME}/themes/red.vsl +share/${DISTNAME}/themes/smalltitles.vsl +share/${DISTNAME}/themes/smallvalues.vsl +share/${DISTNAME}/themes/suppress.vsl +share/${DISTNAME}/themes/tinyvalues.vsl +share/${DISTNAME}/vsllib/arcs.vsl +share/${DISTNAME}/vsllib/builtin.vsl +share/${DISTNAME}/vsllib/colors.vsl +share/${DISTNAME}/vsllib/ctree.vsl +share/${DISTNAME}/vsllib/ddd.vsl +share/${DISTNAME}/vsllib/flow.vsl +share/${DISTNAME}/vsllib/flowplus.vsl +share/${DISTNAME}/vsllib/fonts.vsl +share/${DISTNAME}/vsllib/linebreak.vsl +share/${DISTNAME}/vsllib/list.vsl +share/${DISTNAME}/vsllib/slopes.vsl +share/${DISTNAME}/vsllib/std.vsl +share/${DISTNAME}/vsllib/struct.vsl +share/${DISTNAME}/vsllib/symbols.vsl +share/${DISTNAME}/vsllib/tab.vsl +share/${DISTNAME}/vsllib/tree.vsl +share/${DISTNAME}/vsllib/verbose.vsl +share/${DISTNAME}/vsllib/vsl.vsl +share/${DISTNAME}/vsllib/vsldef.vsl +share/${DISTNAME}/vsllib/vsllib.vsl share/doc/ddd/PROBLEMS share/doc/ddd/README share/doc/ddd/ddd-paper.ps.gz @@ -55,9 +55,9 @@ share/doc/ddd/ddd.ps.gz share/doc/ddd/sample.c share/doc/ddd/sample.dddinit @dirrm share/doc/ddd -@dirrm share/ddd-3.3/vsllib -@dirrm share/ddd-3.3/themes -@dirrm share/ddd-3.3/ddd -@dirrm share/ddd-3.3 +@dirrm share/${DISTNAME}/vsllib +@dirrm share/${DISTNAME}/themes +@dirrm share/${DISTNAME}/ddd +@dirrm share/${DISTNAME} @exec install-info --info-dir=%D/info %D/info/ddd-themes.info @exec install-info --info-dir=%D/info %D/info/ddd.info diff --git a/devel/ddd/pkg/SECURITY b/devel/ddd/pkg/SECURITY index 8a5c39439db..6f3bc218878 100644 --- a/devel/ddd/pkg/SECURITY +++ b/devel/ddd/pkg/SECURITY @@ -1,7 +1,6 @@ -$OpenBSD: SECURITY,v 1.1 2000/10/30 13:54:51 espie Exp $ +$OpenBSD: SECURITY,v 1.2 2003/04/10 16:51:21 sturm Exp $ -There are lots of tmpnam() warnings in ddd. -Most are temporary files that are used locally. -A few are passed off to an external gnuplot process. -Fortunately, gnuplot has no compunction about writing over -an existing file, so those can be fixed. +Temporary file handling has improved in this version, but still needs +work. It now uses mkstemp(), but because there is no way to create an +ofstream object from a file descriptor there are still race conditions. +Similarly for passing temp file names to gnuplot.