ports/120968: PATCH port net/vnstat (change few things)
Dennis Herrmann
adox at mcx2.org
Fri Feb 22 14:20:02 UTC 2008
>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 at 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 @@
+ at exec mkdir -p /var/db/vnstat
bin/vnstat
-etc/vnstat.conf
- at unexec rm -rf /var/db/vnstat 2>&1 >/dev/null || true
+etc/vnstat.conf.sample
+ at dirrmtry /var/db/vnstat
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list