Code

ea8c7d30a3a1c8ac22d8f9dcd49981c1931fe75a
[pkg-collectd.git] / debian / patches / bts561577_collectd2html_recursive_fix.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## bts561577_collectd2html_recursive_fix.dpatch
3 ## by Yuri D'Elia <wavexx@thregr.org>
4 ##
5 ## DP: collectd2html: Fixed recursive mode.
6 ## DP:
7 ## DP: Also, improved default settings to match the collectd4 series.
9 @DPATCH@
11 diff a/contrib/collectd2html.pl b/contrib/collectd2html.pl
12 --- a/contrib/collectd2html.pl
13 +++ b/contrib/collectd2html.pl
14 @@ -44,7 +44,7 @@
15  my $DIR       = "/var/lib/collectd";
16  my $HOST      = undef;
17  my $IMG_FMT   = "PNG";
18 -my $RECURSIVE = 0;
19 +my $RECURSIVE = 1;
20  
21  GetOptions (
22      "host=s"         => \$HOST,
23 @@ -63,7 +63,7 @@
24  
25  my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff,
26         0xffff77, 0x55aaff);
27 -my @tmp = `/bin/hostname`; chomp(@tmp);
28 +my @tmp = `/bin/hostname -f`; chomp(@tmp);
29  $HOST = $tmp[0] if (! defined $HOST);
30  my $svg_p = ($IMG_FMT eq "SVG");
31  my $IMG_SFX = $svg_p ? ".svg" : ".png";
32 @@ -140,7 +140,8 @@
33  }
34  chomp(@list);
35  
36 -foreach my $rrd (sort @list){
37 +@list = sort @list;
38 +foreach my $rrd (@list){
39         $rrd =~ m/^$DIR\/(.*)\.rrd$/;
40         push(@rrds, $1);
41  }