[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.1.1-1-g2d18f55



The following commit has been merged in the master branch:
commit 2d18f5596065629e8d4d9159e3e53675ab4c440b
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Wed Dec 10 19:23:21 2008 +0000

    Re-add support for colourized HTML output.
    
    * frontend/lintian:
      + Accept "html" as a valid argument for --color again.
    * lib/Lintian/Output.pm:
      + Re-introduce support for HTML coloured output.  (Closes: #508341)
    * man/lintian.1:
      + Document that "--color=html" is supported again.

diff --git a/debian/changelog b/debian/changelog
index 5bb6088..3d3dc13 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+lintian (2.1.2) UNRELEASED; urgency=low
+
+  * frontend/lintian:
+    + [ADB] Accept "html" as a valid argument for --color again.
+
+  * lib/Lintian/Output.pm:
+    + [ADB] Re-introduce support for HTML coloured output.  (Closes: #508341)
+
+  * man/lintian.1:
+    + [ADB] Document that "--color=html" is supported again.
+
+ -- Adam D. Barratt <adam@adam-barratt.org.uk>  Wed, 10 Dec 2008 19:16:04 +0000
+
 lintian (2.1.1) unstable; urgency=low
 
   * Summary of tag changes:
diff --git a/frontend/lintian b/frontend/lintian
index 529ca27..0c77c5b 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -491,7 +491,7 @@ if (($check_everything or $packages_file) and $#ARGV+1 > 0) {
 }
 
 # check permitted values for --color
-if ($color and $color !~ /^(never|always|auto)$/) {
+if ($color and $color !~ /^(never|always|auto|html)$/) {
     die "invalid argument to --color: $color\n";
 }
 
diff --git a/lib/Lintian/Output.pm b/lib/Lintian/Output.pm
index 22d0008..d92df4f 100644
--- a/lib/Lintian/Output.pm
+++ b/lib/Lintian/Output.pm
@@ -85,11 +85,14 @@ a level lower or equal to its value.
 
 =item color
 
-Can take the values "never", "always", or "auto".
+Can take the values "never", "always", "auto" or "html".
 
 Whether to colorize tags based on their severity.  The default is "never",
 which never uses color.  "always" will always use color, "auto" will use
-color only if the output is going to a terminal,
+color only if the output is going to a terminal.
+
+"html" will output HTML <span> tags with a color style attribute (instead
+of ANSI color escape sequences).
 
 =item stdout
 
@@ -287,7 +290,11 @@ sub print_tag {
 
     my $tag;
     if ($self->_do_color) {
-	$tag .= Term::ANSIColor::colored($tag_info->{tag}, $tag_color);
+	if ($self->color eq 'html') {
+	    $tag .= qq(<span style="color: $tag_color">$tag_info->{tag}</span>)
+	} else {
+	    $tag .= Term::ANSIColor::colored($tag_info->{tag}, $tag_color);
+	}
     } else {
 	$tag .= $tag_info->{tag};
     }
@@ -409,7 +416,7 @@ output.
 sub _do_color {
     my ($self) = @_;
 
-    return ($self->color eq 'always'
+    return ($self->color eq 'always' || $self->color eq 'html'
 	    || ($self->color eq 'auto'
 		&& -t $self->stdout));
 }
diff --git a/man/lintian.1 b/man/lintian.1
index 3834c65..90a20b1 100644
--- a/man/lintian.1
+++ b/man/lintian.1
@@ -192,10 +192,12 @@ Don't use the overrides file.
 Output tags that have been overriden.
 
 .TP
-.BR \-\-color " (never|always|auto)"
+.BR \-\-color " (never|always|auto|html)"
 Whether to colorize tags in lintian output based on their severity.  The
 default is "never", which never uses color.  "always" will always use
-color, and "auto" will use color only if the output is going to a terminal.
+color, "auto" will use color only if the output is going to a terminal,
+and "html" will use HTML <span> tags with a color style attribute (instead
+of ANSI color escape sequences).
 
 .TP
 .BR \-U " info1,info2,..., " \-\-unpack\-info " info1,info2,..."

-- 
Debian package checker


Reply to: