aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch
blob: 8af4d4071d4428dbdcba764906a0bc6bb7ba08d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);