aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoïc Minier <lool@dooz.org>2010-01-05 16:30:45 +0100
committerLoïc Minier <lool@dooz.org>2010-01-05 16:30:45 +0100
commit5d3dba6bc84c748906277346c119d116ac56073b (patch)
tree5a6efa9bb3eaecd8a7e148ea27b779ab7ea4ca86
parentc143dc085c7fa6da810f5c205086ebcc8f2a9395 (diff)
downloadpbuilder-5d3dba6bc84c748906277346c119d116ac56073b.tar
pbuilder-5d3dba6bc84c748906277346c119d116ac56073b.tar.gz
Fix get_dep_op_and_ver() output
Fix get_dep_op_and_ver() to not output anything when there is no version and to deal with spaces between version and closing parenthesis.
-rwxr-xr-xpbuilder-satisfydepends-classic2
-rwxr-xr-xtest_pbuilder-satisfydepends-classic2
2 files changed, 2 insertions, 2 deletions
diff --git a/pbuilder-satisfydepends-classic b/pbuilder-satisfydepends-classic
index 6742d4a..56f1abd 100755
--- a/pbuilder-satisfydepends-classic
+++ b/pbuilder-satisfydepends-classic
@@ -51,7 +51,7 @@ get_pkg_name() {
# filter operator and version of a "/" escaped versioned build-dep; e.g.
# "foo/(>=/2)" becomes ">= 2"
get_dep_op_and_ver() {
- echo "$*" | tr "/" " " | sed 's/^.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\(.*\)).*$/\1 \2/'
+ echo "$*" | sed -n 's#/# #g; s/.*( *\(<<\|<=\|>=\|=\|<\|>>\|>\) *\([^ )]*\) *).*/\1 \2/p'
}
# call apt-get in chroot in simulate mode
diff --git a/test_pbuilder-satisfydepends-classic b/test_pbuilder-satisfydepends-classic
index 021ffbe..c97c3d1 100755
--- a/test_pbuilder-satisfydepends-classic
+++ b/test_pbuilder-satisfydepends-classic
@@ -97,6 +97,6 @@ expect_output ">= 5.0.0
>= 0.60
>= 0.3.2-0
>= 0.1.7
->= 0.9.8b-1" get_dep_op_and_ver "`test_split_deps | grep '('`"
+>= 0.9.8b-1" get_dep_op_and_ver "`test_split_deps`"
testlib_summary