aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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