[lintian] 13/13: r/html_reports: Use resource manager for graphs
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit f054de5b216e3078c492cd3ee61c9a86e50fc281
Author: Niels Thykier <niels@thykier.net>
Date: Sat Feb 21 21:01:45 2015 +0100
r/html_reports: Use resource manager for graphs
Signed-off-by: Niels Thykier <niels@thykier.net>
---
reporting/html_reports | 9 ++++++++-
reporting/templates/index.tmpl | 2 +-
reporting/templates/tag.tmpl | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/reporting/html_reports b/reporting/html_reports
index 4ac8f80..3f87f11 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -65,7 +65,7 @@ use Lintian::Profile;
use Lintian::Relation::Version qw(versions_comparator);
use Lintian::Reporting::ResourceManager;
use Lintian::Util qw(read_dpkg_control slurp_entire_file load_state_cache
- find_backlog copy_dir);
+ find_backlog copy_dir delete_dir);
my $old_statistics;
my $profile = Lintian::Profile->new(undef,[$LINTIAN_ROOT]);
@@ -580,6 +580,8 @@ sub update_history_and_make_graphs {
chdir_system($graph_dir,
['gnuplot', "$LINTIAN_ROOT/reporting/graphs/statistics.gpi"]) == 0
or die "gnuplot died with $?\n";
+
+ $RESOURCE_MANAGER->install_resource("${graph_dir}/statistics.svg");
}
my $gnuplot_fd;
@@ -607,6 +609,11 @@ sub update_history_and_make_graphs {
chdir_system($graph_dir, ['gnuplot', 'call.gpi']) == 0
or die("gnuplot died with $?\n");
unlink($commonf);
+ for my $tag (sort(keys(%{$tag_statistics_ref}))) {
+ my $graph_file = "${graph_dir}/tags/${tag}.svg";
+ $RESOURCE_MANAGER->install_resource($graph_file);
+ }
+ delete_dir($graph_dir);
}
return;
}
diff --git a/reporting/templates/index.tmpl b/reporting/templates/index.tmpl
index f0087f6..1f40911 100644
--- a/reporting/templates/index.tmpl
+++ b/reporting/templates/index.tmpl
@@ -96,7 +96,7 @@
{
if ($graphs) {
- my $graph_link = "${path_prefix}graphs/statistics.svg";
+ my $graph_link = resource_path('statistics.svg');
$OUT .= qq( <p>\n);
$OUT .= qq( Evolution of Lintian tags over the past\n);
$OUT .= qq( $graphs_days days:</p>\n);
diff --git a/reporting/templates/tag.tmpl b/reporting/templates/tag.tmpl
index 58df569..ae5e2e1 100644
--- a/reporting/templates/tag.tmpl
+++ b/reporting/templates/tag.tmpl
@@ -12,7 +12,7 @@
{
if ($graphs) {
- my $graph_link = "${path_prefix}graphs/tags/$tag.svg";
+ my $graph_link = resource_path("${tag}.svg");
$OUT .= qq( <p>\n);
$OUT .= qq( Evolution of the $tag Lintian tag over the past\n);
$OUT .= qq( $graphs_days days:</p>\n);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: