NetBSD Problem Report #44284

From www@NetBSD.org  Tue Dec 28 00:42:05 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 62C4E63B89F
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 28 Dec 2010 00:42:05 +0000 (UTC)
Message-Id: <20101228004205.3AE8663B89A@www.NetBSD.org>
Date: Tue, 28 Dec 2010 00:42:05 +0000 (UTC)
From: nol888@gmail.com
Reply-To: nol888@gmail.com
To: gnats-bugs@NetBSD.org
Subject: tirc compilation fix on DragonflyBSD
X-Send-Pr-Version: www-1.0

>Number:         44284
>Category:       pkg
>Synopsis:       tirc compilation fix on DragonflyBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 28 00:45:00 +0000 2010
>Closed-Date:    Tue Dec 28 08:26:33 +0000 2010
>Last-Modified:  Tue Dec 28 08:30:02 +0000 2010
>Originator:     Nolan Lum
>Release:        DragonflyBSD v2.8.2
>Organization:
>Environment:
DragonFly  2.8-RELEASE DragonFly v2.8.2-RELEASE #3: Fri Oct 29 08:00:40 PDT 2010     root@test29.backplane.com:/usr/obj/usr/src-misc/sys/X86_64_GENERIC  x86_64
>Description:
The tirc package in pkgsrc contains code that utilizes CIRCLEQ, a queue that was removed in FreeBSD and DragonFlyBSD. I've included a patch that changes all uses of CIRCLEQ to the equivalent TAILQ, as use of CIRCLEQ is not recommended anyway.

--
Package description: tirc is another IRC client.  It has support for vi-like editor line and general usage, nickname completion, ANSI-colors, flood protection and many more.
>How-To-Repeat:

>Fix:
From 19fa8ee76f063969400a5c4db32090cbc110df72 Mon Sep 17 00:00:00 2001
From: Nolan Lum <nol888@gmail.com>
Date: Mon, 27 Dec 2010 17:51:31 -0500
Subject: [PATCH] Fix compilation of tirc

---
 chat/tirc/distinfo         |    2 +-
 chat/tirc/patches/patch-ad |  179 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 177 insertions(+), 4 deletions(-)

diff --git a/chat/tirc/distinfo b/chat/tirc/distinfo
index c036872..adc69ff 100644
--- a/chat/tirc/distinfo
+++ b/chat/tirc/distinfo
@@ -6,7 +6,7 @@ Size (tirc-1.2.tar.gz) = 300089 bytes
 SHA1 (patch-aa) = e47e007f827c3453e9a3944ede6b2aba4ae6b9ed
 SHA1 (patch-ab) = 012837ad61d2790fb00f8c621da10e912029bb86
 SHA1 (patch-ac) = 048f33969cca99f80e9f63401dab95ca1ee247bf
-SHA1 (patch-ad) = 9cfae360117275d08df46468308d895f353cbf83
+SHA1 (patch-ad) = e0bb2be3e25a36a525a6cd51e46b049c71b6379e
 SHA1 (patch-ae) = ab0a0da6a47ffc12ac81bce0aa45c20f05372a46
 SHA1 (patch-af) = 649f4b57ff56bc297f33a0511c6b11bb0016ef73
 SHA1 (patch-ag) = 34cfac73b5438ff108f96e57a4196994d50e0a23
diff --git a/chat/tirc/patches/patch-ad b/chat/tirc/patches/patch-ad
index 6316acf..c6d358c 100644
--- a/chat/tirc/patches/patch-ad
+++ b/chat/tirc/patches/patch-ad
@@ -1,8 +1,8 @@
 $NetBSD$

---- screen.c.orig	2005-12-15 22:53:30.000000000 +0000
+--- screen.c.orig	1999-02-22 16:52:34 -0500
 +++ screen.c
-@@ -36,6 +36,7 @@ static char rcsid[] = "$Id: screen.c,v 1
+@@ -36,6 +36,7 @@
  #elif defined(HAVE_LIBGEN_H)
  #include <libgen.h>
  #endif
@@ -10,7 +10,25 @@ $NetBSD$

  #include "compat.h"
  #include "tty.h"
