Date: Fri, 19 Jun 2026 21:18:33 +0000 From: Florian Smeets <flo@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: c83dec7d604e - main - sysutils/munin-*: Fix graphing with rrdtool 1.10.x Message-ID: <6a35b229.3d56c.5fa17aad@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by flo: URL: https://cgit.FreeBSD.org/ports/commit/?id=c83dec7d604e44c61921425a38a00fa135e1f076 commit c83dec7d604e44c61921425a38a00fa135e1f076 Author: Florian Smeets <flo@FreeBSD.org> AuthorDate: 2026-06-19 21:15:05 +0000 Commit: Florian Smeets <flo@FreeBSD.org> CommitDate: 2026-06-19 21:17:52 +0000 sysutils/munin-*: Fix graphing with rrdtool 1.10.x Obtained from: https://github.com/munin-monitoring/munin/issues/1684#issuecomment-4568964718 --- .../files/patch-GraphOld.pm-rrdtool-1.10.0 | 165 +++++++++++++++++++++ sysutils/munin-master/Makefile | 2 +- 2 files changed, 166 insertions(+), 1 deletion(-) diff --git a/sysutils/munin-common/files/patch-GraphOld.pm-rrdtool-1.10.0 b/sysutils/munin-common/files/patch-GraphOld.pm-rrdtool-1.10.0 new file mode 100644 index 000000000000..3d37ef6bc99c --- /dev/null +++ b/sysutils/munin-common/files/patch-GraphOld.pm-rrdtool-1.10.0 @@ -0,0 +1,165 @@ +--- master/lib/Munin/Master/GraphOld.pm ++++ master/lib/Munin/Master/GraphOld.pm.new.ver +@@ -51,13 +51,12 @@ + use Text::ParseWords; + + # For UTF-8 handling (plugins are assumed to use Latin 1) +-if ($RRDs::VERSION >= 1.3) { +- use Encode; +- use Encode::Guess; +- Encode->import; +- Encode::Guess->import; +-} ++use Encode; ++use Encode::Guess; ++Encode->import; ++Encode::Guess->import; + ++ + use Munin::Master::Logger; + use Munin::Master::Utils; + use Munin::Common::Defaults; +@@ -65,25 +64,18 @@ + use Log::Log4perl qw( :easy ); + + # RRDtool 1.2 requires \\: in comments +-my $RRDkludge = $RRDs::VERSION < 1.2 ? '' : '\\'; ++my $RRDkludge = '\\'; + + # And RRDtool 1.2.* draws lines with crayons so we hack + # the LINE* options a bit. + my $LINEkluge = 0; +-if ($RRDs::VERSION >= 1.2 and $RRDs::VERSION < 1.3) { + +- # Only kluge the line widths in RRD 1.2* +- $LINEkluge = 1; +-} +- + # RRD 1.3 has a "ADDNAN" operator which evaluates n + NaN = n instead of = NaN. +-my $AddNAN = '+'; +-if ($RRDs::VERSION >= 1.3) { +- $AddNAN = 'ADDNAN'; +-} ++my $AddNAN = 'ADDNAN'; + ++ + # the ":dashes" syntax for LINEs is supported since rrdtool 1.5.3 +-my $RRDLineThresholdAttribute = ($RRDs::VERSION < 1.50003) ? '' : ':dashes'; ++my $RRDLineThresholdAttribute = ':dashes'; + + # Force drawing of "graph no". + my $force_graphing = 0; +@@ -214,7 +206,6 @@ + return $arg; + } + +- + sub graph_startup { + + # Parse options and set up. Stuff that is usually only needed once. +@@ -321,13 +312,7 @@ + $max_running = &munin_get($config, "max_graph_jobs", $max_running); + + if ($config->{"rrdcached_socket"}) { +- if ($RRDs::VERSION >= 1.3){ +- # Using the RRDCACHED_ADDRESS environnement variable, as +- # it is way less intrusive than the command line args. +- $ENV{RRDCACHED_ADDRESS} = $config->{"rrdcached_socket"}; +- } else { +- ERROR "[ERROR] RRDCached feature ignored: RRD version must be at least 1.3. Version found: " . $RRDs::VERSION; +- } ++ $ENV{RRDCACHED_ADDRESS} = $config->{"rrdcached_socket"}; + } + + +@@ -548,7 +533,7 @@ + push @$result, ("--vertical-label", $tmp_field); + } + +- push @$result, '--slope-mode' if $RRDs::VERSION >= 1.2; ++ push @$result, '--slope-mode'; + + push @$result, "--height", ($size_y || munin_get($service, "graph_height", "175")); + push @$result, "--width", ($size_x || munin_get($service, "graph_width", "400")); +@@ -1108,9 +1093,9 @@ + # Or when we want to. + push(@rrd, "COMMENT:" . (" " x $max_field_len)); + push(@rrd, "COMMENT: Cur$RRDkludge:"); +- push(@rrd, "COMMENT:Min$RRDkludge:"); +- push(@rrd, "COMMENT:Avg$RRDkludge:"); +- push(@rrd, "COMMENT:Max$RRDkludge: \\j"); ++ push(@rrd, "COMMENT: Min$RRDkludge:"); ++ push(@rrd, "COMMENT: Avg$RRDkludge:"); ++ push(@rrd, "COMMENT: Max$RRDkludge: \\j"); + $global_headers = 2; # Avoid further headers/labels + } + +@@ -1351,7 +1336,7 @@ + my @complete = get_fonts(); + + # Watermarks introduced in RRD 1.2.13. +- push(@complete, '-W', $watermark) if $RRDs::VERSION >= 1.2013; ++ push(@complete, '-W', $watermark); + + # Do the header (title, vtitle, size, etc...), but IN THE BEGINNING + unshift @complete, @{get_header($service, $time)}; +@@ -1378,13 +1363,11 @@ + # as utf8 string. So we assume that every input is in latin1 + # and decode it to perl's internal representation and then to utf8. + +- if ($RRDs::VERSION >= 1.3) { + @complete = map { + my $str = $_; + my $utf8 = guess_encoding($str, 'utf8'); + ref $utf8 ? $str : encode("utf8", (decode("latin1", $_))); + } @complete; +- } + + # Surcharging the graphing limits + my ($upper_limit_overrided, $lower_limit_overrided); +@@ -1654,20 +1637,7 @@ + # Set up rrdtool graph font options according to RRD version. + my @options; + +- if ($RRDs::VERSION < 1.2) { +- # RRD before 1.2, no font options +- } elsif ($RRDs::VERSION < 1.3) { +- # RRD 1.2 +- # The RRD 1.2 documentation says you can identify font family +- # names but I never got that to work, but full font path worked + @options = ( +- '--font', "LEGEND:7:$libdir/DejaVuSansMono.ttf", +- '--font', "UNIT:7:$libdir/DejaVuSans.ttf", +- '--font', "AXIS:7:$libdir/DejaVuSans.ttf", +- ); +- } else { +- # At least 1.3 +- @options = ( + '--font', 'DEFAULT:0:DejaVuSans,DejaVu Sans,DejaVu LGC Sans,Bitstream Vera Sans', + '--font', 'LEGEND:7:DejaVuSansMono,DejaVu Sans Mono,DejaVu LGC Sans Mono,Bitstream Vera Sans Mono,monospace', + # Colors coordinated with CSS. +@@ -1678,14 +1648,10 @@ + '--color', 'AXIS#CFD6F8', # And axis like html boxes + '--color', 'ARROW#CFD6F8', # And arrow, ditto. + ); +- } + +- if ($RRDs::VERSION >= 1.4) { +- # RRD 1.4 has border, adding it + push @options, ( + '--border', '0', + ); +- } + + return @options; + }; +@@ -1847,7 +1813,7 @@ + + sub RRDescape { + my $text = shift; +- return $RRDs::VERSION < 1.2 ? $text : escape($text); ++ return escape($text); + } + + + diff --git a/sysutils/munin-master/Makefile b/sysutils/munin-master/Makefile index f7cfb327a103..899288a390aa 100644 --- a/sysutils/munin-master/Makefile +++ b/sysutils/munin-master/Makefile @@ -1,6 +1,6 @@ PORTNAME= munin PORTVERSION= ${MUNIN_VERSION} -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= sysutils perl5 PKGNAMESUFFIX= -masterhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a35b229.3d56c.5fa17aad>
