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

Bug#708381: [lintian] Patch



Package: lintian
Version: 2.5.13
control: tags -1 + patch
From 933ff11c5766d08e3d1a1eb65f87a37929d06c4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Mon, 29 Jul 2013 16:58:56 +0200
Subject: [PATCH] Fix false-negative brace-expansion-in-debhelper-config-file
 for "{, foo}"

Lintian does not trigger for:
for
patterns like this:

{,foo}

or this:

{foo,}
---
 checks/debhelper.pm                                |    2 +-
 .../debian/debian/control.in                       |   84 ++++++++++++++++++++
 .../debian/debhelper-brace-problem-1.install       |    1 +
 .../debian/debhelper-brace-problem-2.install       |    1 +
 .../debian/debhelper-brace-problem-3.install       |    1 +
 .../debian/debhelper-brace-problem-4.install       |    1 +
 .../debian/debhelper-brace-problem-5.install       |    1 +
 .../debian/debhelper-brace-problem-6.install       |    1 +
 .../debian/debhelper-brace-problem-good.install    |    2 +
 .../debian/debian/install                          |    1 -
 10 files changed, 93 insertions(+), 2 deletions(-)
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/control.in
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-1.install
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-2.install
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-3.install
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-4.install
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-5.install
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-6.install
 create mode 100644 t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-good.install
 delete mode 100644 t/tests/debhelper-brace-expansion/debian/debian/install

diff --git a/checks/debhelper.pm b/checks/debhelper.pm
index 7232497..8592a56 100644
--- a/checks/debhelper.pm
+++ b/checks/debhelper.pm
@@ -363,7 +363,7 @@ for my $file (sort(readdir($dirfd))) {
             while (<$fd>) {
                 next if /^\s*$/;
                 next if (/^\#/ and $level >= 5);
-                if (m/(?<!\\)\{(?:[^\s\\\}]+?,)+[^\\\}\s]+\}/) {
+                if (m/(?<!\\)\{(?:[^\s\\\},]*?,)*[^\\\}\s,]+,*\}/) {
                     tag 'brace-expansion-in-debhelper-config-file',
                         "debian/$file";
                     last;
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/control.in b/t/tests/debhelper-brace-expansion/debian/debian/control.in
new file mode 100644
index 0000000..6e46db9
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/control.in
@@ -0,0 +1,84 @@
+Source: {$srcpkg}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 9)
+
+Package: {$srcpkg}
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.  It may
+ be an empty package.
+
+Package: debhelper-brace-problem-1
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description} another extra string
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string.  It may be an empty package.
+ 
+Package: debhelper-brace-problem-2
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description} another extra string three
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string three.  It may be an empty package.
+ 
+Package: debhelper-brace-problem-3
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description} three test case
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string three test case. It may be an empty package. 
+ 
+Package: debhelper-brace-problem-4
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description} fourth test case
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string fourth test case. It may be an empty package.
+ 
+Package: debhelper-brace-problem-5
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description} fifth test case
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string fifth test case. It may be an empty package.
+
+Package: debhelper-brace-problem-6
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description} sixth test case
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Extra
+ string sixth test case. It may be an empty package.
+ 
+Package: debhelper-brace-problem-good
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description} good test case
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package. Should
+ not trigger lintian test. It may be an empty package.
+ 
+
+
+
+
+
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-1.install b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-1.install
new file mode 100644
index 0000000..917db1f
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-1.install
@@ -0,0 +1 @@
+{,foo}.txt usr/share/debhelper
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-2.install b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-2.install
new file mode 100644
index 0000000..c0a7ccb
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-2.install
@@ -0,0 +1 @@
+{foo,bar}.txt usr/share/debhelper
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-3.install b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-3.install
new file mode 100644
index 0000000..7276554
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-3.install
@@ -0,0 +1 @@
+{foo,}.txt usr/share/debhelper
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-4.install b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-4.install
new file mode 100644
index 0000000..05031a8
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-4.install
@@ -0,0 +1 @@
+{,,foo}.txt usr/share/debhelper
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-5.install b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-5.install
new file mode 100644
index 0000000..576e6a4
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-5.install
@@ -0,0 +1 @@
+{,foo,}.txt usr/share/debhelper
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-6.install b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-6.install
new file mode 100644
index 0000000..79dd5dc
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-6.install
@@ -0,0 +1 @@
+{foo}.txt usr/share/debhelper
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-good.install b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-good.install
new file mode 100644
index 0000000..7b81943
--- /dev/null
+++ b/t/tests/debhelper-brace-expansion/debian/debian/debhelper-brace-problem-good.install
@@ -0,0 +1,2 @@
+\{.txt usr/share/debhelper
+\{good\}.txt usr/share/debhelper
diff --git a/t/tests/debhelper-brace-expansion/debian/debian/install b/t/tests/debhelper-brace-expansion/debian/debian/install
deleted file mode 100644
index c0a7ccb..0000000
--- a/t/tests/debhelper-brace-expansion/debian/debian/install
+++ /dev/null
@@ -1 +0,0 @@
-{foo,bar}.txt usr/share/debhelper
-- 
1.7.10.4


Reply to: