Thu Oct 22 22:01:26 2009 UTC ()
Add patch from Dennis Preiser on tin-dev.
Fixes, among others, |perl-script issues with suspending and
SIGWINCH problems.

Bump PKGREVISION.


(wiz)
diff -r1.42 -r1.43 pkgsrc/news/tin/Makefile
diff -r1.16 -r1.17 pkgsrc/news/tin/distinfo
diff -r0 -r1.3 pkgsrc/news/tin/patches/patch-ad
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-ae
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-af
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-ag
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-ah
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-ai
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-aj
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-ak
diff -r0 -r1.1 pkgsrc/news/tin/patches/patch-al

cvs diff -r1.42 -r1.43 pkgsrc/news/tin/Makefile (expand / switch to unified diff)

--- pkgsrc/news/tin/Makefile 2009/08/23 16:49:54 1.42
+++ pkgsrc/news/tin/Makefile 2009/10/22 22:01:25 1.43
@@ -1,17 +1,18 @@ @@ -1,17 +1,18 @@
1# $NetBSD: Makefile,v 1.42 2009/08/23 16:49:54 wiz Exp $ 1# $NetBSD: Makefile,v 1.43 2009/10/22 22:01:25 wiz Exp $
2# 2#
3 3
4DISTNAME= tin-1.9.4 4DISTNAME= tin-1.9.4
 5PKGREVISION= 1
5CATEGORIES= news 6CATEGORIES= news
6MASTER_SITES= ftp://ftp.tin.org/pub/news/clients/tin/unstable/ \ 7MASTER_SITES= ftp://ftp.tin.org/pub/news/clients/tin/unstable/ \
7 ftp://ftp.cs.tu-berlin.de/pub/net/news/tin/unstable/ 8 ftp://ftp.cs.tu-berlin.de/pub/net/news/tin/unstable/
8EXTRACT_SUFX= .tar.bz2 9EXTRACT_SUFX= .tar.bz2
9 10
10MAINTAINER= wiz@NetBSD.org 11MAINTAINER= wiz@NetBSD.org
11HOMEPAGE= http://www.tin.org/ 12HOMEPAGE= http://www.tin.org/
12COMMENT= TIN newsreader (termcap based) 13COMMENT= TIN newsreader (termcap based)
13# See src/nntplib.c, vms/vms.c 14# See src/nntplib.c, vms/vms.c
14LICENSE= tin-license 15LICENSE= tin-license
15 16
16RESTRICTED= Profit from use, sale, trade, or reproduction disallowed 17RESTRICTED= Profit from use, sale, trade, or reproduction disallowed
17NO_SRC_ON_CDROM= ${RESTRICTED} 18NO_SRC_ON_CDROM= ${RESTRICTED}

cvs diff -r1.16 -r1.17 pkgsrc/news/tin/distinfo (expand / switch to unified diff)

