Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 2002 20:07:17 +0200
From:      Thomas Seck <tmseck@netcologne.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/36587: news/inn{-stable} do not install when --enable-tagged-hash is configured
Message-ID:  <20020331180716.GA42978@laurel.seck.home>

next in thread | raw e-mail | index | archive | help

>Number:         36587
>Category:       ports
>Synopsis:       news/inn{-stable} do not install when --enable-tagged-hash is configured
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 31 10:10:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Seck
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
private site in Germany
>Environment:
FreeBSD 4.5-STABLE

>Description:
In the post-install target, the news/inn{-stable} port initializes the
INN history databases using the 'makedbz(8) -i' command and renames the
resulting files afterwards. There is no check done whether the files
that are to be renamed really exist so the for loop will exit ungracefully
when a nonexistent file is to be moved and the installation fails.

When INN is built with the --enable-tagged-hash option, 'makedbz(8)
-i' does not create the files 'history.n.index' and 'history.n.hash'.
Instead, a file 'history.n.pag' will be created. As far as I can
see (I am an INN novice user) this is not documented anywhere. Due to
this behaviour of makedbz(8), 'make install' of the inn ports will fail
because the shell script which is run in the post-install target cannot
rename 'history.n.{hash,index}' to 'history.{hash,index}'.

Additionally, the current pkg-plists are only correct when these ports
are built without "tagged hash".

>How-To-Repeat:
Add --enable-tagged-hash to CONFIGURE_ARGS (and comment out
--with-largefiles, these options are not compatible with each other) and
do a 'make install'.

>Fix:
I suggest the following patches to the appropriate Makefiles and
pkg-plist files. I added a knob WITH_TAGGED_HASH for those who want to
use this feature.

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/news/inn/Makefile,v
retrieving revision 1.50
diff -u -r1.50 Makefile
--- Makefile	7 Nov 2001 09:01:11 -0000	1.50
+++ Makefile	31 Mar 2002 16:30:08 -0000
@@ -32,14 +32,19 @@
 CONFIGURE_ARGS+=	--with-log-dir=${INN_NEWSLOG}
 CONFIGURE_ARGS+=	--with-perl
 CONFIGURE_ARGS+=	--with-tmp-path=${INN_NEWSSPOOL}/tmp
+.if !defined(WITH_TAGGED_HASH)
+# You cannot use --with-largefiles in conjunction with --enable-tagged-hash
 CONFIGURE_ARGS+=	--with-largefiles
+.endif
 CONFIGURE_ARGS+=	--with-openssl
 
 # Various Options. See ${WRKSRC}/INSTALL for details
 
+.if defined(WITH_TAGGED_HASH)
 # Use tagged hash table for the history database. Uses much less memory but
 # is somewhat slower
-#CONFIGURE_ARGS+=	--enable-tagged-hash
+CONFIGURE_ARGS+=	--enable-tagged-hash
+.endif
 
 MAN1=	ckpasswd.1 convdate.1 fastrm.1 getlist.1 grephistory.1 inews.1 \
 	innconfval.1 innfeed.1 innmail.1 nntpget.1 rnews.1 shlock.1 \
@@ -65,6 +70,18 @@
 
 INN_INCLUDES=	clibrary.h config.h configdata.h dbz.h libinn.h storage.h
 
+.if defined(WITH_TAGGED_HASH)
+# makedbz(8) will create different dbz files when --enable-tagged-hash is set
+# so adjust pkg-plist and the list of db files accordingly:
+DBZ_FILES=	dir pag
+PLIST_SUB=	SUB_WITH_TAGGED_HASH=""
+PLIST_SUB+=	SUB_WITHOUT_TAGGED_HASH="@comment "
+.else
+DBZ_FILES=	dir hash index
+PLIST_SUB=	SUB_WITH_TAGGED_HASH="@comment "
+PLIST_SUB+=	SUB_WITHOUT_TAGGED_HASH=""
+.endif
+
 pre-install:
 	${MKDIR} ${INN_NEWSSPOOL}
 
@@ -78,7 +95,7 @@
 	    ${CHMOD} 644 history ; \
 	    ${CHOWN} news:news history ; \
 	    su -fm news -c "../bin/makedbz -i" ; \
