From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Feb 22 14:20:02 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3232516A405 for ; Fri, 22 Feb 2008 14:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E28A913C4D1 for ; Fri, 22 Feb 2008 14:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1MEK18Y076281 for ; Fri, 22 Feb 2008 14:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1MEK13Y076280; Fri, 22 Feb 2008 14:20:01 GMT (envelope-from gnats) Resent-Date: Fri, 22 Feb 2008 14:20:01 GMT Resent-Message-Id: <200802221420.m1MEK13Y076280@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dennis Herrmann Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C598416A404 for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/120968: PATCH port net/vnstat (change few things) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2008 14:20:02 -0000 >Number: 120968 >Category: ports >Synopsis: PATCH port net/vnstat (change few things) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Fri Feb 22 14:20:01 UTC 2008 >Closed-Date: >Last-Modified: >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: >Unformatted: