Commit 93de62b2 authored by Ross Burton's avatar Ross Burton Committed by Jo-Philipp Wich
Browse files

opkg_cmd: fix return of opkg compare-versions



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: default avatarRoss Burton <ross.burton@intel.com>
parent 51275a87
......@@ -1222,7 +1222,7 @@ static int opkg_compare_versions_cmd(int argc, char **argv)
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"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment