ports/98469: [MAINTAINER] news/inn: fix package

Shaun Amott shaun at inerd.com
Thu Jun 8 17:00:45 UTC 2006


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 @@
+ at 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
- at unexec rm -f %D/news/db.dist/active       2> /dev/null || true
- at unexec rm -f %D/news/db.dist/active.times 2> /dev/null || true
- at unexec rm -f %D/news/db.dist/history      2> /dev/null || true
- at unexec rm -f %D/news/db.dist/history.dir  2> /dev/null || true
- at 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
+ at unexec rm -f %D/news/db.dist/active.old      || true
+ at unexec rm -f %D/news/db.dist/history.n.dir   || true
+ at unexec rm -f %D/news/db.dist/history.n.hash  || true
+ at 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
- at dirrm news/spool/overview
- at dirrm news/spool/outgoing
- at dirrm news/spool/innfeed
- at dirrm news/spool/incoming/bad
- at dirrm news/spool/incoming
- at dirrm news/spool/articles
- at dirrm news/spool/archive
- at dirrm news/spool/tmp
- at dirrm news/spool
+ at dirrmtry news/spool/overview
+ at dirrmtry news/spool/outgoing
+ at dirrmtry news/spool/innfeed
+ at dirrmtry news/spool/incoming/bad
+ at dirrmtry news/spool/incoming
+ at dirrmtry news/spool/articles
+ at dirrmtry news/spool/archive
+ at dirrmtry news/spool/tmp
+ at dirrmtry news/spool
 @dirrm news/run
 @dirrm news/lib
 @dirrm news/include/inn
-----inn.diff ends here-----

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



More information about the freebsd-ports-bugs mailing list