--- pkgsrc/news/tin/distinfo 2009/07/22 10:53:51 1.16
+++ pkgsrc/news/tin/distinfo 2009/10/22 22:01:25 1.17
@@ -1,8 +1,17 @@ @@ -1,8 +1,17 @@
1$NetBSD: distinfo,v 1.16 2009/07/22 10:53:51 wiz Exp $ 1$NetBSD: distinfo,v 1.17 2009/10/22 22:01:25 wiz Exp $
2 2
3SHA1 (tin-1.9.4.tar.bz2) = e1f5ff2f04923137f43119b144f8a20e733eea23 3SHA1 (tin-1.9.4.tar.bz2) = e1f5ff2f04923137f43119b144f8a20e733eea23
4RMD160 (tin-1.9.4.tar.bz2) = 6a85e47ea06f2e86f2b8f688df137432ecb7c4e9 4RMD160 (tin-1.9.4.tar.bz2) = 6a85e47ea06f2e86f2b8f688df137432ecb7c4e9
5Size (tin-1.9.4.tar.bz2) = 1526534 bytes 5Size (tin-1.9.4.tar.bz2) = 1526534 bytes
6SHA1 (patch-aa) = a3d40ff4e38230bcf8a3814c92ec2a75f85bf44e 6SHA1 (patch-aa) = a3d40ff4e38230bcf8a3814c92ec2a75f85bf44e
7SHA1 (patch-ab) = 34794d259ae4fb81888184ded9876ab5874d8731 7SHA1 (patch-ab) = 34794d259ae4fb81888184ded9876ab5874d8731
8SHA1 (patch-ac) = b5e72a659414833db5f18c2e8f3404dadd03f87f 8SHA1 (patch-ac) = b5e72a659414833db5f18c2e8f3404dadd03f87f
 9SHA1 (patch-ad) = 598a9e287a343eff866ac95d89ed7724eb364c0c
 10SHA1 (patch-ae) = 558deb467d7c3c423d4982952a736a501c906355
 11SHA1 (patch-af) = c71cfb049312ac4931bb2d488623aa249d255486
 12SHA1 (patch-ag) = 6885a9a8444129288207904084963705fb60aaea
 13SHA1 (patch-ah) = bac7062665d7351f88081d8582110c079d828228
 14SHA1 (patch-ai) = d956f88aff41969e25857af60b04e92c055fb8d2
 15SHA1 (patch-aj) = db18012097b3f7fbc1108c1ec530658dc2d3ff1d
 16SHA1 (patch-ak) = 746c6edfef424e8ccfd93f945e51eea4b93f4f1c
 17SHA1 (patch-al) = f17d06620d7556f90cd72de443ac27fe91604896

File Added: pkgsrc/news/tin/patches/Attic/patch-ad
$NetBSD: patch-ad,v 1.3 2009/10/22 22:01:26 wiz Exp $

--- include/proto.h.orig	2009-01-25 19:59:14.000000000 +0100
+++ include/proto.h
@@ -503,6 +503,7 @@ extern t_bool prompt_option_string(enum 
 extern t_bool prompt_string(const char *prompt, char *buf, int which_hist);
 extern void prompt_continue(void);
 extern void prompt_slk_redraw(void);
+extern void prompt_yn_redraw(void);
 
 /* read.c */
 extern char *tin_fgets(FILE *fp, t_bool header);

File Added: pkgsrc/news/tin/patches/Attic/patch-ae
$NetBSD: patch-ae,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- include/tcurses.h.orig	2008-12-30 20:27:28.000000000 +0100
+++ include/tcurses.h
@@ -95,6 +95,7 @@
 #		define HpGlitch(func)			/*nothing*/
 
 extern int cmdReadCh(void);
+extern int cmd_get_arrow_key(int prech);
 extern char *screen_contents(int row, int col, char *buffer);
 extern void MoveCursor(int row, int col);
 extern void my_erase(void);

File Added: pkgsrc/news/tin/patches/Attic/patch-af
$NetBSD: patch-af,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- include/tin.h.orig	2009-02-10 18:10:02.000000000 +0100
+++ include/tin.h
@@ -98,7 +98,7 @@
 #include	<signal.h>
 
 enum context { cMain, cArt, cConfig, cFilter, cGroup, cHelp, cInfopager, cPage, cSelect, cThread };
-enum icontext { cNone, cGetline, cPromptSLK };
+enum icontext { cNone, cGetline, cPromptCONT, cPromptSLK, cPromptYN };
 enum resizer { cNo, cYes, cRedraw };
 enum rc_state { RC_IGNORE, RC_CHECK, RC_UPGRADE, RC_DOWNGRADE, RC_ERROR };
 

File Added: pkgsrc/news/tin/patches/Attic/patch-ag
$NetBSD: patch-ag,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- src/curses.c.orig	2008-12-30 20:26:23.000000000 +0100
+++ src/curses.c
@@ -32,6 +32,7 @@
 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE) && defined(M_UNIX)
 #	define ReadWch cmdReadWch
 #endif /* MULTIBYTE_ABLE && !NO_LOCALE && M_UNIX */
+#define get_arrow_key cmd_get_arrow_key
 
 void my_dummy(void) { }	/* ANSI C requires non-empty file */
 t_bool have_linescroll = TRUE;	/* USE_CURSES always allows line scrolling */
@@ -920,6 +921,7 @@ word_highlight_string(
 			tputs(_reset, 1, outchar);
 	stow_cursor();
 }
