The implementation of opkg compare-version was simply returning the return value
of pkg_version_satisfied(), which returns a boolean. This results in inverted
logic in that:
$ opkg compare-version 1.0 == 1.0 || echo different
different
That's clearly not right. As nobody had noticed this before presumably nobody
was actually using this (likely either opkg-compare-version or
opkg-compare-versions.sh) just change the return value so it's correct.
Signed-off-by: Ross Burton <ross.burton@intel.com>
struct pkg p1, p2;
parse_version(&p1, argv[0]);
parse_version(&p2, argv[2]);
- return pkg_version_satisfied(&p1, &p2, argv[1]);
+ return pkg_version_satisfied(&p1, &p2, argv[1]) ? 0 : 1;
} else {
opkg_msg(ERROR,
"opkg compare_versions <v1> <op> <v2>\n"