aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-satisfydepends-funcs
diff options
context:
space:
mode:
authorLoïc Minier <lool@dooz.org>2010-01-04 23:52:22 +0100
committerLoïc Minier <lool@dooz.org>2010-01-04 23:52:22 +0100
commit61754016baf1b8f4e86ccb3a49da335b7594e07e (patch)
tree36f443f98e0e80a93c35dfc936f72e9147815676 /pbuilder-satisfydepends-funcs
parent17f5763b0863a67d81fa7b8071329cb117ca987e (diff)
downloadpbuilder-61754016baf1b8f4e86ccb3a49da335b7594e07e.tar
pbuilder-61754016baf1b8f4e86ccb3a49da335b7594e07e.tar.gz
Normalize output of get_source_control_field()
Diffstat (limited to 'pbuilder-satisfydepends-funcs')
-rwxr-xr-xpbuilder-satisfydepends-funcs26
1 files changed, 20 insertions, 6 deletions
diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs
index 9beb691..5c43e34 100755
--- a/pbuilder-satisfydepends-funcs
+++ b/pbuilder-satisfydepends-funcs
@@ -53,20 +53,34 @@ checkbuilddep_versiondeps() {
get_source_control_field() {
local field="$1"
- sed -n -e "
-s/^$field://i
+ sed -n -e "s/^$field://i" -e '
t store
-/^\$/q
+/^$/q
d
: store
H
: loop
n
/^#/ b loop
-/^[ \\t]/ b store
+/^[ \t]/ b store
x
-s/\\n//g
-p" \
+# output on single line
+s/\n//g
+# change series of tabs and spaces into a space
+s/[\t ]\+/ /g
+# normalize space before and after commas
+s/ *, */, /g
+# normalize space before and after pipes
+s/ *| */ | /g
+# normalize space before and after parentheses
+s/ *( */ (/g
+s/ *) */)/g
+# normalize space between operator and version
+s/(\(>>\|>=\|>\|==\|=\|<=\|<<\|<\|!=\) *\([^)]*\))/(\1 \2)/g
+# normalize space at beginning and end of line
+s/^ *//
+s/ *$//
+p' \
"$DEBIAN_CONTROL"
}