-@@ -109,7 +110,6 @@ extern char	*myname, nick[], *srvnm;
+@@ -66,7 +67,7 @@
+ struct ircpage {
+ 	struct ircwin	*ipg_iwa;
+ 	struct ircwin	*ipg_iwc;
+-	CIRCLEQ_ENTRY(ircpage) ipg_entries;
++	TAILQ_ENTRY(ircpage) ipg_entries;
+ 	int		ipg_upd;
+ }; 
+ 
+@@ -99,7 +100,7 @@
+ static int	dodisplay;	/* if 0, window updates and clock won't be
+ 				 * displayed (for example when in opt editor */
+ 
+-CIRCLEQ_HEAD(, ircpage)	pages_head;
++TAILQ_HEAD(, ircpage)	pages_head;
+ 
+ #define	IW_USED		1
+ #define IW_VISIBLE	2
+@@ -109,7 +110,6 @@
  extern void	(*othercmd) __P((char *));
  extern int	on_irc;
  extern int	umd;
@@ -18,3 +36,158 @@ $NetBSD$
  extern int	is_away;

  char		*prompt;
+@@ -167,7 +167,7 @@
+ 	tty_gotoxy(0, 0);
+ 	tty_flush();
+ 
+-	CIRCLEQ_INIT(&pages_head);
++	TAILQ_INIT(&pages_head);
+ 	cpage = NULL;
+ 	cpageno = 0;
+ 	otherpage = 0;
+@@ -307,8 +307,8 @@
+ 	}
+ 
+ 	/* Else try the other pages */
+-	for (ipg = pages_head.cqh_first; ipg != (struct ircpage *)&pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next) {
++	for (ipg = pages_head.tqh_first; ipg != (struct ircpage *)&pages_head;
++	    ipg = ipg->ipg_entries.tqe_next) {
+ 	    ipg_switchtopg(ipg);
+ 
+ 	    /*
+@@ -656,9 +656,9 @@
+ 	struct channel *ch;
+ 	struct ircpage *ipg, *savepg = cpage;
+ 
+-	for (ipg = pages_head.cqh_first;
++	for (ipg = pages_head.tqh_first;
+ 	    ipg != (struct ircpage *) &pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next) {
++	    ipg = ipg->ipg_entries.tqe_next) {
+ 	    ipg_switchtopg(ipg);
+ 	    /*
+ 	     * Traverse the window list. For each window, iterate through
+@@ -987,8 +987,8 @@
+ {
+ 	struct ircpage *ipg, *savepg = cpage;
+ 
+-	for (ipg = pages_head.cqh_first; ipg != (struct ircpage *)&pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next) {
++	for (ipg = pages_head.tqh_first; ipg != (struct ircpage *)&pages_head;
++	    ipg = ipg->ipg_entries.tqe_next) {
+ 		ipg_switchtopg(ipg);
+ 		equalwin();
+ 	}
+@@ -1099,8 +1099,8 @@
+ 	strcpy(t, cname);
+ 	h = elf_hash(irc_strupr(t));
+ 
+-	for (ipg = pages_head.cqh_first; ipg != (struct ircpage *) &pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next) {
++	for (ipg = pages_head.tqh_first; ipg != (struct ircpage *) &pages_head;
++	    ipg = ipg->ipg_entries.tqe_next) {
+ 		ipg_switchtopg(ipg);
+ 
+ 		w = iwa;
+@@ -2163,8 +2163,8 @@
+ 	struct ircwin *iw;
+ 	struct ircpage *ipg;
+ 
+-	for (ipg = pages_head.cqh_first; ipg != (struct ircpage *) &pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next)
++	for (ipg = pages_head.tqh_first; ipg != (struct ircpage *) &pages_head;
++	    ipg = ipg->ipg_entries.tqe_next)
+ 		for (iw = ipg->ipg_iwa; iw != NULL; iw = iw->iw_next)
+ 			reformat_backscroll(iw, t_columns);
+ }
+@@ -2197,7 +2197,7 @@
+ 	ipg->ipg_iwa = iwa;
+ 	ipg->ipg_iwc = iwc;
+ 	ipg->ipg_upd = 0;
+-	CIRCLEQ_INSERT_TAIL(&pages_head, ipg, ipg_entries);
++	TAILQ_INSERT_TAIL(&pages_head, ipg, ipg_entries);
+ 	otherpage = cpageno;
+ 	cpageno = numpages++;
+ 	set_prompt(NULL);
+@@ -2214,10 +2214,10 @@
+ 	int newpg;
+ 
+ 	if (iwa == NULL || (iwa->iw_next == NULL && iwa->iw_ch == NULL)) {
+-		if (ipg->ipg_entries.cqe_prev !=
++		if (*(ipg->ipg_entries.tqe_prev) !=
+ 		    (struct ircpage *) &pages_head)
+ 			newpg = cpageno - 1;
+-		else if (ipg->ipg_entries.cqe_next !=
++		else if (ipg->ipg_entries.tqe_next !=
+ 		    (struct ircpage *) &pages_head)
+ 			newpg = cpageno + 1;
+ 		else {
+@@ -2235,7 +2235,7 @@
+ 		}
+ 
+ 		ipg_switchto(newpg, 1);
+-		CIRCLEQ_REMOVE(&pages_head, ipg, ipg_entries);
++		TAILQ_REMOVE(&pages_head, ipg, ipg_entries);
+ 		free(ipg);
+ 		numpages--;
+ 		set_prompt(NULL);
+@@ -2256,9 +2256,9 @@
+ 	struct ircpage *ipg;
+ 	int pns = pageno;
+ 
+-	for (ipg = pages_head.cqh_first;
++	for (ipg = pages_head.tqh_first;
+ 	    ipg != (struct ircpage *) &pages_head && pageno > 0;
+-	    ipg = ipg->ipg_entries.cqe_next, pageno--)
++	    ipg = ipg->ipg_entries.tqe_next, pageno--)
+ 		;
+ 	if (pageno == 0 && ipg != (struct ircpage *) &pages_head) {
+ 		ipg_switchtopg(ipg);
+@@ -2312,9 +2312,9 @@
+ 
+ 	pline[0] = 0;
+ 
+-	for (i = 0, ipg = pages_head.cqh_first; i < numpages &&
++	for (i = 0, ipg = pages_head.tqh_first; i < numpages &&
+ 	    ipg != (struct ircpage *) &pages_head;
+-	    i++, ipg = ipg->ipg_entries.cqe_next) {
++	    i++, ipg = ipg->ipg_entries.tqe_next) {
+ 		if (ipg != cpage)
+ 			sprintf(t, "-%d-", i);
+ 		else
+@@ -2352,9 +2352,9 @@
+ 	struct ircpage *ipg;
+ 	int i, n = 1;
+ 	
+-	for (i = 0, ipg = pages_head.cqh_first;
++	for (i = 0, ipg = pages_head.tqh_first;
+ 	    ipg != (struct ircpage *) &pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next, i++)
++	    ipg = ipg->ipg_entries.tqe_next, i++)
+ 		if (ipg->ipg_upd)
+ 			pglist[n++] = i + '0';
+ 	if (n > 1) {
+@@ -2378,9 +2378,9 @@
+ 	struct ircpage *ipg;
+ 	int i;
+ 	
+-	for (i = 0, ipg = pages_head.cqh_first;
++	for (i = 0, ipg = pages_head.tqh_first;
+ 	    ipg != (struct ircpage *) &pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next, i++)
++	    ipg = ipg->ipg_entries.tqe_next, i++)
+ 		if (ipg->ipg_upd)
+ 			pupd |= 1 << i;
+ 	if (force_update)
+@@ -2434,8 +2434,8 @@
+ 	struct ircwin *w;
+ 	struct channel *ch;
+ 
+-	for (ipg = pages_head.cqh_first; ipg != (struct ircpage *)&pages_head;
+-	    ipg = ipg->ipg_entries.cqe_next)
++	for (ipg = pages_head.tqh_first; ipg != (struct ircpage *)&pages_head;
++	    ipg = ipg->ipg_entries.tqe_next)
+ 	    	for (w = iwa; w != NULL && w->iw_flags & IW_USED;
+ 		    w = w->iw_next)
+ 			for (ch = w->iw_ch; ch != NULL; ch = ch->ch_wnext)
-- 
1.7.0.7

>Release-Note:

>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44284: tirc compilation fix on DragonflyBSD
Date: Tue, 28 Dec 2010 15:55:11 +0900

 Did you test run, or just try to build?
 For me, dumped core both NetBSD-5.1-i386 and DraognFly-2.8.2-x86_64.

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44284: tirc compilation fix on DragonflyBSD
Date: Tue, 28 Dec 2010 16:11:02 +0900

 On Tue, 28 Dec 2010 16:00:07 +0900, OBATA Akio <obache@netbsd.org> wrote:

 >  Did you test run, or just try to build?
 >  For me, dumped core both NetBSD-5.1-i386 and DraognFly-2.8.2-x86_64.

 Probably, need to for loop style, until pakges_head is CIRCLEQ style?

 -- 
 OBATA Akio / obache@NetBSD.org

From: Nolan L <nol888@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44284: tirc compilation fix on DragonflyBSD
Date: Tue, 28 Dec 2010 02:16:37 -0500

 --0016e65b52a6bcfc160498733b52
 Content-Type: text/plain; charset=UTF-8

 I thought I fixed that, but yes, I forgot to correct the for loop style. I
 will substitute the correct macros and attach the new files in a uuencoded
 tar.

 --0016e65b52a6bcfc160498733b52
 Content-Type: text/html; charset=UTF-8

 I thought I fixed that, but yes, I forgot to correct the for loop style. I will substitute the correct macros and attach the new files in a uuencoded tar.<br>

 --0016e65b52a6bcfc160498733b52--

From: Nolan L <nol888@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44284: tirc compilation fix on DragonflyBSD
Date: Tue, 28 Dec 2010 02:36:52 -0500

 This version compiles and runs.

 begin 644 tirc.tar.gz
 M'XL(`/22&4T``^U9;7/;-A+N5^I7[/G21&^T`;[33C)Q$MU%,Z[;VF[NI7?#
 M`4%0XE0F58JRXC;Y[[<`J-=8JMNS>],;X8,I`KN+Q;,/%@NZRDI^-&85'XJ)
 M?IHL^>)A&R'$<QR03VR;3VKY/@%*7>+9E.([$.I2Q_D"R`/[<6>;3BI6HBME
 M452[Y&9#(48[QC<7]P=I3\Y%]?KR[9-&PS1-F/!2B/R0'Q9E-C!H&(8FL4S+
 M`NH=N]:Q[8!)7$(:G4YG(=MX]0I,V^MZT,&_/KQZU8`_BU&60B+2+!=)\]WI
 M^UYTUG_]U]YY]*Z%HUG.1]-$P/-1%@_0QO"E5,F3+&UTEH.B+/-"C:VH'/#B
 M&FEZ.#Q8[:RJ6]DC/?&D#QW/KSV95.645X`L'[.!@)\;8"R[9EENM+/Q(,IF
 M[&3;"#]IF,:;_L6;L]ZW4>_\ZN(?S=I:"Z2$R*LR$Y.31L>X.NV?[98!(\LK
 MPY!]TW&"[Y].<'7*\3"4CN,&6'C.JHR#E$^*))N,1^SVQ#AJ`R)+NH`>)L4,
 MT`JKQ`18G@`?%?P'F!7YLPIB@7-A@S;4NB*!9EJ4(#ZPZ_%(`!(Z1^M0C"L0
 M25;A4/L(?3'G:WW7.WW;[,ZA:QGR[R0:"H9^=_12MXO`"UB*1/WS_E7_]*S_
 MS]Y%<RG3.E&AU30Q^G^+OKOLO34,NN@#['O?O^R_/NL9E@*)$HT2)<@WB9+X
 M4(DRAYLB2XQFNZB&HN3720NBZ)MFDP\9+JHEYZGE))I%'J'#ZWW3:UR4N=*A
 MR+<NDTTB-L,82*>E9<-HCTMD8W6B75.<Z]`%]0QD930HJN+#;1,#1J0;JB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CP-]::255*,::)H#8-+>%@+DE2+P@\D@34
 H9YA3T%[H"M]K_/*^V+=]V[=]V[=]V[=]V[=]^W]L_P'8:A\``"@`````
 `
 end

State-Changed-From-To: open->closed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Tue, 28 Dec 2010 08:26:33 +0000
State-Changed-Why:
Commited.  Thanks you!


From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44284 CVS commit: pkgsrc/chat/tirc
Date: Tue, 28 Dec 2010 08:25:21 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Tue Dec 28 08:25:20 UTC 2010

 Modified Files:
 	pkgsrc/chat/tirc: Makefile distinfo
 	pkgsrc/chat/tirc/patches: patch-ad

 Log Message:
 Use TAILQ instead of CIRCLEQ, it is not recommended anyway and it was removed in
 FreeBSD and DragonFly.
 Patch provided by Nolan Lum via PR#44284

 Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16 -r1.17 pkgsrc/chat/tirc/Makefile
 cvs rdiff -u -r1.4 -r1.5 pkgsrc/chat/tirc/distinfo
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/chat/tirc/patches/patch-ad

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.