diff options
author | Matt Palmer <mpalmer@hezmatt.org> | 2010-12-16 19:43:45 +1100 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2015-06-25 07:17:14 +0000 |
commit | 481fb377373b90c9966015199dc8a58c277ba065 (patch) | |
tree | f098912d38e32949117bd8b78beda12062a3fcab | |
parent | e37d90cf2c36c01c74a14eed9bed9530aa41cdea (diff) | |
download | pbuilder-481fb377373b90c9966015199dc8a58c277ba065.tar pbuilder-481fb377373b90c9966015199dc8a58c277ba065.tar.gz |
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.
-rwxr-xr-x | pbuilder-satisfydepends-funcs | 6 | ||||
-rwxr-xr-x | test_pbuilder-satisfydepends-funcs | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs index fb8ac95..651cbcc 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 61a446f..14fbb53 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 @@ -152,4 +164,6 @@ expect_output "" test_filter_arch_restriction_deps "foo [i386] <stage1>" "amd64" expect_output "debhelper (>= 7)" test_get_build_deps_dsc +expect_output "something-funny" test_get_source_control_field_with_comments + testlib_summary |