Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2006 16:14:05 +0100
From:      Shaun Amott <shaun@inerd.com>
To:        Thierry Thomas <thierry@FreeBSD.org>
Cc:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/98469: [MAINTAINER] news/inn: fix package
Message-ID:  <20060608151405.GA1127@picobyte.net>
In-Reply-To: <200606041031.k54AVGD0011404@freefall.freebsd.org>
References:  <200606041031.k54AVGD0011404@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 04, 2006 at 10:31:16AM +0000, Thierry Thomas wrote:
> 
> When installed on a clean machine from a newly created package, the
> $PREFIX/news/db is created, but not populated:
> 
> ls -l /usr/local/news/db
> total 0
> 
> ls -l /usr/local/news/db.dist
> total 6
> -rw-rw-r--  1 news  news  225  4 jui 12:21 active
> -rw-rw-r--  1 news  news    0  4 jui 12:21 active.times
> -rw-r--r--  1 news  news    0  4 jui 12:21 history
> -rw-r--r--  1 news  news   43  4 jui 12:21 history.dir
> -rw-rw-r--  1 news  news  333  4 jui 12:21 newsgroups
> 
> I think that /usr/local/news/db.dist should contain this files too.
> 
> Could you please check it?

Okay, it really works this time. :-)


-----inn.diff begins here-----
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/news/inn/Makefile,v
retrieving revision 1.75
diff -u -r1.75 Makefile
--- Makefile	28 May 2006 19:38:52 -0000	1.75
+++ Makefile	8 Jun 2006 15:11:59 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	inn
 PORTVERSION=	2.4.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	news ipv6
 MASTER_SITES=	${MASTER_SITE_ISC}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -184,6 +184,6 @@
 		${MV} history.n.$${s} history.$${s} ; \
 	    done ; \
 	fi)
-	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL PORTMODE
 
 .include <bsd.port.post.mk>
Index: pkg-install
===================================================================
RCS file: /home/ncvs/ports/news/inn/pkg-install,v
retrieving revision 1.7
diff -u -r1.7 pkg-install
--- pkg-install	28 May 2006 19:38:52 -0000	1.7
+++ pkg-install	8 Jun 2006 15:11:59 -0000
@@ -42,10 +42,27 @@
 	    ${NEWSBASE}/spool/overview \
 	    ${NEWSBASE}/spool/tmp
 
-	if [ -d ${NEWSBASE}/db.dist -a ! -f ${NEWSBASE}/db.dist/* ]; then
-		for f in ${NEWSBASE}/db/*; do
-			cp -pR ${f} ${NEWSBASE}/db.dist
-		done
+	if [ ${3:-""} = "PORTMODE" ]; then
+		fc=`ls ${NEWSBASE}/db.dist/* 2>/dev/null | wc -l`
+
+		if [ -d ${NEWSBASE}/db.dist -a $fc -eq 0 ]; then
+			for f in ${NEWSBASE}/db/*; do
+				cp -pR ${f} ${NEWSBASE}/db.dist
+			done
+		else
+			mkdir -p ${NEWSBASE}/db.dist
+			for f in ${NEWSBASE}/db/*; do
+				touch ${NEWSBASE}/db.dist/${f##*/}
+			done
+		fi
+	else
+		fc=`ls ${NEWSBASE}/db/* 2>/dev/null | wc -l`
+
+		if [ -d ${NEWSBASE}/db -a $fc -eq 0 ]; then
+			for f in ${NEWSBASE}/db.dist/*; do
+				cp -pR ${f} ${NEWSBASE}/db
+			done
+		fi
 	fi
 
 	;;
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/news/inn/pkg-plist,v
retrieving revision 1.23
diff -u -r1.23 pkg-plist
--- pkg-plist	28 May 2006 19:38:52 -0000	1.23
+++ pkg-plist	8 Jun 2006 15:11:59 -0000
@@ -1,3 +1,4 @@
+@exec mkdir -p %D/news/db
 news/bin/actmerge
 news/bin/actsync
 news/bin/actsyncd
@@ -105,11 +106,15 @@
 @unexec f=history;      if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi
 @unexec f=history.dir;  if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi
 @unexec f=newsgroups;   if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi
-@unexec rm -f %D/news/db.dist/active       2> /dev/null || true
-@unexec rm -f %D/news/db.dist/active.times 2> /dev/null || true
-@unexec rm -f %D/news/db.dist/history      2> /dev/null || true
-@unexec rm -f %D/news/db.dist/history.dir  2> /dev/null || true
-@unexec rm -f %D/news/db.dist/newsgroups   2> /dev/null || true
+news/db.dist/active
+news/db.dist/active.times
+news/db.dist/history
+news/db.dist/history.dir
+news/db.dist/newsgroups
+@unexec rm -f %D/news/db.dist/active.old      || true
+@unexec rm -f %D/news/db.dist/history.n.dir   || true
+@unexec rm -f %D/news/db.dist/history.n.hash  || true
+@unexec rm -f %D/news/db.dist/history.n.index || true
 %%SUB_WITHOUT_TAGGED_HASH%%@unexec f=history.hash;  if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi
 %%SUB_WITHOUT_TAGGED_HASH%%@unexec f=history.index; if cmp -s %D/news/db/$f %D/news/db.dist/$f; then rm -f %D/news/db/$f; fi
 %%SUB_WITHOUT_TAGGED_HASH%%@unexec rm -f %D/news/db.dist/history.hash  2> /dev/null || true
@@ -257,15 +262,15 @@
 %%PORTDOCS%%%%DOCSDIR%%/TODO
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
 @dirrmtry news/tmp
-@dirrm news/spool/overview
-@dirrm news/spool/outgoing
-@dirrm news/spool/innfeed
-@dirrm news/spool/incoming/bad
-@dirrm news/spool/incoming
-@dirrm news/spool/articles
-@dirrm news/spool/archive
-@dirrm news/spool/tmp
-@dirrm news/spool
+@dirrmtry news/spool/overview
+@dirrmtry news/spool/outgoing
+@dirrmtry news/spool/innfeed
+@dirrmtry news/spool/incoming/bad
+@dirrmtry news/spool/incoming
+@dirrmtry news/spool/articles
+@dirrmtry news/spool/archive
+@dirrmtry news/spool/tmp
+@dirrmtry news/spool
 @dirrm news/run
 @dirrm news/lib
 @dirrm news/include/inn
-----inn.diff ends here-----

-- 
Shaun Amott [ PGP: 0x6B387A9A ]
    Scientia Est Potentia.



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