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

more patches



Hi again,

lintian_improved....patch:

I made a couple of changes so it matches "bla bla bla" at the same time, and
to make it catch all of the duplicated lines on the same line.

lintian_maint....patch:

Adds a check for maintainer scripts modifying the php.ini file (only checks
the preinst script as it is "safe" if done on the postrm to rollback the
changes). I believe the description of the new tag is clear enough.

Cheers,
-- 
Atomo64 - Raphael

Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
diff --git a/checks/description b/checks/description
index 0d5d550..8640ab9 100644
--- a/checks/description
+++ b/checks/description
@@ -117,9 +117,12 @@ while (<IN>) {
     }
 
     my $wo_quotes = $_;
-    $wo_quotes =~ s,(\"|\').*(\1),,;
-    if ($wo_quotes =~ m,((?:\W|^)(\w+)\s+(\2)(?:\W|$)),i) {
-        tag "description-contains-duplicated-word", "$1";
+    $wo_quotes =~ s,(\"|\')(.*?)(\1),,;
+    while ($wo_quotes =~ m,((?:\W|^)(\w+)(\s+(\2))+(?:\W|$)),i) {
+        my ($_quoted, $_words) = (quotemeta($1), $1);
+        $wo_quotes =~ s/$_quoted//;
+        $_words =~ s,(^\s*|\s*$),,g;
+        tag "description-contains-duplicated-word", "$_words";
     }
 
     if ($lines == 1) {
diff --git a/testset/description/debian/control b/testset/description/debian/control
index 6ce5767..0a88f05 100644
--- a/testset/description/debian/control
+++ b/testset/description/debian/control
@@ -15,6 +15,8 @@ Description: description is a package which tests lintian's description checks.
  	not
  contain tabs.
  .control statements are not allowed as well.
+ .
+ All all all of of these these should be matched matched matched
 
 Package: description-foo
 Architecture: all
diff --git a/testset/tags.cdbs-test b/testset/tags.cdbs-test
index 579d3b9..6693542 100644
--- a/testset/tags.cdbs-test
+++ b/testset/tags.cdbs-test
@@ -8,4 +8,4 @@ W: cdbs-test source: no-human-maintainers
 W: cdbs-test source: out-of-date-standards-version 3.7.3 (current is 3.8.0)
 W: cdbs-test source: package-has-a-duplicate-build-relation cdbs, cdbs
 W: cdbs-test: debian-changelog-line-too-long line 1
-W: cdbs-test: description-contains-duplicated-word bla bla
+W: cdbs-test: description-contains-duplicated-word bla bla bla
diff --git a/testset/tags.description b/testset/tags.description
index 6d379b3..9d6ac7c 100644
--- a/testset/tags.description
+++ b/testset/tags.description
@@ -22,5 +22,9 @@ W: description-foo: description-starts-with-leading-spaces
 W: description-foo: possible-unindented-list-in-extended-description
 W: description: changelog-not-compressed-with-max-compression changelog.Debian.gz
 W: description: debian-changelog-file-contains-obsolete-user-emacs-settings
-W: description: description-contains-duplicated-word The the 
+W: description: description-contains-duplicated-word All all all
+W: description: description-contains-duplicated-word The the
+W: description: description-contains-duplicated-word matched matched matched
+W: description: description-contains-duplicated-word of of
+W: description: description-contains-duplicated-word these these
 W: description: description-synopsis-might-not-be-phrased-properly

diff --git a/checks/scripts b/checks/scripts
index 77a13f0..aca33eb 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -517,6 +517,10 @@ while (<SCRIPTS>) {
 	    tag "mknod-in-maintainer-script", "$file:$.";
 	}
 
+	if ($file =~ m/postinst/ and m%>>\s*/etc/php(.*?)/(.*?)/php\.ini%) {
+	    tag "maintainer-script-modifies-php.ini", "$file:$.";
+	}
+
 	# Collect information about init script invocations to catch running
 	# init scripts directory rather than through invoke-rc.d.  Since the
 	# script is allowed to run the init script directly if invoke-rc.d
diff --git a/checks/scripts.desc b/checks/scripts.desc
index 384bbee..8d3dced 100644
--- a/checks/scripts.desc
+++ b/checks/scripts.desc
@@ -424,3 +424,11 @@ Type: warning
 Info: The package calls dpkg --assert-multi-conrep in a maintainer
  script.  This check is obsolete and has always returned true since dpkg
  1.4.1.19, released 1999-10-30.
+
+Tag: maintainer-script-modifies-php.ini
+Type: warning
+Ref: http://wiki.debian.org/PHP
+Info: The package modifies the php.ini probably in an attempt to make
+ PHP load its extension.  This method is deprecated and the package should
+ instead ship its own configuration in a .ini file an put it in /etc/phpX/conf.d
+


Reply to: