pax_global_header00006660000000000000000000000064141214775610014522gustar00rootroot0000000000000052 comment=a6a7997984ad16a08f03f800446ad0a7b3ade95d golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/000077500000000000000000000000001412147756100231765ustar00rootroot00000000000000golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/.github/000077500000000000000000000000001412147756100245365ustar00rootroot00000000000000golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/.github/workflows/000077500000000000000000000000001412147756100265735ustar00rootroot00000000000000golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/.github/workflows/test.yml000066400000000000000000000006071412147756100303000ustar00rootroot00000000000000name: Test on: push: branches: - master pull_request: jobs: unittest: name: Unit Test runs-on: ubuntu-latest steps: - name: Set up Go uses: actions/setup-go@v1 with: go-version: 1.14 id: go - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Run unit tests run: go test ./... golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/.gitignore000066400000000000000000000004151412147756100251660ustar00rootroot00000000000000# Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Dependency directories (remove the comment below to include it) # vendor/ golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/LICENSE000066400000000000000000000261351412147756100242120ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/README.md000066400000000000000000000035611412147756100244620ustar00rootroot00000000000000# go-apk-version ![Test](https://github.com/knqyf263/go-apk-version/workflows/Test/badge.svg?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/knqyf263/go-apk-version)](https://goreportcard.com/report/github.com/knqyf263/go-apk-version) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/knqyf263/go-apk-version/blob/master/LICENSE) A Go library for parsing apk package versions go-apk-version is a library for parsing and comparing versions The implementation is based on [this implementation](https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/master/src/version.c) OS: Alpine # Installation and Usage Installation can be done with a normal go get: ``` $ go get github.com/knqyf263/go-apk-version ``` ## Version Parsing and Comparison ``` import "github.com/knqyf263/go-apk-version" v1, err := version.NewVersion("1.2.3") v2, err := version.NewVersion("1.2.3-r1") // Comparison example. You can use GreaterThan and Equal as well. if v1.LessThan(v2) { fmt.Printf("%s is less than %s", v1, v2) } ``` ## Version Sorting ``` raw := []string{"1.2.3", "1.2.3_alpha1", "1.2.3-r1", "1.2.4", "1.0_p9-r0"} vs := make([]version.Version, len(raw)) for i, r := range raw { v, _ := version.NewVersion(r) vs[i] = v } sort.Slice(vs, func(i, j int) bool { return vs[i].LessThan(vs[j]) }) ``` # Contribute 1. fork a repository: github.com/knqyf263/go-apk-version to github.com/you/repo 2. get original code: `go get github.com/knqyf263/go-apk-version` 3. work on original code 4. add remote to your repo: git remote add myfork https://github.com/you/repo.git 5. push your changes: git push myfork 6. create a new Pull Request - see [GitHub and Go: forking, pull requests, and go-getting](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html) ---- # License Apache License 2.0 # Author Teppei Fukudagolang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/go.mod000066400000000000000000000001371412147756100243050ustar00rootroot00000000000000module github.com/knqyf263/go-apk-version go 1.14 require github.com/stretchr/testify v1.5.1 golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/go.sum000066400000000000000000000017101412147756100243300ustar00rootroot00000000000000github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/version.data000066400000000000000000000302241412147756100255170ustar00rootroot000000000000002.34 > 0.1.0_alpha 23_foo > 4_beta 1.0 < 1.0bc # invalid. do string sort 0.1.0_alpha = 0.1.0_alpha 0.1.0_alpha < 0.1.3_alpha 0.1.3_alpha > 0.1.0_alpha 0.1.0_alpha2 > 0.1.0_alpha 0.1.0_alpha < 2.2.39-r1 2.2.39-r1 > 1.0.4-r3 1.0.4-r3 < 1.0.4-r4 1.0.4-r4 < 1.6 1.6 > 1.0.2 1.0.2 > 0.7-r1 0.7-r1 < 1.0.0 1.0.0 < 1.0.1 1.0.1 < 1.1 1.1 > 1.1_alpha1 1.1_alpha1 < 1.2.1 1.2.1 > 1.2 1.2 < 1.3_alpha 1.3_alpha < 1.3_alpha2 1.3_alpha2 <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r2 < 2.9.3-r1 2.9.3-r1 > 0.9-r1 0.9-r1 > 0.8-r1 0.8-r1 < 1.0.6-r3 1.0.6-r3 > 0.11 0.11 < 0.12 0.12 < 1.2.1-r1 1.2.1-r1 < 1.2.2.1 1.2.2.1 < 1.4.1-r1 1.4.1-r1 < 1.4.1-r2 1.4.1-r2 > 1.2.2 1.2.2 < 1.3 1.3 > 1.0.3-r6 1.0.3-r6 < 1.0.4 1.0.4 < 2.59 2.59 < 20050718-r1 20050718-r1 < 20050718-r2 20050718-r2 > 3.9.8-r5 3.9.8-r5 > 2.01.01_alpha10 2.01.01_alpha10 > 0.94 0.94 < 1.0 1.0 > 0.99.3.20040818 0.99.3.20040818 > 0.7 0.7 < 1.21-r1 1.21-r1 > 0.13 0.13 < 0.90.1-r1 0.90.1-r1 > 0.10.2 0.10.2 < 0.10.3 0.10.3 < 1.6 1.6 < 1.39 1.39 > 1.00_beta2 1.00_beta2 > 0.9.2 0.9.2 < 5.94-r1 5.94-r1 < 6.4 6.4 > 2.6-r5 2.6-r5 > 1.4 1.4 < 2.8.9-r1 2.8.9-r1 > 2.8.9 2.8.9 > 1.1 1.1 > 1.0.3-r2 1.0.3-r2 < 1.3.4-r3 1.3.4-r3 < 2.2 2.2 > 1.2.6 1.2.6 < 7.15.1-r1 7.15.1-r1 > 1.02 1.02 < 1.03-r1 1.03-r1 < 1.12.12-r2 1.12.12-r2 < 2.8.0.6-r1 2.8.0.6-r1 > 0.5.2.7 0.5.2.7 < 4.2.52_p2-r1 4.2.52_p2-r1 < 4.2.52_p4-r2 4.2.52_p4-r2 > 1.02.07 1.02.07 < 1.02.10-r1 1.02.10-r1 < 3.0.3-r9 3.0.3-r9 > 2.0.5-r1 2.0.5-r1 < 4.5 4.5 > 2.8.7-r1 2.8.7-r1 > 1.0.5 1.0.5 < 8 8 < 9 9 > 2.18.3-r10 2.18.3-r10 > 1.05-r18 1.05-r18 < 1.05-r19 1.05-r19 < 2.2.5 2.2.5 < 2.8 2.8 < 2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 4.2.1 4.2.1 > 4.1.0 4.1.0 < 8.11 8.11 > 1.4.4-r1 1.4.4-r1 < 2.1.9.200602141850 2.1.9.200602141850 > 1.6 1.6 < 2.5.1-r8 2.5.1-r8 < 2.5.1a-r1 2.5.1a-r1 > 1.19.2-r1 1.19.2-r1 > 0.97-r2 0.97-r2 < 0.97-r3 0.97-r3 < 1.3.5-r10 1.3.5-r10 > 1.3.5-r8 1.3.5-r8 < 1.3.5-r9 1.3.5-r9 > 1.0 1.0 < 1.1 1.1 > 0.9.11 0.9.11 < 0.9.12 0.9.12 < 0.9.13 0.9.13 < 0.9.14 0.9.14 < 0.9.15 0.9.15 < 0.9.16 0.9.16 > 0.3-r2 0.3-r2 < 6.3 6.3 < 6.6 6.6 < 6.9 6.9 > 0.7.2-r3 0.7.2-r3 < 1.2.10 1.2.10 < 20040923-r2 20040923-r2 > 20040401 20040401 > 2.0.0_rc3-r1 2.0.0_rc3-r1 > 1.5 1.5 < 4.4 4.4 > 1.0.1 1.0.1 < 2.2.0 2.2.0 > 1.1.0-r2 1.1.0-r2 > 0.3 0.3 < 20020207-r2 20020207-r2 > 1.31-r2 1.31-r2 < 3.7 3.7 > 2.0.1 2.0.1 < 2.0.2 2.0.2 > 0.99.163 0.99.163 < 2.6.15.20060110 2.6.15.20060110 < 2.6.16.20060323 2.6.16.20060323 < 2.6.19.20061214 2.6.19.20061214 > 0.6.2-r1 0.6.2-r1 < 0.6.3 0.6.3 < 0.6.5 0.6.5 < 1.3.5-r1 1.3.5-r1 < 1.3.5-r4 1.3.5-r4 < 3.0.0-r2 3.0.0-r2 < 021109-r3 021109-r3 < 20060512 20060512 > 1.24 1.24 > 0.9.16-r1 0.9.16-r1 < 3.9_pre20060124 3.9_pre20060124 > 0.01 0.01 < 0.06 0.06 < 1.1.7 1.1.7 < 6b-r7 6b-r7 > 1.12-r7 1.12-r7 < 1.12-r8 1.12-r8 > 1.1.12 1.1.12 < 1.1.13 1.1.13 > 0.3 0.3 < 0.5 0.5 <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.3.5 0.3.5 < 1.5.22 1.5.22 > 0.1.11 0.1.11 < 0.1.12 0.1.12 < 1.1.4.1 1.1.4.1 > 1.1.0 1.1.0 < 1.1.2 1.1.2 > 1.0.3 1.0.3 > 1.0.2 1.0.2 < 2.6.26 2.6.26 < 2.6.27 2.6.27 > 1.1.17 1.1.17 < 1.4.11 1.4.11 < 22.7-r1 22.7-r1 < 22.7.3-r1 22.7.3-r1 > 22.7 22.7 > 2.1_pre20 2.1_pre20 < 2.1_pre26 2.1_pre26 > 0.2.3-r2 0.2.3-r2 > 0.2.2 0.2.2 < 2.10.0 2.10.0 < 2.10.1 2.10.1 > 02.08.01b 02.08.01b < 4.77 4.77 > 0.17 0.17 < 5.1.1-r1 5.1.1-r1 < 5.1.1-r2 5.1.1-r2 > 5.1.1 5.1.1 > 1.2 1.2 < 5.1 5.1 > 2.02.06 2.02.06 < 2.02.10 2.02.10 < 2.8.5-r3 2.8.5-r3 < 2.8.6-r1 2.8.6-r1 < 2.8.6-r2 2.8.6-r2 > 2.02-r1 2.02-r1 > 1.5.0-r1 1.5.0-r1 > 1.5.0 1.5.0 > 0.9.2 0.9.2 < 8.1.2.20040524-r1 8.1.2.20040524-r1 < 8.1.2.20050715-r1 8.1.2.20050715-r1 < 20030215 20030215 > 3.80-r4 3.80-r4 < 3.81 3.81 > 1.6d 1.6d > 1.2.07.8 1.2.07.8 < 1.2.12.04 1.2.12.04 < 1.2.12.05 1.2.12.05 < 1.3.3 1.3.3 < 2.6.4 2.6.4 > 2.5.2 2.5.2 < 2.6.1 2.6.1 > 2.6 2.6 < 6.5.1-r1 6.5.1-r1 > 1.1.35-r1 1.1.35-r1 < 1.1.35-r2 1.1.35-r2 > 0.9.2 0.9.2 < 1.07-r1 1.07-r1 < 1.07.5 1.07.5 > 1.07 1.07 < 1.19 1.19 < 2.1-r2 2.1-r2 < 2.2 2.2 > 1.0.4 1.0.4 < 20060811 20060811 < 20061003 20061003 > 0.1_pre20060810 0.1_pre20060810 < 0.1_pre20060817 0.1_pre20060817 < 1.0.3 1.0.3 > 1.0.2 1.0.2 > 1.0.1 1.0.1 < 3.2.2-r1 3.2.2-r1 < 3.2.2-r2 3.2.2-r2 < 3.3.17 3.3.17 > 0.59s-r11 0.59s-r11 < 0.65 0.65 > 0.2.10-r2 0.2.10-r2 < 2.01 2.01 < 3.9.10 3.9.10 > 1.2.18 1.2.18 < 1.5.11-r2 1.5.11-r2 < 1.5.13-r1 1.5.13-r1 > 1.3.12-r1 1.3.12-r1 < 2.0.1 2.0.1 < 2.0.2 2.0.2 < 2.0.3 2.0.3 > 0.2.0 0.2.0 < 5.5-r2 5.5-r2 < 5.5-r3 5.5-r3 > 0.25.3 0.25.3 < 0.26.1-r1 0.26.1-r1 < 5.2.1.2-r1 5.2.1.2-r1 < 5.4 5.4 > 1.60-r11 1.60-r11 < 1.60-r12 1.60-r12 < 110-r8 110-r8 > 0.17-r2 0.17-r2 < 1.05-r4 1.05-r4 < 5.28.0 5.28.0 > 0.51.6-r1 0.51.6-r1 < 1.0.6-r6 1.0.6-r6 > 0.8.3 0.8.3 < 1.42 1.42 < 20030719 20030719 > 4.01 4.01 < 4.20 4.20 > 0.20070118 0.20070118 < 0.20070207_rc1 0.20070207_rc1 < 1.0 1.0 < 1.13.0 1.13.0 < 1.13.1 1.13.1 > 0.21 0.21 > 0.3.7-r3 0.3.7-r3 < 0.4.10 0.4.10 < 0.5.0 0.5.0 < 0.5.5 0.5.5 < 0.5.7 0.5.7 < 0.6.11-r1 0.6.11-r1 < 2.3.30-r2 2.3.30-r2 < 3.7_p1 3.7_p1 > 1.3 1.3 > 0.10.1 0.10.1 < 4.3_p2-r1 4.3_p2-r1 < 4.3_p2-r5 4.3_p2-r5 < 4.4_p1-r6 4.4_p1-r6 < 4.5_p1-r1 4.5_p1-r1 > 4.5_p1 4.5_p1 < 4.5_p1-r1 4.5_p1-r1 > 4.5_p1 4.5_p1 > 0.9.8c-r1 0.9.8c-r1 < 0.9.8d 0.9.8d < 2.4.4 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.0.24 = 3.0.24 3.0.24 = 3.0.24 3.0.24 < 4.0.2-r5 4.0.2-r5 < 4.0.3 4.0.3 > 0.98 0.98 < 1.00 1.00 < 4.1.4-r1 4.1.4-r1 < 4.1.5 4.1.5 > 2.3 2.3 < 2.17-r3 2.17-r3 > 0.1.7 0.1.7 < 1.11 1.11 < 4.2.1-r11 4.2.1-r11 > 3.2.3 3.2.3 < 3.2.4 3.2.4 < 3.2.8 3.2.8 < 3.2.9 3.2.9 > 3.2.3 3.2.3 < 3.2.4 3.2.4 < 3.2.8 3.2.8 < 3.2.9 3.2.9 > 1.4.9-r2 1.4.9-r2 < 2.9.11_pre20051101-r2 2.9.11_pre20051101-r2 < 2.9.11_pre20051101-r3 2.9.11_pre20051101-r3 > 2.9.11_pre20051101 2.9.11_pre20051101 < 2.9.11_pre20061021-r1 2.9.11_pre20061021-r1 < 2.9.11_pre20061021-r2 2.9.11_pre20061021-r2 < 5.36-r1 5.36-r1 > 1.0.1 1.0.1 < 7.0-r2 7.0-r2 > 2.4.5 2.4.5 < 2.6.1.2 2.6.1.2 < 2.6.1.3-r1 2.6.1.3-r1 > 2.6.1.3 2.6.1.3 < 2.6.1.3-r1 2.6.1.3-r1 < 12.17.9 12.17.9 > 1.1.12 1.1.12 > 1.1.7 1.1.7 < 2.5.14 2.5.14 < 2.6.6-r1 2.6.6-r1 < 2.6.7 2.6.7 < 2.6.9-r1 2.6.9-r1 > 2.6.9 2.6.9 > 1.39 1.39 > 0.9 0.9 < 2.61-r2 2.61-r2 < 4.5.14 4.5.14 > 4.09-r1 4.09-r1 > 1.3.1 1.3.1 < 1.3.2-r3 1.3.2-r3 < 1.6.8_p12-r1 1.6.8_p12-r1 > 1.6.8_p9-r2 1.6.8_p9-r2 > 1.3.0-r1 1.3.0-r1 < 3.11 3.11 < 3.20 3.20 > 1.6.11-r1 1.6.11-r1 > 1.6.9 1.6.9 < 5.0.5-r2 5.0.5-r2 > 2.86-r5 2.86-r5 < 2.86-r6 2.86-r6 >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 < 0.3.0 0.3.0 < 1.1.1 1.1.1 < 1.2.0 1.2.0 > 1.1.0 1.1.0 < 1.6.5 1.6.5 > 1.1.0 1.1.0 < 1.4.2 1.4.2 > 1.1.1 1.1.1 < 2.8.1 2.8.1 > 1.2.0 1.2.0 < 4.1.0 4.1.0 > 0.4.1 0.4.1 < 1.9.1 1.9.1 < 2.1.1 2.1.1 > 1.4.1 1.4.1 > 0.9.1-r1 0.9.1-r1 > 0.8.1 0.8.1 < 1.2.1-r1 1.2.1-r1 > 1.1.0 1.1.0 < 1.2.1 1.2.1 > 1.1.0 1.1.0 > 0.1.1 0.1.1 < 1.2.1 1.2.1 < 4.1.0 4.1.0 > 0.2.1-r1 0.2.1-r1 < 1.1.0 1.1.0 < 2.7.11 2.7.11 > 1.0.2-r6 1.0.2-r6 > 1.0.2 1.0.2 > 0.8 0.8 < 1.1.1-r4 1.1.1-r4 < 222 222 > 1.0.1 1.0.1 < 1.2.12-r1 1.2.12-r1 > 1.2.8 1.2.8 < 1.2.9.1-r1 1.2.9.1-r1 > 1.2.9.1 1.2.9.1 < 2.31-r1 2.31-r1 > 2.31 2.31 > 1.2.3-r1 1.2.3-r1 > 1.2.3 1.2.3 < 4.2.5 4.2.5 < 4.3.2-r2 1.3-r0 < 1.3.1-r0 1.3_pre1-r1 < 1.3.2 1.0_p10-r0 > 1.0_p9-r0 0.1.0_alpha_pre2 < 0.1.0_alpha golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/version.go000066400000000000000000000133751412147756100252230ustar00rootroot00000000000000package version import ( "bufio" "errors" "io" "strings" "unicode" ) type parts int const ( tokenInvalid parts = iota - 1 tokenDigitOrZero tokenDigit tokenLetter tokenSuffix tokenSuffixNo tokenRevisionNo tokenEnd ) // Version represents a package version // ref. https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/master/src/version.c type Version string type version bufio.Reader // NewVersion returns a parsed version func NewVersion(ver string) (Version, error) { if !Valid(ver) { // Even if a version is invalid, a caller needs to be able to do sort. return Version(ver), errors.New("invalid version") } return Version(ver), nil } func newVersion(ver string) version { s := strings.NewReader(ver) b := bufio.NewReader(s) return version(*b) } func (v1 *version) nextToken(tokenType parts) parts { n := tokenInvalid v := (*bufio.Reader)(v1) r, size, err := v.ReadRune() if size == 0 && err != nil { if err != io.EOF { return tokenInvalid } n = tokenEnd } if (tokenType == tokenDigit || tokenType == tokenDigitOrZero) && unicode.IsLower(r) { n = tokenLetter } else if tokenType == tokenLetter && unicode.IsDigit(r) { n = tokenDigit } else if tokenType == tokenSuffix && unicode.IsDigit(r) { n = tokenSuffixNo } else { switch r { case '.': n = tokenDigitOrZero case '_': n = tokenSuffix case '-': r, size, err = v.ReadRune() if size == 0 && err == io.EOF { n = tokenInvalid } else { n = tokenRevisionNo } } } if n == tokenEnd || n == tokenLetter || n == tokenDigit || n == tokenSuffixNo { _ = v.UnreadRune() } if n < tokenType { switch { case n == tokenDigitOrZero && tokenType == tokenDigit: return n case n == tokenSuffix && tokenType == tokenSuffixNo: return n case n == tokenDigit && tokenType == tokenLetter: return n default: return tokenInvalid } } return n } var ( preSuffixes = [4]string{"alpha", "beta", "pre", "rc"} postSuffixes = [5]string{"cvs", "svn", "git", "hg", "p"} ) func (v1 *version) getToken(tokenType parts) (int, parts, error) { nt := tokenInvalid var value int v := (*bufio.Reader)(v1) r, size, err := v.ReadRune() if size == 0 && err != nil && err != io.EOF { return 0, tokenType, err } switch tokenType { case tokenDigitOrZero: /* Leading zero digits get a special treatment */ if r == '0' { for { value -= 1 r, size, err := v.ReadRune() if err != nil && err != io.EOF { return 0, tokenType, err } if size == 0 && err == io.EOF { break } if r != '0' { _ = v.UnreadRune() break } } nt = tokenDigit break } fallthrough case tokenDigit, tokenSuffixNo, tokenRevisionNo: for unicode.IsDigit(r) { value *= 10 value += int(r - '0') r, size, err = v.ReadRune() if err != nil && err != io.EOF { return 0, tokenType, err } if size == 0 && err == io.EOF { break } } _ = v.UnreadRune() case tokenLetter: value = int(r) case tokenSuffix: _ = v.UnreadRune() for i, s := range preSuffixes { b, err := v.Peek(len(s)) if err != nil && err != io.EOF { return 0, tokenType, err } if string(b) == s { value = i - len(preSuffixes) _, _ = v.Discard(len(s)) break } } if value != 0 { break } value = -1 for i, s := range postSuffixes { b, err := v.Peek(len(s)) if err != nil && err != io.EOF { return 0, tokenType, err } if string(b) == s { value = i _, _ = v.Discard(len(s)) break } } if value >= 0 { break } /* fallthrough: invalid suffix */ fallthrough default: tokenType = tokenInvalid return -1, tokenType, nil } if _, err = v.Peek(1); err == io.EOF { tokenType = tokenEnd } else if nt != tokenInvalid { tokenType = nt } else { tokenType = v1.nextToken(tokenType) } return value, tokenType, nil } const ( apkVersionEqual = 0 apkVersionLess = -1 apkVersionGreater = 1 ) // Valid validates the version func Valid(ver string) bool { t := tokenDigit v := newVersion(ver) for t != tokenEnd && t != tokenInvalid { _, t, _ = v.getToken(t) } return t == tokenEnd } // Equal returns whether this version is equal with another version. func (v1 *Version) Equal(v2 Version) bool { return v1.Compare(v2) == 0 } // GreaterThan returns whether this version is greater than another version. func (v1 *Version) GreaterThan(v2 Version) bool { return v1.Compare(v2) > 0 } // LessThan returns whether this version is less than another version. func (v1 Version) LessThan(v2 Version) bool { return v1.Compare(v2) < 0 } // Compare returns an integer comparing two version according to apk version. // The result will be 0 if v1==v2, -1 if v1 < v2, and +1 if v1 > v2. func (v1 Version) Compare(v2 Version) int { return compare(v1, v2) } func compare(ver1, ver2 Version) int { v1 := newVersion(string(ver1)) v2 := newVersion(string(ver2)) at := tokenDigit bt := tokenDigit var av, bv int for at == bt && at != tokenEnd && at != tokenInvalid && av == bv { // err is not supposed to happen av, at, _ = v1.getToken(at) bv, bt, _ = v2.getToken(bt) } /* value of this token differs? */ if av < bv { return apkVersionLess } else if av > bv { return apkVersionGreater } /* both have TOKEN_END or TOKEN_INVALID next? */ if at == bt { return apkVersionEqual } /* leading version components and their values are equal, * now the non-terminating version is greater unless it's a suffix * indicating pre-release */ if at == tokenSuffix { v, _, _ := v1.getToken(at) if v < 0 { return apkVersionLess } } if bt == tokenSuffix { v, _, err := v2.getToken(bt) if err != nil { return 0 } if v < 0 { return apkVersionGreater } } if at > bt { return apkVersionLess } else if at < bt { return apkVersionGreater } return apkVersionEqual } golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/version_test.go000066400000000000000000000057671412147756100262700ustar00rootroot00000000000000package version import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestNewVersion(t *testing.T) { tests := []struct { name string ver string wantErr bool }{ { name: "happy path", ver: "1.2.3", }, { name: "happy path with pre suffix", ver: "1.2.3_alpha1", }, { name: "happy path with post suffix", ver: "1.2.3-r1", }, { name: "happy path with 2 pre suffixes", ver: "0.1.0_alpha_pre2", }, { name: "happy path with alphabets", ver: "1.0b", }, { name: "sad path", ver: "1.0bc", wantErr: true, }, { name: "invalid symbol", ver: "1.0!", wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { _, err := NewVersion(tt.ver) if (err != nil) != tt.wantErr { assert.Equal(t, tt.wantErr, err) } }) } } func TestVersion_Compare(t *testing.T) { for _, tt := range cases { t.Run(tt.v1+" vs "+tt.v2, func(t *testing.T) { a, _ := NewVersion(tt.v1) b, _ := NewVersion(tt.v2) got := a.Compare(b) var expected int switch tt.expected { case ">": expected = apkVersionGreater case "<": expected = apkVersionLess case "=": expected = apkVersionEqual default: require.Fail(t, "unknown symbol: %s", tt.expected) } assert.Equal(t, expected, got) }) } } func TestVersion_CompareMultipleTimes(t *testing.T) { a, _ := NewVersion("1.2.3") b, _ := NewVersion("1.2.3") got := a.Compare(b) assert.Equal(t, 0, got) b, _ = NewVersion("1.2.3_pre1") got = a.Compare(b) assert.True(t, got > 0) b, _ = NewVersion("1.2.3-r1") got = a.Compare(b) assert.True(t, got < 0) } func TestVersion_Equal(t *testing.T) { for _, tt := range cases { t.Run(tt.v1+" is equal to "+tt.v2, func(t *testing.T) { a, _ := NewVersion(tt.v1) b, _ := NewVersion(tt.v2) got := a.Equal(b) var expected bool switch tt.expected { case ">", "<": expected = false case "=": expected = true default: require.Fail(t, "unknown symbol: %s", tt.expected) } assert.Equal(t, expected, got) }) } } func TestVersion_GreaterThan(t *testing.T) { for _, tt := range cases { t.Run(tt.v1+" is greater than "+tt.v2, func(t *testing.T) { a, _ := NewVersion(tt.v1) b, _ := NewVersion(tt.v2) got := a.GreaterThan(b) var expected bool switch tt.expected { case "<", "=": expected = false case ">": expected = true default: require.Fail(t, "unknown symbol: %s", tt.expected) } assert.Equal(t, expected, got) }) } } func TestVersion_LessThan(t *testing.T) { for _, tt := range cases { t.Run(tt.v1+" is less than "+tt.v2, func(t *testing.T) { a, _ := NewVersion(tt.v1) b, _ := NewVersion(tt.v2) got := a.LessThan(b) var expected bool switch tt.expected { case ">", "=": expected = false case "<": expected = true default: require.Fail(t, "unknown symbol: %s", tt.expected) } assert.Equal(t, expected, got) }) } } golang-github-knqyf263-go-apk-version-0.0~git20200609.041fdbb/version_testcase.go000066400000000000000000000515411412147756100271130ustar00rootroot00000000000000package version var cases = []struct { v1 string expected string v2 string }{ // $ cat version.data | awk '{printf("{\""$1"\", \""$2"\", \""$3"\"},\n")}' {"2.34", ">", "0.1.0_alpha"}, {"23_foo", ">", "4_beta"}, {"1.0", "<", "1.0bc"}, // invalid. do string sort {"0.1.0_alpha", "=", "0.1.0_alpha"}, {"0.1.0_alpha", "<", "0.1.3_alpha"}, {"0.1.3_alpha", ">", "0.1.0_alpha"}, {"0.1.0_alpha2", ">", "0.1.0_alpha"}, {"0.1.0_alpha", "<", "2.2.39-r1"}, {"2.2.39-r1", ">", "1.0.4-r3"}, {"1.0.4-r3", "<", "1.0.4-r4"}, {"1.0.4-r4", "<", "1.6"}, {"1.6", ">", "1.0.2"}, {"1.0.2", ">", "0.7-r1"}, {"0.7-r1", "<", "1.0.0"}, {"1.0.0", "<", "1.0.1"}, {"1.0.1", "<", "1.1"}, {"1.1", ">", "1.1_alpha1"}, {"1.1_alpha1", "<", "1.2.1"}, {"1.2.1", ">", "1.2"}, {"1.2", "<", "1.3_alpha"}, {"1.3_alpha", "<", "1.3_alpha2"}, {"1.3_alpha2", "<", "1.3_alpha3"}, {"1.3_alpha8", ">", "0.6.0"}, {"0.6.0", "<", "0.6.1"}, {"0.6.1", "<", "0.7.0"}, {"0.7.0", "<", "0.8_beta1"}, {"0.8_beta1", "<", "0.8_beta2"}, {"0.8_beta4", "<", "4.8-r1"}, {"4.8-r1", ">", "3.10.18-r1"}, {"3.10.18-r1", ">", "2.3.0b-r1"}, {"2.3.0b-r1", "<", "2.3.0b-r2"}, {"2.3.0b-r2", "<", "2.3.0b-r3"}, {"2.3.0b-r3", "<", "2.3.0b-r4"}, {"2.3.0b-r4", ">", "0.12.1"}, {"0.12.1", "<", "0.12.2"}, {"0.12.2", "<", "0.12.3"}, {"0.12.3", ">", "0.12"}, {"0.12", "<", "0.13_beta1"}, {"0.13_beta1", "<", "0.13_beta2"}, {"0.13_beta2", "<", "0.13_beta3"}, {"0.13_beta3", "<", "0.13_beta4"}, {"0.13_beta4", "<", "0.13_beta5"}, {"0.13_beta5", ">", "0.9.12"}, {"0.9.12", "<", "0.9.13"}, {"0.9.13", ">", "0.9.12"}, {"0.9.12", "<", "0.9.13"}, {"0.9.13", ">", "0.0.16"}, {"0.0.16", "<", "0.6"}, {"0.6", "<", "2.1.13-r3"}, {"2.1.13-r3", "<", "2.1.15-r2"}, {"2.1.15-r2", "<", "2.1.15-r3"}, {"2.1.15-r3", ">", "1.2.11"}, {"1.2.11", "<", "1.2.12.1"}, {"1.2.12.1", "<", "1.2.13"}, {"1.2.13", "<", "1.2.14-r1"}, {"1.2.14-r1", ">", "0.7.1"}, {"0.7.1", ">", "0.5.4"}, {"0.5.4", "<", "0.7.0"}, {"0.7.0", "<", "1.2.13"}, {"1.2.13", ">", "1.0.8"}, {"1.0.8", "<", "1.2.1"}, {"1.2.1", ">", "0.7-r1"}, {"0.7-r1", "<", "2.4.32"}, {"2.4.32", "<", "2.8-r4"}, {"2.8-r4", ">", "0.9.6"}, {"0.9.6", ">", "0.2.0-r1"}, {"0.2.0-r1", "=", "0.2.0-r1"}, {"0.2.0-r1", "<", "3.1_p16"}, {"3.1_p16", "<", "3.1_p17"}, {"3.1_p17", ">", "1.06-r6"}, {"1.06-r6", "<", "006"}, {"006", ">", "1.0.0"}, {"1.0.0", "<", "1.2.2-r1"}, {"1.2.2-r1", ">", "1.2.2"}, {"1.2.2", ">", "0.3-r1"}, {"0.3-r1", "<", "9.3.2-r4"}, {"9.3.2-r4", "<", "9.3.4-r2"}, {"9.3.4-r2", ">", "9.3.4"}, {"9.3.4", ">", "9.3.2"}, {"9.3.2", "<", "9.3.4"}, {"9.3.4", ">", "1.1.3"}, {"1.1.3", "<", "2.16.1-r3"}, {"2.16.1-r3", "=", "2.16.1-r3"}, {"2.16.1-r3", ">", "2.1.0-r2"}, {"2.1.0-r2", "<", "2.9.3-r1"}, {"2.9.3-r1", ">", "0.9-r1"}, {"0.9-r1", ">", "0.8-r1"}, {"0.8-r1", "<", "1.0.6-r3"}, {"1.0.6-r3", ">", "0.11"}, {"0.11", "<", "0.12"}, {"0.12", "<", "1.2.1-r1"}, {"1.2.1-r1", "<", "1.2.2.1"}, {"1.2.2.1", "<", "1.4.1-r1"}, {"1.4.1-r1", "<", "1.4.1-r2"}, {"1.4.1-r2", ">", "1.2.2"}, {"1.2.2", "<", "1.3"}, {"1.3", ">", "1.0.3-r6"}, {"1.0.3-r6", "<", "1.0.4"}, {"1.0.4", "<", "2.59"}, {"2.59", "<", "20050718-r1"}, {"20050718-r1", "<", "20050718-r2"}, {"20050718-r2", ">", "3.9.8-r5"}, {"3.9.8-r5", ">", "2.01.01_alpha10"}, {"2.01.01_alpha10", ">", "0.94"}, {"0.94", "<", "1.0"}, {"1.0", ">", "0.99.3.20040818"}, {"0.99.3.20040818", ">", "0.7"}, {"0.7", "<", "1.21-r1"}, {"1.21-r1", ">", "0.13"}, {"0.13", "<", "0.90.1-r1"}, {"0.90.1-r1", ">", "0.10.2"}, {"0.10.2", "<", "0.10.3"}, {"0.10.3", "<", "1.6"}, {"1.6", "<", "1.39"}, {"1.39", ">", "1.00_beta2"}, {"1.00_beta2", ">", "0.9.2"}, {"0.9.2", "<", "5.94-r1"}, {"5.94-r1", "<", "6.4"}, {"6.4", ">", "2.6-r5"}, {"2.6-r5", ">", "1.4"}, {"1.4", "<", "2.8.9-r1"}, {"2.8.9-r1", ">", "2.8.9"}, {"2.8.9", ">", "1.1"}, {"1.1", ">", "1.0.3-r2"}, {"1.0.3-r2", "<", "1.3.4-r3"}, {"1.3.4-r3", "<", "2.2"}, {"2.2", ">", "1.2.6"}, {"1.2.6", "<", "7.15.1-r1"}, {"7.15.1-r1", ">", "1.02"}, {"1.02", "<", "1.03-r1"}, {"1.03-r1", "<", "1.12.12-r2"}, {"1.12.12-r2", "<", "2.8.0.6-r1"}, {"2.8.0.6-r1", ">", "0.5.2.7"}, {"0.5.2.7", "<", "4.2.52_p2-r1"}, {"4.2.52_p2-r1", "<", "4.2.52_p4-r2"}, {"4.2.52_p4-r2", ">", "1.02.07"}, {"1.02.07", "<", "1.02.10-r1"}, {"1.02.10-r1", "<", "3.0.3-r9"}, {"3.0.3-r9", ">", "2.0.5-r1"}, {"2.0.5-r1", "<", "4.5"}, {"4.5", ">", "2.8.7-r1"}, {"2.8.7-r1", ">", "1.0.5"}, {"1.0.5", "<", "8"}, {"8", "<", "9"}, {"9", ">", "2.18.3-r10"}, {"2.18.3-r10", ">", "1.05-r18"}, {"1.05-r18", "<", "1.05-r19"}, {"1.05-r19", "<", "2.2.5"}, {"2.2.5", "<", "2.8"}, {"2.8", "<", "2.20.1"}, {"2.20.1", "<", "2.20.3"}, {"2.20.3", "<", "2.31"}, {"2.31", "<", "2.34"}, {"2.34", "<", "2.38"}, {"2.38", "<", "20050405"}, {"20050405", ">", "1.8"}, {"1.8", "<", "2.11-r1"}, {"2.11-r1", ">", "2.11"}, {"2.11", ">", "0.1.6-r3"}, {"0.1.6-r3", "<", "0.47-r1"}, {"0.47-r1", "<", "0.49"}, {"0.49", "<", "3.6.8-r2"}, {"3.6.8-r2", ">", "1.39"}, {"1.39", "<", "2.43"}, {"2.43", ">", "2.0.6-r1"}, {"2.0.6-r1", ">", "0.2-r6"}, {"0.2-r6", "<", "0.4"}, {"0.4", "<", "1.0.0"}, {"1.0.0", "<", "10-r1"}, {"10-r1", ">", "4"}, {"4", ">", "0.7.3-r2"}, {"0.7.3-r2", ">", "0.7.3"}, {"0.7.3", "<", "1.95.8"}, {"1.95.8", ">", "1.1.19"}, {"1.1.19", ">", "1.1.5"}, {"1.1.5", "<", "6.3.2-r1"}, {"6.3.2-r1", "<", "6.3.3"}, {"6.3.3", ">", "4.17-r1"}, {"4.17-r1", "<", "4.18"}, {"4.18", "<", "4.19"}, {"4.19", ">", "4.3.0"}, {"4.3.0", "<", "4.3.2-r1"}, {"4.3.2-r1", ">", "4.3.2"}, {"4.3.2", ">", "0.68-r3"}, {"0.68-r3", "<", "1.0.0"}, {"1.0.0", "<", "1.0.1"}, {"1.0.1", ">", "1.0.0"}, {"1.0.0", "=", "1.0.0"}, {"1.0.0", "<", "1.0.1"}, {"1.0.1", "<", "2.3.2-r1"}, {"2.3.2-r1", "<", "2.4.2"}, {"2.4.2", "<", "20060720"}, {"20060720", ">", "3.0.20060720"}, {"3.0.20060720", "<", "20060720"}, {"20060720", ">", "1.1"}, {"1.1", "=", "1.1"}, {"1.1", "<", "1.1.1-r1"}, {"1.1.1-r1", "<", "1.1.3-r1"}, {"1.1.3-r1", "<", "1.1.3-r2"}, {"1.1.3-r2", "<", "2.1.10-r2"}, {"2.1.10-r2", ">", "0.7.18-r2"}, {"0.7.18-r2", "<", "0.17-r6"}, {"0.17-r6", "<", "2.6.1"}, {"2.6.1", "<", "2.6.3"}, {"2.6.3", "<", "3.1.5-r2"}, {"3.1.5-r2", "<", "3.4.6-r1"}, {"3.4.6-r1", "<", "3.4.6-r2"}, {"3.4.6-r2", "=", "3.4.6-r2"}, {"3.4.6-r2", ">", "2.0.33"}, {"2.0.33", "<", "2.0.34"}, {"2.0.34", ">", "1.8.3-r2"}, {"1.8.3-r2", "<", "1.8.3-r3"}, {"1.8.3-r3", "<", "4.1"}, {"4.1", "<", "8.54"}, {"8.54", ">", "4.1.4"}, {"4.1.4", ">", "1.2.10-r5"}, {"1.2.10-r5", "<", "4.1.4-r3"}, {"4.1.4-r3", "=", "4.1.4-r3"}, {"4.1.4-r3", "<", "4.2.1"}, {"4.2.1", ">", "4.1.0"}, {"4.1.0", "<", "8.11"}, {"8.11", ">", "1.4.4-r1"}, {"1.4.4-r1", "<", "2.1.9.200602141850"}, {"2.1.9.200602141850", ">", "1.6"}, {"1.6", "<", "2.5.1-r8"}, {"2.5.1-r8", "<", "2.5.1a-r1"}, {"2.5.1a-r1", ">", "1.19.2-r1"}, {"1.19.2-r1", ">", "0.97-r2"}, {"0.97-r2", "<", "0.97-r3"}, {"0.97-r3", "<", "1.3.5-r10"}, {"1.3.5-r10", ">", "1.3.5-r8"}, {"1.3.5-r8", "<", "1.3.5-r9"}, {"1.3.5-r9", ">", "1.0"}, {"1.0", "<", "1.1"}, {"1.1", ">", "0.9.11"}, {"0.9.11", "<", "0.9.12"}, {"0.9.12", "<", "0.9.13"}, {"0.9.13", "<", "0.9.14"}, {"0.9.14", "<", "0.9.15"}, {"0.9.15", "<", "0.9.16"}, {"0.9.16", ">", "0.3-r2"}, {"0.3-r2", "<", "6.3"}, {"6.3", "<", "6.6"}, {"6.6", "<", "6.9"}, {"6.9", ">", "0.7.2-r3"}, {"0.7.2-r3", "<", "1.2.10"}, {"1.2.10", "<", "20040923-r2"}, {"20040923-r2", ">", "20040401"}, {"20040401", ">", "2.0.0_rc3-r1"}, {"2.0.0_rc3-r1", ">", "1.5"}, {"1.5", "<", "4.4"}, {"4.4", ">", "1.0.1"}, {"1.0.1", "<", "2.2.0"}, {"2.2.0", ">", "1.1.0-r2"}, {"1.1.0-r2", ">", "0.3"}, {"0.3", "<", "20020207-r2"}, {"20020207-r2", ">", "1.31-r2"}, {"1.31-r2", "<", "3.7"}, {"3.7", ">", "2.0.1"}, {"2.0.1", "<", "2.0.2"}, {"2.0.2", ">", "0.99.163"}, {"0.99.163", "<", "2.6.15.20060110"}, {"2.6.15.20060110", "<", "2.6.16.20060323"}, {"2.6.16.20060323", "<", "2.6.19.20061214"}, {"2.6.19.20061214", ">", "0.6.2-r1"}, {"0.6.2-r1", "<", "0.6.3"}, {"0.6.3", "<", "0.6.5"}, {"0.6.5", "<", "1.3.5-r1"}, {"1.3.5-r1", "<", "1.3.5-r4"}, {"1.3.5-r4", "<", "3.0.0-r2"}, {"3.0.0-r2", "<", "021109-r3"}, {"021109-r3", "<", "20060512"}, {"20060512", ">", "1.24"}, {"1.24", ">", "0.9.16-r1"}, {"0.9.16-r1", "<", "3.9_pre20060124"}, {"3.9_pre20060124", ">", "0.01"}, {"0.01", "<", "0.06"}, {"0.06", "<", "1.1.7"}, {"1.1.7", "<", "6b-r7"}, {"6b-r7", ">", "1.12-r7"}, {"1.12-r7", "<", "1.12-r8"}, {"1.12-r8", ">", "1.1.12"}, {"1.1.12", "<", "1.1.13"}, {"1.1.13", ">", "0.3"}, {"0.3", "<", "0.5"}, {"0.5", "<", "3.96.1"}, {"3.96.1", "<", "3.97"}, {"3.97", ">", "0.10.0-r1"}, {"0.10.0-r1", ">", "0.10.0"}, {"0.10.0", "<", "0.10.1_rc1"}, {"0.10.1_rc1", ">", "0.9.11"}, {"0.9.11", "<", "394"}, {"394", ">", "2.31"}, {"2.31", ">", "1.0.1"}, {"1.0.1", "=", "1.0.1"}, {"1.0.1", "<", "1.0.3"}, {"1.0.3", ">", "1.0.2"}, {"1.0.2", "=", "1.0.2"}, {"1.0.2", ">", "1.0.1"}, {"1.0.1", "=", "1.0.1"}, {"1.0.1", "<", "1.2.2"}, {"1.2.2", "<", "2.1.10"}, {"2.1.10", ">", "1.0.1"}, {"1.0.1", "<", "1.0.2"}, {"1.0.2", "<", "3.5.5"}, {"3.5.5", ">", "1.1.1"}, {"1.1.1", ">", "0.9.1"}, {"0.9.1", "<", "1.0.2"}, {"1.0.2", ">", "1.0.1"}, {"1.0.1", "<", "1.0.2"}, {"1.0.2", ">", "1.0.1"}, {"1.0.1", "=", "1.0.1"}, {"1.0.1", "<", "1.0.5"}, {"1.0.5", ">", "0.8.5"}, {"0.8.5", "<", "0.8.6-r3"}, {"0.8.6-r3", "<", "2.3.17"}, {"2.3.17", ">", "1.10-r5"}, {"1.10-r5", "<", "1.10-r9"}, {"1.10-r9", "<", "2.0.2"}, {"2.0.2", ">", "1.1a"}, {"1.1a", "<", "1.3a"}, {"1.3a", ">", "1.0.2"}, {"1.0.2", "<", "1.2.2-r1"}, {"1.2.2-r1", ">", "1.0-r1"}, {"1.0-r1", ">", "0.15.1b"}, {"0.15.1b", "<", "1.0.1"}, {"1.0.1", "<", "1.06-r1"}, {"1.06-r1", "<", "1.06-r2"}, {"1.06-r2", ">", "0.15.1b-r2"}, {"0.15.1b-r2", ">", "0.15.1b"}, {"0.15.1b", "<", "2.5.7"}, {"2.5.7", ">", "1.1.2.1-r1"}, {"1.1.2.1-r1", ">", "0.0.31"}, {"0.0.31", "<", "0.0.50"}, {"0.0.50", ">", "0.0.16"}, {"0.0.16", "<", "0.0.25"}, {"0.0.25", "<", "0.17"}, {"0.17", ">", "0.5.0"}, {"0.5.0", "<", "1.1.2"}, {"1.1.2", "<", "1.1.3"}, {"1.1.3", "<", "1.1.20"}, {"1.1.20", ">", "0.9.4"}, {"0.9.4", "<", "0.9.5"}, {"0.9.5", "<", "6.3"}, {"6.3", "<", "6.6"}, {"6.6", ">", "6.3"}, {"6.3", "<", "6.6"}, {"6.6", ">", "1.2.12-r1"}, {"1.2.12-r1", "<", "1.2.13"}, {"1.2.13", "<", "1.2.14"}, {"1.2.14", "<", "1.2.15"}, {"1.2.15", "<", "8.0.12"}, {"8.0.12", ">", "8.0.9"}, {"8.0.9", ">", "1.2.3-r1"}, {"1.2.3-r1", "<", "1.2.4-r1"}, {"1.2.4-r1", ">", "0.1"}, {"0.1", "<", "0.3.5"}, {"0.3.5", "<", "1.5.22"}, {"1.5.22", ">", "0.1.11"}, {"0.1.11", "<", "0.1.12"}, {"0.1.12", "<", "1.1.4.1"}, {"1.1.4.1", ">", "1.1.0"}, {"1.1.0", "<", "1.1.2"}, {"1.1.2", ">", "1.0.3"}, {"1.0.3", ">", "1.0.2"}, {"1.0.2", "<", "2.6.26"}, {"2.6.26", "<", "2.6.27"}, {"2.6.27", ">", "1.1.17"}, {"1.1.17", "<", "1.4.11"}, {"1.4.11", "<", "22.7-r1"}, {"22.7-r1", "<", "22.7.3-r1"}, {"22.7.3-r1", ">", "22.7"}, {"22.7", ">", "2.1_pre20"}, {"2.1_pre20", "<", "2.1_pre26"}, {"2.1_pre26", ">", "0.2.3-r2"}, {"0.2.3-r2", ">", "0.2.2"}, {"0.2.2", "<", "2.10.0"}, {"2.10.0", "<", "2.10.1"}, {"2.10.1", ">", "02.08.01b"}, {"02.08.01b", "<", "4.77"}, {"4.77", ">", "0.17"}, {"0.17", "<", "5.1.1-r1"}, {"5.1.1-r1", "<", "5.1.1-r2"}, {"5.1.1-r2", ">", "5.1.1"}, {"5.1.1", ">", "1.2"}, {"1.2", "<", "5.1"}, {"5.1", ">", "2.02.06"}, {"2.02.06", "<", "2.02.10"}, {"2.02.10", "<", "2.8.5-r3"}, {"2.8.5-r3", "<", "2.8.6-r1"}, {"2.8.6-r1", "<", "2.8.6-r2"}, {"2.8.6-r2", ">", "2.02-r1"}, {"2.02-r1", ">", "1.5.0-r1"}, {"1.5.0-r1", ">", "1.5.0"}, {"1.5.0", ">", "0.9.2"}, {"0.9.2", "<", "8.1.2.20040524-r1"}, {"8.1.2.20040524-r1", "<", "8.1.2.20050715-r1"}, {"8.1.2.20050715-r1", "<", "20030215"}, {"20030215", ">", "3.80-r4"}, {"3.80-r4", "<", "3.81"}, {"3.81", ">", "1.6d"}, {"1.6d", ">", "1.2.07.8"}, {"1.2.07.8", "<", "1.2.12.04"}, {"1.2.12.04", "<", "1.2.12.05"}, {"1.2.12.05", "<", "1.3.3"}, {"1.3.3", "<", "2.6.4"}, {"2.6.4", ">", "2.5.2"}, {"2.5.2", "<", "2.6.1"}, {"2.6.1", ">", "2.6"}, {"2.6", "<", "6.5.1-r1"}, {"6.5.1-r1", ">", "1.1.35-r1"}, {"1.1.35-r1", "<", "1.1.35-r2"}, {"1.1.35-r2", ">", "0.9.2"}, {"0.9.2", "<", "1.07-r1"}, {"1.07-r1", "<", "1.07.5"}, {"1.07.5", ">", "1.07"}, {"1.07", "<", "1.19"}, {"1.19", "<", "2.1-r2"}, {"2.1-r2", "<", "2.2"}, {"2.2", ">", "1.0.4"}, {"1.0.4", "<", "20060811"}, {"20060811", "<", "20061003"}, {"20061003", ">", "0.1_pre20060810"}, {"0.1_pre20060810", "<", "0.1_pre20060817"}, {"0.1_pre20060817", "<", "1.0.3"}, {"1.0.3", ">", "1.0.2"}, {"1.0.2", ">", "1.0.1"}, {"1.0.1", "<", "3.2.2-r1"}, {"3.2.2-r1", "<", "3.2.2-r2"}, {"3.2.2-r2", "<", "3.3.17"}, {"3.3.17", ">", "0.59s-r11"}, {"0.59s-r11", "<", "0.65"}, {"0.65", ">", "0.2.10-r2"}, {"0.2.10-r2", "<", "2.01"}, {"2.01", "<", "3.9.10"}, {"3.9.10", ">", "1.2.18"}, {"1.2.18", "<", "1.5.11-r2"}, {"1.5.11-r2", "<", "1.5.13-r1"}, {"1.5.13-r1", ">", "1.3.12-r1"}, {"1.3.12-r1", "<", "2.0.1"}, {"2.0.1", "<", "2.0.2"}, {"2.0.2", "<", "2.0.3"}, {"2.0.3", ">", "0.2.0"}, {"0.2.0", "<", "5.5-r2"}, {"5.5-r2", "<", "5.5-r3"}, {"5.5-r3", ">", "0.25.3"}, {"0.25.3", "<", "0.26.1-r1"}, {"0.26.1-r1", "<", "5.2.1.2-r1"}, {"5.2.1.2-r1", "<", "5.4"}, {"5.4", ">", "1.60-r11"}, {"1.60-r11", "<", "1.60-r12"}, {"1.60-r12", "<", "110-r8"}, {"110-r8", ">", "0.17-r2"}, {"0.17-r2", "<", "1.05-r4"}, {"1.05-r4", "<", "5.28.0"}, {"5.28.0", ">", "0.51.6-r1"}, {"0.51.6-r1", "<", "1.0.6-r6"}, {"1.0.6-r6", ">", "0.8.3"}, {"0.8.3", "<", "1.42"}, {"1.42", "<", "20030719"}, {"20030719", ">", "4.01"}, {"4.01", "<", "4.20"}, {"4.20", ">", "0.20070118"}, {"0.20070118", "<", "0.20070207_rc1"}, {"0.20070207_rc1", "<", "1.0"}, {"1.0", "<", "1.13.0"}, {"1.13.0", "<", "1.13.1"}, {"1.13.1", ">", "0.21"}, {"0.21", ">", "0.3.7-r3"}, {"0.3.7-r3", "<", "0.4.10"}, {"0.4.10", "<", "0.5.0"}, {"0.5.0", "<", "0.5.5"}, {"0.5.5", "<", "0.5.7"}, {"0.5.7", "<", "0.6.11-r1"}, {"0.6.11-r1", "<", "2.3.30-r2"}, {"2.3.30-r2", "<", "3.7_p1"}, {"3.7_p1", ">", "1.3"}, {"1.3", ">", "0.10.1"}, {"0.10.1", "<", "4.3_p2-r1"}, {"4.3_p2-r1", "<", "4.3_p2-r5"}, {"4.3_p2-r5", "<", "4.4_p1-r6"}, {"4.4_p1-r6", "<", "4.5_p1-r1"}, {"4.5_p1-r1", ">", "4.5_p1"}, {"4.5_p1", "<", "4.5_p1-r1"}, {"4.5_p1-r1", ">", "4.5_p1"}, {"4.5_p1", ">", "0.9.8c-r1"}, {"0.9.8c-r1", "<", "0.9.8d"}, {"0.9.8d", "<", "2.4.4"}, {"2.4.4", "<", "2.4.7"}, {"2.4.7", ">", "2.0.6"}, {"2.0.6", "=", "2.0.6"}, {"2.0.6", ">", "0.78-r3"}, {"0.78-r3", ">", "0.3.2"}, {"0.3.2", "<", "1.7.1-r1"}, {"1.7.1-r1", "<", "2.5.9"}, {"2.5.9", ">", "0.1.13"}, {"0.1.13", "<", "0.1.15"}, {"0.1.15", "<", "0.4"}, {"0.4", "<", "0.9.6"}, {"0.9.6", "<", "2.2.0-r1"}, {"2.2.0-r1", "<", "2.2.3-r2"}, {"2.2.3-r2", "<", "013"}, {"013", "<", "014-r1"}, {"014-r1", ">", "1.3.1-r1"}, {"1.3.1-r1", "<", "5.8.8-r2"}, {"5.8.8-r2", ">", "5.1.6-r4"}, {"5.1.6-r4", "<", "5.1.6-r6"}, {"5.1.6-r6", "<", "5.2.1-r3"}, {"5.2.1-r3", ">", "0.11.3"}, {"0.11.3", "=", "0.11.3"}, {"0.11.3", "<", "1.10.7"}, {"1.10.7", ">", "1.7-r1"}, {"1.7-r1", ">", "0.1.20"}, {"0.1.20", "<", "0.1.23"}, {"0.1.23", "<", "5b-r9"}, {"5b-r9", ">", "2.2.10"}, {"2.2.10", "<", "2.3.6"}, {"2.3.6", "<", "8.0.12"}, {"8.0.12", ">", "2.4.3-r16"}, {"2.4.3-r16", "<", "2.4.4-r4"}, {"2.4.4-r4", "<", "3.0.3-r5"}, {"3.0.3-r5", "<", "3.0.6"}, {"3.0.6", "<", "3.2.6"}, {"3.2.6", "<", "3.2.7"}, {"3.2.7", ">", "0.3.1_rc8"}, {"0.3.1_rc8", "<", "22.2"}, {"22.2", "<", "22.3"}, {"22.3", ">", "1.2.2"}, {"1.2.2", "<", "2.04"}, {"2.04", "<", "2.4.3-r1"}, {"2.4.3-r1", "<", "2.4.3-r4"}, {"2.4.3-r4", ">", "0.98.6-r1"}, {"0.98.6-r1", "<", "5.7-r2"}, {"5.7-r2", "<", "5.7-r3"}, {"5.7-r3", ">", "5.1_p4"}, {"5.1_p4", ">", "1.0.5"}, {"1.0.5", "<", "3.6.19-r1"}, {"3.6.19-r1", ">", "3.6.19"}, {"3.6.19", ">", "1.0.1"}, {"1.0.1", "<", "3.8"}, {"3.8", ">", "0.2.3"}, {"0.2.3", "<", "1.2.15-r3"}, {"1.2.15-r3", ">", "1.2.6-r1"}, {"1.2.6-r1", "<", "2.6.8-r2"}, {"2.6.8-r2", "<", "2.6.9-r1"}, {"2.6.9-r1", ">", "1.7"}, {"1.7", "<", "1.7b"}, {"1.7b", "<", "1.8.4-r3"}, {"1.8.4-r3", "<", "1.8.5"}, {"1.8.5", "<", "1.8.5_p2"}, {"1.8.5_p2", ">", "1.1.3"}, {"1.1.3", "<", "3.0.22-r3"}, {"3.0.22-r3", "<", "3.0.24"}, {"3.0.24", "=", "3.0.24"}, {"3.0.24", "=", "3.0.24"}, {"3.0.24", "<", "4.0.2-r5"}, {"4.0.2-r5", "<", "4.0.3"}, {"4.0.3", ">", "0.98"}, {"0.98", "<", "1.00"}, {"1.00", "<", "4.1.4-r1"}, {"4.1.4-r1", "<", "4.1.5"}, {"4.1.5", ">", "2.3"}, {"2.3", "<", "2.17-r3"}, {"2.17-r3", ">", "0.1.7"}, {"0.1.7", "<", "1.11"}, {"1.11", "<", "4.2.1-r11"}, {"4.2.1-r11", ">", "3.2.3"}, {"3.2.3", "<", "3.2.4"}, {"3.2.4", "<", "3.2.8"}, {"3.2.8", "<", "3.2.9"}, {"3.2.9", ">", "3.2.3"}, {"3.2.3", "<", "3.2.4"}, {"3.2.4", "<", "3.2.8"}, {"3.2.8", "<", "3.2.9"}, {"3.2.9", ">", "1.4.9-r2"}, {"1.4.9-r2", "<", "2.9.11_pre20051101-r2"}, {"2.9.11_pre20051101-r2", "<", "2.9.11_pre20051101-r3"}, {"2.9.11_pre20051101-r3", ">", "2.9.11_pre20051101"}, {"2.9.11_pre20051101", "<", "2.9.11_pre20061021-r1"}, {"2.9.11_pre20061021-r1", "<", "2.9.11_pre20061021-r2"}, {"2.9.11_pre20061021-r2", "<", "5.36-r1"}, {"5.36-r1", ">", "1.0.1"}, {"1.0.1", "<", "7.0-r2"}, {"7.0-r2", ">", "2.4.5"}, {"2.4.5", "<", "2.6.1.2"}, {"2.6.1.2", "<", "2.6.1.3-r1"}, {"2.6.1.3-r1", ">", "2.6.1.3"}, {"2.6.1.3", "<", "2.6.1.3-r1"}, {"2.6.1.3-r1", "<", "12.17.9"}, {"12.17.9", ">", "1.1.12"}, {"1.1.12", ">", "1.1.7"}, {"1.1.7", "<", "2.5.14"}, {"2.5.14", "<", "2.6.6-r1"}, {"2.6.6-r1", "<", "2.6.7"}, {"2.6.7", "<", "2.6.9-r1"}, {"2.6.9-r1", ">", "2.6.9"}, {"2.6.9", ">", "1.39"}, {"1.39", ">", "0.9"}, {"0.9", "<", "2.61-r2"}, {"2.61-r2", "<", "4.5.14"}, {"4.5.14", ">", "4.09-r1"}, {"4.09-r1", ">", "1.3.1"}, {"1.3.1", "<", "1.3.2-r3"}, {"1.3.2-r3", "<", "1.6.8_p12-r1"}, {"1.6.8_p12-r1", ">", "1.6.8_p9-r2"}, {"1.6.8_p9-r2", ">", "1.3.0-r1"}, {"1.3.0-r1", "<", "3.11"}, {"3.11", "<", "3.20"}, {"3.20", ">", "1.6.11-r1"}, {"1.6.11-r1", ">", "1.6.9"}, {"1.6.9", "<", "5.0.5-r2"}, {"5.0.5-r2", ">", "2.86-r5"}, {"2.86-r5", "<", "2.86-r6"}, {"2.86-r6", ">", "1.15.1-r1"}, {"1.15.1-r1", "<", "8.4.9"}, {"8.4.9", ">", "7.6-r8"}, {"7.6-r8", ">", "3.9.4-r2"}, {"3.9.4-r2", "<", "3.9.4-r3"}, {"3.9.4-r3", "<", "3.9.5-r2"}, {"3.9.5-r2", ">", "1.1.9"}, {"1.1.9", ">", "1.0.6"}, {"1.0.6", "<", "5.9"}, {"5.9", "<", "6.5"}, {"6.5", ">", "0.40-r1"}, {"0.40-r1", "<", "2.25b-r5"}, {"2.25b-r5", "<", "2.25b-r6"}, {"2.25b-r6", ">", "1.0.4"}, {"1.0.4", "<", "1.0.5"}, {"1.0.5", "<", "1.4_p12-r2"}, {"1.4_p12-r2", "<", "1.4_p12-r5"}, {"1.4_p12-r5", ">", "1.1"}, {"1.1", ">", "0.2.0-r1"}, {"0.2.0-r1", "<", "0.2.1"}, {"0.2.1", "<", "0.9.28-r1"}, {"0.9.28-r1", "<", "0.9.28-r2"}, {"0.9.28-r2", "<", "0.9.28.1"}, {"0.9.28.1", ">", "0.9.28"}, {"0.9.28", "<", "0.9.28.1"}, {"0.9.28.1", "<", "087-r1"}, {"087-r1", "<", "103"}, {"103", "<", "104-r11"}, {"104-r11", ">", "104-r9"}, {"104-r9", ">", "1.23-r1"}, {"1.23-r1", ">", "1.23"}, {"1.23", "<", "1.23-r1"}, {"1.23-r1", ">", "1.0.2"}, {"1.0.2", "<", "5.52-r1"}, {"5.52-r1", ">", "1.2.5_rc2"}, {"1.2.5_rc2", ">", "0.1"}, {"0.1", "<", "0.71-r1"}, {"0.71-r1", "<", "20040406-r1"}, {"20040406-r1", ">", "2.12r-r4"}, {"2.12r-r4", "<", "2.12r-r5"}, {"2.12r-r5", ">", "0.0.7"}, {"0.0.7", "<", "1.0.3"}, {"1.0.3", "<", "1.8"}, {"1.8", "<", "7.0.17"}, {"7.0.17", "<", "7.0.174"}, {"7.0.174", ">", "7.0.17"}, {"7.0.17", "<", "7.0.174"}, {"7.0.174", ">", "1.0.1"}, {"1.0.1", "<", "1.1.1-r3"}, {"1.1.1-r3", ">", "0.3.4_pre20061029"}, {"0.3.4_pre20061029", "<", "0.4.0"}, {"0.4.0", ">", "0.1.2"}, {"0.1.2", "<", "1.10.2"}, {"1.10.2", "<", "2.16"}, {"2.16", "<", "28"}, {"28", ">", "0.99.4"}, {"0.99.4", "<", "1.13"}, {"1.13", ">", "1.0.1"}, {"1.0.1", "<", "1.1.2-r2"}, {"1.1.2-r2", ">", "1.1.0"}, {"1.1.0", "<", "1.1.1"}, {"1.1.1", "=", "1.1.1"}, {"1.1.1", ">", "0.6.0"}, {"0.6.0", "<", "6.6.3"}, {"6.6.3", ">", "1.1.1"}, {"1.1.1", ">", "1.1.0"}, {"1.1.0", "=", "1.1.0"}, {"1.1.0", ">", "0.2.0"}, {"0.2.0", "<", "0.3.0"}, {"0.3.0", "<", "1.1.1"}, {"1.1.1", "<", "1.2.0"}, {"1.2.0", ">", "1.1.0"}, {"1.1.0", "<", "1.6.5"}, {"1.6.5", ">", "1.1.0"}, {"1.1.0", "<", "1.4.2"}, {"1.4.2", ">", "1.1.1"}, {"1.1.1", "<", "2.8.1"}, {"2.8.1", ">", "1.2.0"}, {"1.2.0", "<", "4.1.0"}, {"4.1.0", ">", "0.4.1"}, {"0.4.1", "<", "1.9.1"}, {"1.9.1", "<", "2.1.1"}, {"2.1.1", ">", "1.4.1"}, {"1.4.1", ">", "0.9.1-r1"}, {"0.9.1-r1", ">", "0.8.1"}, {"0.8.1", "<", "1.2.1-r1"}, {"1.2.1-r1", ">", "1.1.0"}, {"1.1.0", "<", "1.2.1"}, {"1.2.1", ">", "1.1.0"}, {"1.1.0", ">", "0.1.1"}, {"0.1.1", "<", "1.2.1"}, {"1.2.1", "<", "4.1.0"}, {"4.1.0", ">", "0.2.1-r1"}, {"0.2.1-r1", "<", "1.1.0"}, {"1.1.0", "<", "2.7.11"}, {"2.7.11", ">", "1.0.2-r6"}, {"1.0.2-r6", ">", "1.0.2"}, {"1.0.2", ">", "0.8"}, {"0.8", "<", "1.1.1-r4"}, {"1.1.1-r4", "<", "222"}, {"222", ">", "1.0.1"}, {"1.0.1", "<", "1.2.12-r1"}, {"1.2.12-r1", ">", "1.2.8"}, {"1.2.8", "<", "1.2.9.1-r1"}, {"1.2.9.1-r1", ">", "1.2.9.1"}, {"1.2.9.1", "<", "2.31-r1"}, {"2.31-r1", ">", "2.31"}, {"2.31", ">", "1.2.3-r1"}, {"1.2.3-r1", ">", "1.2.3"}, {"1.2.3", "<", "4.2.5"}, {"4.2.5", "<", "4.3.2-r2"}, {"1.3-r0", "<", "1.3.1-r0"}, {"1.3_pre1-r1", "<", "1.3.2"}, {"1.0_p10-r0", ">", "1.0_p9-r0"}, {"0.1.0_alpha_pre2", "<", "0.1.0_alpha"}, }