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

[SCM] Debian package checker branch, master, updated. 2.5.2-91-g4a574d9



The following commit has been merged in the master branch:
commit 4a574d96e1f72dc5c236596c40f89c179b43ecac
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Sep 3 21:28:37 2011 +0200

    Emit bad-homepage if the protocol is not known
    
    This will catch typoes in the protocol name.

diff --git a/checks/fields b/checks/fields
index 4848647..7ea6b2f 100644
--- a/checks/fields
+++ b/checks/fields
@@ -486,7 +486,8 @@ if (defined $info->field('homepage')) {
 	require URI;
 	my $uri = URI->new($homepage);
 
-	unless ($uri->scheme) { # not an absolute URI
+	# not an absolute URI or (most likely) an invalid protocol
+	unless ($uri->scheme && $uri->scheme =~ m/^https?$/) {
 		tag 'bad-homepage', $homepage;
 	}
 
diff --git a/checks/fields.desc b/checks/fields.desc
index d231659..6c580cd 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -370,6 +370,11 @@ Certainty: certain
 Info: The "Homepage:" field in this package's control file does not
  contain a valid absolute URL. Most probably you forgot to specify
  the scheme (e.g. http).
+ .
+ This tag is also triggered if the scheme is not known by Lintian.
+ .
+ Please file a bug against Lintian, if this tag is triggered for a
+ valid homepage URL.
 
 Tag: no-homepage-field
 Severity: pedantic
diff --git a/debian/changelog b/debian/changelog
index 20d0924..dbda8e8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -67,6 +67,8 @@ lintian (2.5.3) UNRELEASED; urgency=low
     + [NT] Warn about (build)depending/recommending on packaging-dev.
       Thanks to Luk Claes for the report and the initial patch.
       (Closes: #629308)
+    + [NT] Also emit bad-homepage if the Homepage URL does not seem to
+      be using a known protocol (for homepages).  (Closes: #580427)
   * checks/{filenames,rules}.desc:
     + [NT] Improved the descriptions of some tags.  (Closes: #639018)
   * checks/files{,.desc}:
diff --git a/t/tests/debhelper-override-depends/debian/debian/control.in b/t/tests/fields-bad-homepage/debian/debian/control.in
similarity index 90%
copy from t/tests/debhelper-override-depends/debian/debian/control.in
copy to t/tests/fields-bad-homepage/debian/debian/control.in
index 6a076f1..fa722cd 100644
--- a/t/tests/debhelper-override-depends/debian/debian/control.in
+++ b/t/tests/fields-bad-homepage/debian/debian/control.in
@@ -4,6 +4,8 @@ Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
 Build-Depends: debhelper (>= 7)
+# Whoops, typo
+Homepage: ttp://lintian.debian.org/
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/fields-bad-homepage/desc b/t/tests/fields-bad-homepage/desc
new file mode 100644
index 0000000..f1527fc
--- /dev/null
+++ b/t/tests/fields-bad-homepage/desc
@@ -0,0 +1,5 @@
+Testname: fields-bad-homepage
+Sequence: 6000
+Version: 1.0
+Description: Test for invalid Homepage protocol
+Test-For: bad-homepage
diff --git a/t/tests/fields-bad-homepage/tags b/t/tests/fields-bad-homepage/tags
new file mode 100644
index 0000000..8312c0a
--- /dev/null
+++ b/t/tests/fields-bad-homepage/tags
@@ -0,0 +1,2 @@
+W: fields-bad-homepage source: bad-homepage ttp://lintian.debian.org/
+W: fields-bad-homepage: bad-homepage ttp://lintian.debian.org/

-- 
Debian package checker


Reply to: