What steps will reproduce the problem? 1. in a shell, run `opkg compare_versions` with various versions and relations. What is the expected output? What do you see instead? When comparing things in Linux, it is typical for 0 to be returned if a condition is satisfied and a non-zero value otherwise. The compare_versions command in opkg does the opposite. Furthermore, several checks return the incorrect value (e.g. 1.0 '=' 1.0 and 1.0 '<<' 1.0 will return 0, while 1.0 '>>' 1.0 will return 1). For reference, calling `dpkg --compare-versions 1.0 '=' 1.0` will return 0, while `dpkg --compare-versions 1.0 '<<' 1.0` and `dpkg --compare-versions 1.0 '>>' 1.0` return 1. What version of the product are you using? On what operating system? 0.3.0, Linux Mint 17.1 x64 Please provide any additional information below. Functionality for checking versions is also provided in opkg-utils in opkg-compare-versions.c . Since the current implementation in opkg_cmd.c is broken and the proper functionality is included in opkg-utils, perhaps we can pull this command out from opkg and encourage the use of the version comparison functionality in opkg-utils instead? Originally reported by ericaustinyu, Jul 23, 2015 -----------------------------------------------------------------------------
Testing comments on opkg bugs with an unprivileged user.
opkg compare versions logic should follow dpkg's: lt le eq ne ge gt (treat empty version as earlier than any version) lt-nl le-nl ge-nl gt-nl (treat empty version as later than any version) Once the internal opkg compare version logic gets fixed, the 2 utilities for comparing versions on opkg-utils should be removed.
fixed on commits by Ross Burton: 3e8521e137f662005edec1e7dd597bdd808624ea d55020a9eee90b092cc468b458882e84a42be49a 17fe7933fa68d5b208c13ae2f9353cbd5375f253