[lintian] 09/09: Make r/html_reports a dplint cmd
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 7d9a7d17989ef1cb5f056a7c1d09be66d3af5500
Author: Niels Thykier <niels@thykier.net>
Date: Mon Apr 25 18:23:55 2016 +0000
Make r/html_reports a dplint cmd
Signed-off-by: Niels Thykier <niels@thykier.net>
---
.../reporting-html-reports.pm | 35 +++++++++++-----------
debian/changelog | 8 ++++-
reporting/harness | 12 ++++----
3 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/reporting/html_reports b/commands/reporting-html-reports.pm
old mode 100755
new mode 100644
similarity index 99%
rename from reporting/html_reports
rename to commands/reporting-html-reports.pm
index efb7f0e..0ae9e51
--- a/reporting/html_reports
+++ b/commands/reporting-html-reports.pm
@@ -33,10 +33,21 @@ use List::MoreUtils qw(uniq);
use URI::Escape;
use Text::Template ();
+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::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 delete_dir);
+
# ------------------------------
# Global variables and configuration
# These have no default and must be set in the configuration file.
+# (i.e. they are pulled from """ require "./config" """)
our (
$LINTIAN_ROOT, $LINTIAN_ARCHIVEDIR,$LINTIAN_DIST,
$LINTIAN_ARCH, $HTML_TMP_DIR,$LINTIAN_AREA,
@@ -45,21 +56,7 @@ our (
$HARNESS_STATE_DIR,
);
-# Read the configuration.
-BEGIN { require './config'; } ## no critic (Modules::RequireBarewordIncludes)
-
-# 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::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 delete_dir);
-
+# Some globals intialised in init_global()
our ($RESOURCE_MANAGER, $LINTIAN_VERSION, $timestamp, $mirror_timestamp);
# ------------------------------
@@ -163,7 +160,10 @@ sub main {
# Utility functions
sub init_globals {
- my $profile = Lintian::Profile->new(undef,[$LINTIAN_ROOT]);
+ # Read the configuration.
+ require './config'; ## no critic (Modules::RequireBarewordIncludes)
+
+ my $profile = dplint::load_profile();
Lintian::Data->set_vendor($profile);
@@ -171,8 +171,7 @@ sub init_globals {
my $mirror_trace_file
= "$LINTIAN_ARCHIVEDIR/project/trace/$LINTIAN_MIRROR_NAME";
- $LINTIAN_VERSION
- = safe_qx("$LINTIAN_ROOT/frontend/lintian",'--print-version');
+ $LINTIAN_VERSION = dplint::lintian_version();
$timestamp = safe_qx(qw(date -u --rfc-822));
$mirror_timestamp = slurp_entire_file($mirror_trace_file);
chomp($LINTIAN_VERSION, $timestamp);
diff --git a/debian/changelog b/debian/changelog
index 3a1902a..98871ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,9 @@ lintian (2.5.45) UNRELEASED; urgency=medium
* collection/*:
+ [NT] Always pass "-n" to "gzip".
+ * commands/reporting-html-reports.pm:
+ + [NT] Remove "$COPY_DOCS" configuration option. The
+ html_reports now always copies the documentation.
* commands/reporting-lintian-harness.pm:
+ [NT] Re-enable pedantic tags by default. These were
disabled in the previous release by mistake.
@@ -33,9 +36,12 @@ lintian (2.5.45) UNRELEASED; urgency=medium
* doc/tutorial/Lintian/Tutorial/WritingTests.pod:
+ [JW] Fix formatting error.
- * reporting/{config,html_reports}:
+ * reporting/config:
+ [NT] Remove "$COPY_DOCS" configuration option. The
html_reports now always copies the documentation.
+ * reporting/html_reports:
+ + [NT] Refactored into a "dplint" command and renamed to
+ "commands/reporting-html-reports.pm".
* reporting/templates/tags-severity.tmpl:
+ [NT] Add sections for "classification" tags.
diff --git a/reporting/harness b/reporting/harness
index 99f182e..ecf4b80 100755
--- a/reporting/harness
+++ b/reporting/harness
@@ -120,7 +120,6 @@ use vars qw($LINTIAN_ROOT $LINTIAN_LAB $LINTIAN_ARCHIVEDIR $LINTIAN_DIST
# delete LINTIAN_ROOT in case it is set.
delete($ENV{'LINTIAN_ROOT'});
-my $html_reports_cmd = "$LINTIAN_ROOT/reporting/html_reports";
my $dplint_cmd = "$LINTIAN_ROOT/frontend/dplint";
my ($log_file, $lintian_log, $lintian_perf_log,$html_reports_log,
@@ -319,17 +318,18 @@ if ($opt{'incremental-mode'} or $opt{'full-mode'}) {
if ($opt{'generate-reports'}) {
# create html reports
Log('Creating HTML reports...');
- Log("Executing $html_reports_cmd $lintian_log");
+ Log("Executing $dplint_cmd reporting-html-reports $lintian_log");
my %html_reports_opts = (
'out' => $html_reports_log,
'err' => '&1',
);
- spawn(\%html_reports_opts, [$html_reports_cmd, $lintian_log])
- or Log(
- "warning: executing $html_reports_cmd returned " . (($? >> 8) & 0xff));
+ spawn(\%html_reports_opts,
+ [$dplint_cmd, 'reporting-html-reports', $lintian_log])
+ or Log('warning: executing reporting-html-reports returned '
+ . (($? >> 8) & 0xff));
Log('');
- # rotate the statistics file updated by $html_reports_cmd
+ # rotate the statistics file updated by reporting-html-reports
if (!$opt{'dry-run'} && -f "$HARNESS_STATE_DIR/statistics") {
my $date = time2str('%Y%m%d', time());
my $dest = "$LOG_DIR/stats/statistics-${date}";
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: