From nobody@FreeBSD.org  Fri Feb 22 14:13:42 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C598416A404
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Feb 2008 14:13:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 92D6F13C478
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Feb 2008 14:13:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1MEB6tl024420
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Feb 2008 14:11:06 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m1MEB6m2024419;
	Fri, 22 Feb 2008 14:11:06 GMT
	(envelope-from nobody)
Message-Id: <200802221411.m1MEB6m2024419@www.freebsd.org>
Date: Fri, 22 Feb 2008 14:11:06 GMT
From: Dennis Herrmann <adox@mcx2.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: PATCH port net/vnstat (change few things)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120968
>Category:       ports
>Synopsis:       PATCH port net/vnstat (change few things)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    beech
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 22 14:20:01 UTC 2008
>Closed-Date:    Sun Feb 24 11:13:52 UTC 2008
>Last-Modified:  Sun Feb 24 11:20:01 UTC 2008
>Originator:     Dennis Herrmann
>Release:        FreeBSD 6.3-RELEASE-p1
>Organization:
>Environment:
FreeBSD contempt 6.3-RELEASE-p1 FreeBSD 6.3-RELEASE-p1 #3: Sun Feb 17 06:44:17 CET 2008     root@contempt:/usr/obj/usr/src/sys/CONTEMPT  i386
>Description:
Attached diff to change var/lib: to "var/db" in vnstat.cron . Randy Pratt make me advertent of few things: 

1. The PR 120880 that was committed missed changing "var/lib: to
   "var/db" in vnstat.cron.

2. The port will removed /var/db/vnstat entirely even during
   an update so you will lose all your data.

3. The same situation exists for vnstat.conf. 

(thanks Randy Pratt)

He sended me an patch ,i fix few things but the most work come by Randy Pratt 
>How-To-Repeat:

>Fix:
diff -ruN vnstat.orig/Makefile vnstat/Makefile
--- vnstat.orig/Makefile	2008-02-22 14:41:22.000000000 +0100
+++ vnstat/Makefile	2008-02-22 14:42:43.000000000 +0100
@@ -25,7 +25,7 @@
 post-extract:
 	@cd ${WRKSRC} && ${CP} cron/vnstat vnstat-cron
 	@${REINPLACE_CMD} -e 's|/usr/bin|/usr/local/bin|g' \
-		${WRKSRC}/vnstat-cron
+		-e 's|/var/lib|/var/db|g' ${WRKSRC}/vnstat-cron
 
 post-install:
 .if !defined(NOPORTDOCS)
diff -ruN vnstat.orig/files/patch-Makefile vnstat/files/patch-Makefile
--- vnstat.orig/files/patch-Makefile	2008-02-22 14:41:22.000000000 +0100
+++ vnstat/files/patch-Makefile	2008-02-22 14:42:43.000000000 +0100
@@ -1,5 +1,5 @@
---- Makefile.orig	2008-02-03 19:23:03.000000000 +0100
-+++ Makefile	2008-02-19 18:02:58.000000000 +0100
+--- Makefile.orig	2008-02-03 13:23:03.000000000 -0500
++++ Makefile	2008-02-21 19:51:31.000000000 -0500
 @@ -1,106 +1,29 @@
 -# bin, man and cron dirs
 -BIN = $(DESTDIR)/usr/bin
@@ -93,9 +93,9 @@
 -	@if [ `grep -c vnstat /etc/crontab` -eq 0 ]; \
 -	then cat cron/vnstat >>/etc/crontab; \
 -	sed -i "" -e 's/lib\/vnstat/db\/vnstat/g' -e 's/\/usr\/bin\/vnstat/\/usr\/local\/bin\/vnstat/g' /etc/crontab; \
-+	@if [ ! -f ${PREFIX}/etc/vnstat.conf ]; \
-+	then install -m 644 cfg/vnstat.conf ${PREFIX}/etc; \
-+	sed -i "" -e 's/lib/db/g' ${PREFIX}/etc/vnstat.conf; \
++	@if [ ! -f ${PREFIX}/etc/vnstat.conf.sample ]; \
++	then install -m 644 cfg/vnstat.conf ${PREFIX}/etc/vnstat.conf.sample; \
++	sed -i "" -e 's/lib/db/g' ${PREFIX}/etc/vnstat.conf.sample; \
  	fi
  
  # update man page	
@@ -120,4 +120,4 @@
 -	@echo "The cron entry from /etc/crontab needs to be removed manually."
 +	rm -f ${PREFIX}/bin/vnstat
 +	rm -f ${PREFIX}/man/man1/vnstat.1*
-+	rm -f ${PREFIX}/etc/vnstat.conf
++	rm -f ${PREFIX}/etc/vnstat.conf.sample
diff -ruN vnstat.orig/files/pkg-message.in vnstat/files/pkg-message.in
--- vnstat.orig/files/pkg-message.in	2008-02-22 14:41:22.000000000 +0100
+++ vnstat/files/pkg-message.in	2008-02-22 14:44:58.000000000 +0100
@@ -2,7 +2,8 @@
 vnstat has been installed.
 
 This port neeeds a cron entry. Please copy the contents of:
-%%DOCSDIR%%/vnstat-cron to your crontab.
+%%DOCSDIR%%/vnstat-cron to your crontab. A Sample 
+configuration file has be installed in %%PREFIX%%/etc/
 
 For more information about vnStat use "man vnstat" or visit:
 http://humdi.net/vnstat/
diff -ruN vnstat.orig/pkg-plist vnstat/pkg-plist
--- vnstat.orig/pkg-plist	2008-02-22 14:41:22.000000000 +0100
+++ vnstat/pkg-plist	2008-02-22 14:43:34.000000000 +0100
@@ -1,3 +1,4 @@
+@exec mkdir -p /var/db/vnstat
 bin/vnstat
-etc/vnstat.conf
-@unexec rm -rf /var/db/vnstat 2>&1 >/dev/null || true
+etc/vnstat.conf.sample
+@dirrmtry /var/db/vnstat

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->beech 
Responsible-Changed-By: beech 
Responsible-Changed-When: Sun Feb 24 09:14:45 UTC 2008 
Responsible-Changed-Why:  
I'll take it 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120968 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/120968: commit references a PR
Date: Sun, 24 Feb 2008 11:03:59 +0000 (UTC)

 beech       2008-02-24 11:03:55 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/vnstat           Makefile 
   Log:
   - Fix install/uninstall of vnstat.conf and var/db/vnstat so data won't be overwritten.
   - Minor tweaks
   - Bump portrevision
   
   PR:             ports/120968
   Submitted by:   Dennis Herrmann <adox@mcx2.org> (maintainer)
   
   Revision  Changes    Path
   1.3       +2 -2      ports/net/vnstat/Makefile
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: beech 
State-Changed-When: Sun Feb 24 11:13:39 UTC 2008 
State-Changed-Why:  
Committed, Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=120968 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/120968: commit references a PR
Date: Sun, 24 Feb 2008 11:13:18 +0000 (UTC)

 beech       2008-02-24 11:13:09 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/vnstat           pkg-plist 
     net/vnstat/files     patch-Makefile pkg-message.in 
   Log:
   - Add files missed in last commit
   
   PR:             ports/120968
   Submitted by:   Dennis Herrmann <adox@mcx2.org> (maintainer)
   
   Revision  Changes    Path
   1.2       +6 -6      ports/net/vnstat/files/patch-Makefile
   1.2       +2 -1      ports/net/vnstat/files/pkg-message.in
   1.2       +3 -2      ports/net/vnstat/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
