From: Jo-Philipp Wich Date: Fri, 10 Feb 2017 09:43:57 +0000 (+0100) Subject: libopkg: fix --force-checksum to cover sha256sum cases as well X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=commitdiff_plain;h=8bacfad1ee667f711eb58c554d4057de52fecd1d libopkg: fix --force-checksum to cover sha256sum cases as well Signed-off-by: Jo-Philipp Wich --- diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index 0db0acd..acb7530 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -1364,12 +1364,22 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade) file_sha256 = file_sha256sum_alloc(pkg->local_filename); if (file_sha256 && strcmp(file_sha256, pkg->sha256sum)) { - opkg_msg(ERROR, "Package %s sha256sum mismatch. " - "Either the opkg or the package index are corrupt. " - "Try 'opkg update'.\n", - pkg->name); - free(file_sha256); - return -1; + if (!conf->force_checksum) + { + opkg_msg(ERROR, + "Package %s sha256sum mismatch. " + "Either the opkg or the package index are corrupt. " + "Try 'opkg update'.\n", + pkg->name); + free(file_sha256); + return -1; + } + else + { + opkg_msg(NOTICE, + "Ignored %s sha256sum mismatch.\n", + pkg->name); + } } if (file_sha256) free(file_sha256);