-	    for s in dir hash index ; do \
+	    for s in ${DBZ_FILES} ; do \
 		${MV} history.n.$${s} history.$${s} ; \
 	    done ; \
 	fi)
 	@${SED} <${FILESDIR}/innd.sh >${PREFIX}/etc/rc.d/innd.sh \

Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/news/inn/pkg-plist,v
retrieving revision 1.14
diff -u -r1.14 pkg-plist
--- pkg-plist	24 May 2001 14:17:13 -0000	1.14
+++ pkg-plist	31 Mar 2002 15:44:45 -0000
@@ -108,8 +108,9 @@
 news/db/active.times
 news/db/history
 news/db/history.dir
-news/db/history.hash
-news/db/history.index
+%%SUB_WITHOUT_TAGGED_HASH%%news/db/history.hash
+%%SUB_WITHOUT_TAGGED_HASH%%news/db/history.index
+%%SUB_WITH_TAGGED_HASH%%news/db/history.pag
 news/db/newsgroups
 news/etc/actsync.cfg
 news/etc/actsync.ign

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/news/inn-stable/Makefile,v
retrieving revision 1.82
diff -u -r1.82 Makefile
--- Makefile	30 Mar 2002 12:26:48 -0000	1.82
+++ Makefile	31 Mar 2002 16:39:54 -0000
@@ -32,14 +32,19 @@
 CONFIGURE_ARGS+=	--with-log-dir=${INN_NEWSLOG}
 CONFIGURE_ARGS+=	--with-perl
 CONFIGURE_ARGS+=	--with-tmp-path=${INN_NEWSSPOOL}/tmp
+.if !defined(WITH_TAGGED_HASH)
+# You cannot use --with-largefiles in conjunction with --enable-tagged-hash
 CONFIGURE_ARGS+=	--with-largefiles
+.endif
 CONFIGURE_ARGS+=	--with-openssl
 
 # Various Options. See ${WRKSRC}/INSTALL for details
 
+.if defined(WITH_TAGGED_HASH)
 # Use tagged hash table for the history database. Uses much less memory but
 # is somewhat slower
-#CONFIGURE_ARGS+=	--enable-tagged-hash
+CONFIGURE_ARGS+=	--enable-tagged-hash
+.endif
 
 MAN1=	ckpasswd.1 convdate.1 fastrm.1 getlist.1 grephistory.1 inews.1 \
 	innconfval.1 innfeed.1 innmail.1 nntpget.1 rnews.1 shlock.1 \
@@ -65,6 +70,18 @@
 
 INN_INCLUDES=	clibrary.h config.h configdata.h dbz.h libinn.h storage.h
 
+.if defined(WITH_TAGGED_HASH)
+# makedbz(8) will create different dbz files when --enable-tagged-hash is set
+# so adjust pkg-plist and the list of db files accordingly:
+DBZ_FILES=	dir pag
+PLIST_SUB=	SUB_WITH_TAGGED_HASH=""
+PLIST_SUB+=	SUB_WITHOUT_TAGGED_HASH="@comment "
+.else
+DBZ_FILES=	dir hash index
+PLIST_SUB=	SUB_WITH_TAGGED_HASH="@comment "
+PLIST_SUB+=	SUB_WITHOUT_TAGGED_HASH=""
+.endif
+
 pre-install:
 	${MKDIR} ${INN_NEWSSPOOL}
 
@@ -78,7 +95,7 @@
 	    ${CHMOD} 644 history ; \
 	    ${CHOWN} news:news history ; \
 	    su -fm news -c "../bin/makedbz -i" ; \
-	    for s in dir hash index ; do \
+	    for s in ${DBZ_FILES} ; do \
 		${MV} history.n.$${s} history.$${s} ; \
 	    done ; \
 	fi)

Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/news/inn-stable/pkg-plist,v
retrieving revision 1.16
diff -u -r1.16 pkg-plist
--- pkg-plist	24 May 2001 14:56:17 -0000	1.16
+++ pkg-plist	31 Mar 2002 16:42:16 -0000
@@ -108,8 +108,9 @@
 news/db/active.times
 news/db/history
 news/db/history.dir
-news/db/history.hash
-news/db/history.index
+%%SUB_WITHOUT_TAGGED_HASH%%news/db/history.hash
+%%SUB_WITHOUT_TAGGED_HASH%%news/db/history.index
+%%SUB_WITH_TAGGED_HASH%%news/db/history.pag
 news/db/newsgroups
 news/etc/actsync.cfg
 news/etc/actsync.ign
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020331180716.GA42978>