+#endif /* USE_CURSES */
 
 
 /*
@@ -1142,7 +1144,6 @@ get_arrow_key(
 			return KEYMAP_UNKNOWN;
 	}
 }
-#endif /* USE_CURSES */
 
 
 /*

File Added: pkgsrc/news/tin/patches/Attic/patch-ah
$NetBSD: patch-ah,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- src/feed.c.orig	2008-12-30 20:26:23.000000000 +0100
+++ src/feed.c
@@ -607,8 +607,10 @@ feed_articles(
 			EndWin(); /* Turn off curses/windowing */
 			Raw(FALSE);
 			fflush(stdout);
+			set_signal_catcher(FALSE);
 			if ((pipe_fp = popen(tinrc.default_pipe_command, "w")) == NULL) {
 				perror_message(_(txt_command_failed), tinrc.default_pipe_command);
+				set_signal_catcher(TRUE);
 				Raw(TRUE);
 				InitWin();
 				return;
@@ -846,6 +848,7 @@ got_sig_pipe_while_piping:
 			got_sig_pipe = FALSE;
 			fflush(pipe_fp);
 			(void) pclose(pipe_fp);
+			set_signal_catcher(TRUE);
 			Raw(TRUE);
 			InitWin();
 			prompt_continue();

File Added: pkgsrc/news/tin/patches/Attic/patch-ai
$NetBSD: patch-ai,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- src/nntplib.c.orig	2009-02-09 11:03:19.000000000 +0100
+++ src/nntplib.c
@@ -888,6 +888,10 @@ get_server(
 	 *       leave the s_gets() in that case)
 	 */
 	while (nntp_rd_fp == NULL || s_gets(string, size, nntp_rd_fp) == NULL) {
+		if (errno == EINTR) {
+			errno = 0;
+			continue;
+		}
 		if (quitting)						/* Don't bother to reconnect */
 			tin_done(NNTP_ERROR_EXIT);		/* And don't try to disconnect again! */
 

File Added: pkgsrc/news/tin/patches/Attic/patch-aj
$NetBSD: patch-aj,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- src/prompt.c.orig	2009-01-23 16:10:39.000000000 +0100
+++ src/prompt.c
@@ -44,6 +44,7 @@
 
 
 static char *prompt_slk_message;	/* prompt message for prompt_slk_redraw */
+static char *prompt_yn_message;
 
 /*
  * Local prototypes
@@ -163,7 +164,7 @@ prompt_yn(
 {
 	char *keyprompt;
 	char keyno[MAXKEYLEN], keyyes[MAXKEYLEN];
-	int keyyes_len = 0, keyno_len = 0, maxlen;
+	int keyyes_len = 0, keyno_len = 0, maxlen, prompt_len;
 	t_function func;
 #if defined (MULTIBYTE_ABLE) && !defined(NO_LOCALE)
 	wint_t yes, no, prompt_ch, ch;
@@ -194,21 +195,17 @@ prompt_yn(
 	keyno_len = (int) strlen(keyno);
 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
 	maxlen = MAX(keyyes_len, keyno_len);
+	prompt_len = (int) strlen(prompt) + keyyes_len + keyno_len + maxlen + 6;
+	prompt_yn_message = my_malloc(prompt_len + 1);
+
+	input_context = cPromptYN;
 
 	do {
 		prompt_ch = (default_answer ? yes : no);
 		keyprompt = (default_answer ? keyyes : keyno);
 
-		if (!cmd_line) {
-			MoveCursor(cLINES, 0);
-			CleartoEOLN();
-		}
-		my_printf("%s (%s/%s) %-*s", prompt, keyyes, keyno, maxlen, keyprompt);
-		if (!cmd_line)
-			cursoron();
-		my_flush();
-		if (!cmd_line)
-			MoveCursor(cLINES, (int) strlen(prompt) + keyyes_len + keyno_len + 5);
+		snprintf(prompt_yn_message, prompt_len, "%s (%s/%s) %-*s", prompt, keyyes, keyno, maxlen, keyprompt);
+		prompt_yn_redraw();
 
 #if defined (MULTIBYTE_ABLE) && !defined(NO_LOCALE)
 		if (((ch = ReadWch()) == '\n') || (ch == '\r'))
@@ -248,6 +245,9 @@ prompt_yn(
 		func = key_to_func(ch, prompt_keys);
 	} while (func == NOT_ASSIGNED);
 
+	input_context = cNone;
+	FreeAndNull(prompt_yn_message);
+
 	if (!cmd_line) {
 		clear_message();
 		my_flush();
@@ -256,6 +256,24 @@ prompt_yn(
 }
 
 
+/* (Re)draws the prompt message for prompt_yn() */
+void
+prompt_yn_redraw(
+	void)
+{
+	if (!cmd_line) {
+		MoveCursor(cLINES, 0);
+		CleartoEOLN();
+	}
+	my_printf("%s", prompt_yn_message);
+	if (!cmd_line)
+		cursoron();
+	my_flush();
+	if (!cmd_line)
+		MoveCursor(cLINES, (int) strlen(prompt_yn_message) -1);
+}
+
+
 /*
  * help_text is displayed near the bottom of the screen.
  * var is an index into a list containing size elements.
@@ -745,11 +763,14 @@ prompt_continue(
 	void)
 {
 	int ch;
+	int save_signal_context = signal_context;
 
 #ifdef USE_CURSES
 	cmd_line = TRUE;
 #endif /* USE_CURSES */
 	info_message(_(txt_return_key));
+	signal_context = cMain;
+	input_context = cPromptCONT;
 
 	switch ((ch = ReadCh())) {
 		case ESC:
@@ -763,6 +784,10 @@ prompt_continue(
 			break;
 	}
 
+	input_context = cNone;
+	signal_context = save_signal_context;
+	my_fputc('\n', stdout);
+
 #ifdef USE_CURSES
 	cmd_line = FALSE;
 	my_retouch();

File Added: pkgsrc/news/tin/patches/Attic/patch-ak
$NetBSD: patch-ak,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- src/signal.c.orig	2008-12-30 20:26:25.000000000 +0100
+++ src/signal.c
@@ -104,6 +104,8 @@ int need_resize = cNo;
  */
 int NOTESLINES;
 
+static t_bool redraw_after_suspend;
+
 
 #ifndef __LCLINT__ /* lclint doesn't like it */
 static const struct {
@@ -268,7 +270,7 @@ handle_resize(
 	switch (signal_context) {
 		case cArt:
 			ClearScreen();
-			show_art_msg(curr_group->name);
+			show_art_msg(CURR_GROUP.name);
 			break;
 
 		case cConfig:
@@ -303,14 +305,24 @@ handle_resize(
 			gl_redraw();
 			break;
 
+		case cPromptCONT:
+			if (redraw_after_suspend)
+				info_message(_(txt_return_key));
+			break;
+
 		case cPromptSLK:
 			prompt_slk_redraw();
 			break;
 
+		case cPromptYN:
+			prompt_yn_redraw();
+			break;
+
 		default:
 			break;
 	}
 	my_fflush(stdout);
+	redraw_after_suspend = FALSE;
 #endif /* SIGWINCH || SIGTSTP */
 }
 
@@ -320,22 +332,34 @@ static void
 handle_suspend(
 	void)
 {
+	t_bool save_cmd_line = cmd_line;
+	t_bool save_state = (!batch_mode || !cmd_line);
+
 	TRACE(("handle_suspend(%d)", signal_context));
 
 	set_keypad_off();
 	if (!cmd_line)
 		set_xclick_off();
 
-	Raw(FALSE);
+	if (save_state) {
+		EndWin();
+		Raw(FALSE);
+	}
+
 	wait_message(0, _(txt_suspended_message), tin_progname);
 
 	kill(0, SIGSTOP);				/* Put ourselves to sleep */
 
 	RESTORE_HANDLER(SIGTSTP, signal_handler);
 
-	if (!batch_mode) {
+	if (save_state) {
 		Raw(TRUE);
+		InitWin();
+		cmd_line = save_cmd_line;
+		if (!cmd_line)
+			my_retouch();
 		need_resize = cRedraw;		/* Flag a redraw */
+		redraw_after_suspend = TRUE;
 	}
 	set_keypad_on();
 	if (!cmd_line)

File Added: pkgsrc/news/tin/patches/Attic/patch-al
$NetBSD: patch-al,v 1.1 2009/10/22 22:01:26 wiz Exp $

--- src/tcurses.c.orig	2008-12-30 20:26:25.000000000 +0100
+++ src/tcurses.c
@@ -896,72 +896,77 @@ get_arrow_key(
 #	ifdef NCURSES_MOUSE_VERSION
 	MEVENT my_event;
 #	endif /* NCURSES_MOUSE_VERSION */
-	int ch = getch();
+	int ch;
 	int code = KEYMAP_UNKNOWN;
 
-	switch (ch) {
-		case KEY_DC:
-			code = KEYMAP_DEL;
-			break;
-
-		case KEY_IC:
-			code = KEYMAP_INS;
-			break;
-
-		case KEY_UP:
-			code = KEYMAP_UP;
-			break;
-
-		case KEY_DOWN:
-			code = KEYMAP_DOWN;
-			break;
-
-		case KEY_LEFT:
-			code = KEYMAP_LEFT;
-			break;
-
-		case KEY_RIGHT:
-			code = KEYMAP_RIGHT;
-			break;
-
-		case KEY_NPAGE:
-			code = KEYMAP_PAGE_DOWN;
-			break;
-
-		case KEY_PPAGE:
-			code = KEYMAP_PAGE_UP;
-			break;
-
-		case KEY_HOME:
-			code = KEYMAP_HOME;
-			break;
-
-		case KEY_END:
-			code = KEYMAP_END;
-			break;
+	if (cmd_line)
+		code = cmd_get_arrow_key(prech);
+	else {
+		ch = getch();
+		switch (ch) {
+			case KEY_DC:
+				code = KEYMAP_DEL;
+				break;
+
+			case KEY_IC:
+				code = KEYMAP_INS;
+				break;
+
+			case KEY_UP:
+				code = KEYMAP_UP;
+				break;
+
+			case KEY_DOWN:
+				code = KEYMAP_DOWN;
+				break;
+
+			case KEY_LEFT:
+				code = KEYMAP_LEFT;
+				break;
+
+			case KEY_RIGHT:
+				code = KEYMAP_RIGHT;
+				break;
+
+			case KEY_NPAGE:
+				code = KEYMAP_PAGE_DOWN;
+				break;
+
+			case KEY_PPAGE:
+				code = KEYMAP_PAGE_UP;
+				break;
+
+			case KEY_HOME:
+				code = KEYMAP_HOME;
+				break;
+
+			case KEY_END:
+				code = KEYMAP_END;
+				break;
 
 #	ifdef NCURSES_MOUSE_VERSION
-		case KEY_MOUSE:
-			if (getmouse(&my_event) != ERR) {
-				switch ((int) my_event.bstate) {
-					case BUTTON1_CLICKED:
-						xmouse = MOUSE_BUTTON_1;
-						break;
-
-					case BUTTON2_CLICKED:
-						xmouse = MOUSE_BUTTON_2;
-						break;
-
-					case BUTTON3_CLICKED:
-						xmouse = MOUSE_BUTTON_3;
-						break;
+			case KEY_MOUSE:
+				if (getmouse(&my_event) != ERR) {
+					switch ((int) my_event.bstate) {
+						case BUTTON1_CLICKED:
+							xmouse = MOUSE_BUTTON_1;
+							break;
+
+						case BUTTON2_CLICKED:
+							xmouse = MOUSE_BUTTON_2;
+							break;
+
+						case BUTTON3_CLICKED:
+							xmouse = MOUSE_BUTTON_3;
+							break;
+					}
+					xcol = my_event.x;	/* column */
+					xrow = my_event.y;	/* row */
+					code = KEYMAP_MOUSE;
 				}
-				xcol = my_event.x;	/* column */
-				xrow = my_event.y;	/* row */
-				code = KEYMAP_MOUSE;
-			}
-			break;
+				break;
 #	endif /* NCURSES_MOUSE_VERSION */
+		}
 	}
 	return code;
 }