summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-06-05 14:12:45 +0000
committerJohn Crispin <john@openwrt.org>2015-06-05 14:12:45 +0000
commit72eb909a0db4dfbd96e96a4cd8353e7b22e0be88 (patch)
tree9839111a8a9c33a7fc65b2cd91013ec5b5802157 /package
parent7d8de52d4dfa3c5cfde07ab446f312c43c630961 (diff)
downloadmtk-20170518-72eb909a0db4dfbd96e96a4cd8353e7b22e0be88.zip
mtk-20170518-72eb909a0db4dfbd96e96a4cd8353e7b22e0be88.tar.gz
mtk-20170518-72eb909a0db4dfbd96e96a4cd8353e7b22e0be88.tar.bz2
opkg: Fix --force-checksum when using SHA256
Allow installing packages with mismatching SHA256 checksums via $ opkg install --force-checksum $PACKAGE Signed-off-by: Florian Fieber <florian@florianfieber.de> SVN-Revision: 45904
Diffstat (limited to 'package')
-rw-r--r--package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch b/package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch
new file mode 100644
index 0000000..8af4d40
--- /dev/null
+++ b/package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch
@@ -0,0 +1,31 @@
+--- a/libopkg/opkg_install.c
++++ b/libopkg/opkg_install.c
+@@ -1364,12 +1364,22 @@ opkg_install_pkg(pkg_t *pkg, int from_up
+ 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);