aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunichi Uekawa <dancer@netfort.gr.jp>2009-03-16 19:12:33 +0900
committerJunichi Uekawa <dancer@netfort.gr.jp>2009-03-16 19:12:33 +0900
commit499e3fa251a0352701e9f4faa1d5c797318692f4 (patch)
tree2b02648294ea43aef58095704d8564ec6f45f141
parentaa80657c561580daf6bb00436e0f6832e1e95dea (diff)
downloadpbuilder-499e3fa251a0352701e9f4faa1d5c797318692f4.tar
pbuilder-499e3fa251a0352701e9f4faa1d5c797318692f4.tar.gz
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.
-rwxr-xr-xpbuilder-satisfydepends-funcs18
-rwxr-xr-xtest_pbuilder-satisfydepends-funcs15
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