From 499e3fa251a0352701e9f4faa1d5c797318692f4 Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Mon, 16 Mar 2009 19:12:33 +0900 Subject: handle packages line wrapping with something other than ',' in Build-Depends (closes: 519306) It used to rely on ',' being there, which really package maintainers are free to insert '|' etc. --- pbuilder-satisfydepends-funcs | 18 +++++++++++++++--- test_pbuilder-satisfydepends-funcs | 15 ++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs index f431880..5c16269 100755 --- a/pbuilder-satisfydepends-funcs +++ b/pbuilder-satisfydepends-funcs @@ -58,12 +58,24 @@ get_control_re() { cat "$control" | awk ' BEGIN { source=1 } - /^$/ { source=0 } + /^$/ { + if (p) { + print s + s="" + } + source=0 + } /^Source:/ { source=1 } - /^[^ ]*:/ { p=0 } + /^[^ ]*:/ { + if (source && p) { + print s + s="" + } + p=0 + } /^#/ { next } tolower($0) ~ /^'"$re"':/ { p=1 } - { if (p && source) { print $0 } }' | + { if (p && source) { s=s""$0 } }' | sed 's/^[^: ]*://' } diff --git a/test_pbuilder-satisfydepends-funcs b/test_pbuilder-satisfydepends-funcs index 25b807d..a2e8fd1 100755 --- a/test_pbuilder-satisfydepends-funcs +++ b/test_pbuilder-satisfydepends-funcs @@ -15,23 +15,20 @@ Build-Depends: debhelper, quilt, ## - libwxgtk2.8-dev, + libwxgtk2.8-dev Build-Depends-Indep: test, test1, test2, test3 | test4, test5 +Misc: test + +Build-Depends: wrong build depends, line Desctiption: test other things wow EOF get_control_re "$CONTROL" "build-(depends|depends-indep)" } -expect_output " - autotools-dev, - debhelper, - quilt, - libwxgtk2.8-dev, - test, test1, - test2, test3 | - test4, test5" test_get_control_re +expect_output " autotools-dev, debhelper, quilt, libwxgtk2.8-dev + test, test1, test2, test3 | test4, test5" test_get_control_re testlib_summary -- cgit v1.2.3