usertags 603881 +patch-in-git usertags 603881 +patch-supplied thanks The attached patch is based on Eric's, but is more Policy compliant, and includes a test case for added validation. I've verified that it all works as intended.
- Matt
>From 5d7eced6b8e0f4fea917cc310bb271a0e817792b Mon Sep 17 00:00:00 2001 From: Matt Palmer <mpal...@hezmatt.org> Date: Thu, 16 Dec 2010 19:43:45 +1100 Subject: [PATCH] Handle comments in debian/control. Closes: #603881 Thanks to Eric Pozharski for the initial patch. This version is slightly modified, as it provides a test case, and is compliant with Policy 5.2, which states that comments must not have leading whitespace before the hash. --- pbuilder-satisfydepends-funcs | 6 ++++++ test_pbuilder-satisfydepends-funcs | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs index f4cae2d..79d423c 100755 --- a/pbuilder-satisfydepends-funcs +++ b/pbuilder-satisfydepends-funcs @@ -61,6 +61,12 @@ t store /^$/ d b pgploop } +: leadloop +/^#/ { + n + /^$/ d + b leadloop +} /^$/q d : store diff --git a/test_pbuilder-satisfydepends-funcs b/test_pbuilder-satisfydepends-funcs index 4eaa665..bd20472 100755 --- a/test_pbuilder-satisfydepends-funcs +++ b/test_pbuilder-satisfydepends-funcs @@ -74,6 +74,18 @@ EOF get_build_deps } +test_get_source_control_field_with_comments() { + cat <<EOF >"$DEBIAN_CONTROL" +# This is a comment +# So is this +Format: 1.0 +Source: something-funny +Build-Depends: debhelper, something-else + +EOF + get_source_control_field "Source" +} + trap cleanup sigpipe sighup exit # TODO move to build dir @@ -86,4 +98,6 @@ expect_output "autotools-dev (>= 1.2), debhelper, quilt (<< 12:0), libwxgtk2.8-d expect_output "debhelper (>= 7)" test_get_build_deps_dsc +expect_output "something-funny" test_get_source_control_field_with_comments + testlib_summary -- 1.5.6.5