aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpbuilder-satisfydepends-funcs1
-rwxr-xr-xtest_pbuilder-satisfydepends-funcs33
2 files changed, 34 insertions, 0 deletions
diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs
index 0e8270c..bdbe0b1 100755
--- a/pbuilder-satisfydepends-funcs
+++ b/pbuilder-satisfydepends-funcs
@@ -60,6 +60,7 @@ get_control_re() {
/^$/ { source=0 }
/^Source:/ { source=1 }
/^[^ ]*:/ { p=0 }
+ /^#/ { next }
tolower($0) ~ /^'"$re"':/ { p=1 }
{ if (p && source) { print $0 } }' |
sed 's/^[^: ]*://'
diff --git a/test_pbuilder-satisfydepends-funcs b/test_pbuilder-satisfydepends-funcs
new file mode 100755
index 0000000..a245fc7
--- /dev/null
+++ b/test_pbuilder-satisfydepends-funcs
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+. ./testlib.sh
+. ./pbuilder-satisfydepends-funcs
+
+# testsuite to test pbuilder-satisfydepends-checkparams.
+
+test_get_control_re() {
+ CONTROL=$(tempfile)
+ cat <<EOF > "$CONTROL"
+Source: amule
+XXXX:
+Build-Depends:
+ autotools-dev,
+ debhelper,
+ quilt,
+##
+ libwxgtk2.8-dev,
+Build-Depends-Indep: test, test1
+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" test_get_control_re
+
+testlib_summary