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

[SCM] Debian package checker branch, master, updated. 1.24.2-89-g13805e0



The following commit has been merged in the master branch:
commit 13805e03a08b631e3c1d73c1e89077d1f2b173d9
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Wed Aug 6 21:41:05 2008 +0100

    Use Lintian::Collect to read the description

diff --git a/checks/description b/checks/description
index 1d0396f..3e8c530 100644
--- a/checks/description
+++ b/checks/description
@@ -28,9 +28,9 @@ sub run {
 
 my $pkg = shift;
 my $type = shift;
+my $info = shift;
 
 my $ppkg = quotemeta($pkg);
-my $cf = "fields/description";
 my $tabs = 0;
 my $lines = 0;
 my $template = 0;
@@ -39,17 +39,18 @@ my $synopsis;
 my $description;
 
 # description?
-unless (-f $cf) {
+my $full_description = $info->field('description');
+unless (defined $full_description) {
     tag "package-has-no-description", "";
     return 0;
 }
 
-open(IN, '<', $cf) or fail("cannot open $cf for reading: $!");
-
-# 1st line contains synopsis
-$synopsis = <IN>;
-$description = $synopsis;
-chomp $synopsis;
+$full_description =~ m/^([^\n]*)\n(.*)$/s;
+($synopsis, $description) = ($1, $2);
+unless (defined $synopsis) {
+    $synopsis = $full_description;
+    $description = '';
+}
 
 if ($synopsis =~ m/^\s*$/) {
     tag "description-synopsis-is-empty", "";
@@ -78,9 +79,7 @@ if ($synopsis =~ m/^\s*$/) {
     }
 }
 
-while (<IN>) {
-    $description .= $_;
-    chomp;
+foreach (split /\n/, $description) {
     next if m/^\s*$/o;
     next if m/^\.\s*$/o;
 
@@ -140,7 +139,6 @@ while (<IN>) {
 	tag "extended-description-line-too-long", "";
     }
 }
-close(IN);
 
 if ($lines == 0) {
     tag "extended-description-is-empty", "" unless $type eq 'udeb';
diff --git a/debian/changelog b/debian/changelog
index 7b1fd1e..1046fe5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -30,6 +30,7 @@ lintian (1.24.3) unstable; urgency=low
   * checks/description:
     + [RA] Don't warn about a synopsis that ends in "etc."  Patch from
       Chris Lamb.  (Closes: #491252)
+    + [ADB] Use Lintain::Collect to read the package's description.
   * checks/etcfiles:
     + [ADB] Walk Lintian::Collect->index instead of reading the "index" file.
   * checks/fields{,.desc}:

-- 
Debian package checker


Reply to: