pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/pkgformat/pkg reduce-depends.awk: Match version str...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b38d193d8006
branches:  trunk
changeset: 369747:b38d193d8006
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Oct 04 04:13:00 2017 +0000

description:
reduce-depends.awk: Match version strings containing tilde (~).

diffstat:

 mk/pkgformat/pkg/reduce-depends.awk        |   4 ++--
 mk/pkgformat/pkg/tests/reduce-depends_test |  25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diffs (61 lines):

diff -r 89affe5c22e7 -r b38d193d8006 mk/pkgformat/pkg/reduce-depends.awk
--- a/mk/pkgformat/pkg/reduce-depends.awk       Wed Oct 04 03:49:29 2017 +0000
+++ b/mk/pkgformat/pkg/reduce-depends.awk       Wed Oct 04 04:13:00 2017 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/awk -f
 #
-# $NetBSD: reduce-depends.awk,v 1.7 2017/10/01 22:58:19 jlam Exp $
+# $NetBSD: reduce-depends.awk,v 1.8 2017/10/04 04:13:00 jlam Exp $
 #
 # Copyright (c) 2006-2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -145,7 +145,7 @@
 
        # Match version numbers with an ERE.
        # XXX This matches more than it should.
-       VERSION_RE = "[0-9A-Za-z._+]+"
+       VERSION_RE = "[0-9A-Za-z._~+]+"
 
        # Gather all dependencies into the patterns array.  Index 0 of the
        # patterns[pkgpath] array is the number of patterns associated with
diff -r 89affe5c22e7 -r b38d193d8006 mk/pkgformat/pkg/tests/reduce-depends_test
--- a/mk/pkgformat/pkg/tests/reduce-depends_test        Wed Oct 04 03:49:29 2017 +0000
+++ b/mk/pkgformat/pkg/tests/reduce-depends_test        Wed Oct 04 04:13:00 2017 +0000
@@ -374,6 +374,30 @@
 }
 
 ###
+### tildes_in_versions_test
+###
+
+atf_test_case tildes_in_versions_test
+
+tildes_in_versions_test_head()
+{
+       atf_set "descr" "tildes in versions strings"
+}
+
+tildes_in_versions_test_body()
+{
+       cat > input << EOF
+pkg_install>=1~1:../../pkgtools/pkg_install
+pkg_install<2:../../pkgtools/pkg_install
+EOF
+       cat > expected << EOF
+pkg_install>=1~1<2:../../pkgtools/pkg_install
+EOF
+       check_reduce input expected
+       atf_pass
+}
+
+###
 ### multiple_package_dependencies_test
 ###
 
@@ -417,5 +441,6 @@
        atf_add_test_case disjoint_test
        atf_add_test_case strings_in_versions_test
        atf_add_test_case underscores_in_versions_test
+       atf_add_test_case tildes_in_versions_test
        atf_add_test_case multiple_package_dependencies_test
 }



Home | Main Index | Thread Index | Old Index