[lintian] 04/09: r/html_reports: Replace makeshift sub with existing one
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 04475d1d459539906b96ba23cabf396931732f3c
Author: Niels Thykier <niels@thykier.net>
Date: Sun Apr 24 20:27:05 2016 +0000
r/html_reports: Replace makeshift sub with existing one
Signed-off-by: Niels Thykier <niels@thykier.net>
---
reporting/html_reports | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/reporting/html_reports b/reporting/html_reports
index 3f5007c..812c20a 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -55,6 +55,7 @@ our $LINTIAN_TIMESTAMP
# Import Lintian Perl libraries.
use lib "$LINTIAN_ROOT/lib";
use Lintian::Command qw(safe_qx spawn);
+use Lintian::Command::Simple qw(rundir);
use Lintian::Data;
use Lintian::Internal::FrontendUtil qw(split_tag);
use Lintian::Lab;
@@ -609,8 +610,8 @@ sub update_history_and_make_graphs {
close($common);
print "Plotting global statistics...\n";
- chdir_system($graph_dir,
- ['gnuplot', "$LINTIAN_ROOT/reporting/graphs/statistics.gpi"]) == 0
+ rundir($graph_dir, 'gnuplot',
+ "$LINTIAN_ROOT/reporting/graphs/statistics.gpi") == 0
or die "gnuplot died with $?\n";
$RESOURCE_MANAGER->install_resource("${graph_dir}/statistics.svg");
@@ -638,7 +639,7 @@ sub update_history_and_make_graphs {
if ($GRAPHS) {
close($gnuplot_fd);
- chdir_system($graph_dir, ['gnuplot', 'call.gpi']) == 0
+ rundir($graph_dir, 'gnuplot', 'call.gpi') == 0
or die("gnuplot died with $?\n");
unlink($commonf);
for my $tag (sort(keys(%{$tag_statistics_ref}))) {
@@ -1019,19 +1020,6 @@ sub by_tag {
|| $a->{extra} cmp $b->{extra};
}
-sub chdir_system {
- my ($dir, $cmd) = @_;
- my $pid = fork();
- if ($pid) {
- waitpid($pid, 0) == $pid or die "waitpid failed: $!\n";
- return $?;
- }
-
- chdir($dir);
- exec @$cmd
- or die "exec failed: $!";
-}
-
# Local Variables:
# indent-tabs-mode: nil
# cperl-indent-level: 4
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: