net-analyzer/vnstat: Fix test, remove 26 volume elog epic.
authorJeroen Roovers <jer@gentoo.org>
Fri, 13 Oct 2017 13:34:55 +0000 (15:34 +0200)
committerJeroen Roovers <jer@gentoo.org>
Fri, 13 Oct 2017 13:35:26 +0000 (15:35 +0200)
Package-Manager: Portage-2.3.11, Repoman-2.3.3

net-analyzer/vnstat/files/vnstat-1.17-limit.patch [new file with mode: 0644]
net-analyzer/vnstat/vnstat-1.17-r1.ebuild

diff --git a/net-analyzer/vnstat/files/vnstat-1.17-limit.patch b/net-analyzer/vnstat/files/vnstat-1.17-limit.patch
new file mode 100644 (file)
index 0000000..e170697
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/tests/config_tests.c
++++ b/tests/config_tests.c
+@@ -99,7 +99,7 @@
+       cfg.maxbw = 10;
+       ret  = ibwget("ethnone", &limit);
+       ck_assert_int_eq(ret, 1);
+-      ck_assert_int_eq(limit, 8);
++      ck_assert_int_eq(limit, 10);
+ }
+ END_TEST
index 0c24c6dc60141c811ee7dff3d28d7382cc265542..2805e1d0d1c34d3061697b574dcbe070cd029bf4 100644 (file)
@@ -24,6 +24,9 @@ RDEPEND="
        ${COMMON_DEPEND}
        selinux? ( sec-policy/selinux-vnstatd )
 "
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.17-limit.patch
+)
 
 pkg_setup() {
        enewgroup vnstat
@@ -77,47 +80,3 @@ src_install() {
        newdoc INSTALL README.setup
        dodoc CHANGES README UPGRADE FAQ examples/vnstat.cgi
 }
-
-pkg_postinst() {
-       local _v
-       for _v in ${REPLACING_VERSIONS}; do
-               if ! version_is_at_least 1.17-r1 ${_v}; then
-                       # This is an upgrade
-                       elog ""
-                       elog "Beginning with ${PN}-1.17-r1, we no longer install and use the cron job"
-                       elog "per default to update vnStat databases because you will lose some traffic"
-                       elog "if your interface transfers more than ~4GB in the time between two cron"
-                       elog "runs".
-                       elog ""
-                       elog "Please make sure that the vnstatd service is enabled if you want to"
-                       elog "continue monitoring your traffic."
-
-                       # Show this elog only once
-                       break
-               fi
-       done
-
-       if [[ -z "${REPLACING_VERSIONS}" ]]; then
-               # This is a new installation
-
-               elog
-               elog "Repeat the following command for every interface you"
-               elog "wish to monitor (replace eth0):"
-               elog "   vnstat -u -i eth0"
-               elog "and set correct permissions after that, e.g."
-               elog "   chown -R vnstat:vnstat /var/lib/vnstat"
-               elog
-               elog "It is highly recommended to use the included vnstatd to update your"
-               elog "vnStat databases."
-               elog
-               elog "If you want to use the old cron way to update your vnStat databases,"
-               elog "you have to install the cron job manually:"
-               elog ""
-               elog "   cp /usr/share/${PN}/vnstat.cron /etc/cron.hourly/vnstat"
-               elog ""
-               elog "Note: if an interface transfers more than ~4GB in"
-               elog "the time between cron runs, you may miss traffic."
-               elog "That's why using vnstatd instead of the cronjob is"
-               elog "the recommended way to update your vnStat databases."
-       fi
-}