From: Ross Burton Date: Tue, 1 Mar 2016 18:03:29 +0000 (+0000) Subject: opkg_cmd: fix return of opkg compare-versions X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=93de62b22b0fc13ccc47b41fb251a1ca575892cb;p=oweals%2Fopkg-lede.git 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: Ross Burton --- diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index 7d5bd04..ee59021 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -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 \n"