From patchwork Sun May 24 15:22:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fieber X-Patchwork-Id: 475976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 624411402B4 for ; Mon, 25 May 2015 01:23:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=florianfieber.de header.i=@florianfieber.de header.b=KzCI+C+3; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id B76BB281084; Sun, 24 May 2015 17:22:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id C1CA728B9AA for ; Sun, 24 May 2015 17:21:55 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .florianfieber. - helo: .mail-wi0-f175.google. - helo-domain: .google.) FROM/MX_MATCHES_NOT_HELO(DOMAIN)=1; rate: -5.5 Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 24 May 2015 17:21:54 +0200 (CEST) Received: by wibt6 with SMTP id t6so28746614wib.0 for ; Sun, 24 May 2015 08:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=florianfieber.de; s=mail; h=from:to:cc:subject:date:message-id; bh=m8jGRdsgoeupg9qUuhbIpXT6YxHfQhfIk1VdoZtnpao=; b=KzCI+C+3bFEnHBMDzoGtUrDlEuHGx8Pdzzmg1st6r4ZspCGuXMi4NI1t3qfNmPrGkP cBuGKOolCEobJR4JmdBf8dfyGCm4zaz99LjNwCSk0AoYZH+dkQu3TRF6eNSlLCzlSJRL gJkg/iB4HXOKt/Y9iMX1xU79+JdkiHpRlJ7qI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=m8jGRdsgoeupg9qUuhbIpXT6YxHfQhfIk1VdoZtnpao=; b=Nf+PpF6F1HEAoa3m6gOqMtXri2Ugb4/q0eyQ3EuUGSdbhRbrz8p8xk/Oc5ckwqoybd SJ1iA2Mo3CWV0RvEkuIEwrmy7eMDPDmb99Yc3kstEKXdXhZj4pEsZUWzXRqVFrteYPDM JJBPYx57ORKcpzBg5nFtq7TW4YC8RjReu8DCBChhgUMR9NkZ5Vrm0JuwoQtX0h5l/26F waL+QfHiJV4x2QcI2f2feglhTHRplwW47gaGqfu8STWP3EKUaND8vywe4ItZWXb8W4LQ qi/+dJuMnlLBtxQShti7y2SWxT4rE/GzNkaolTMTFvZEwMTLvMHiKHbcyh4a6GAdcrUR SH+A== X-Gm-Message-State: ALoCoQldhYEmYIEZ9izqOt+dAws6F6a+oXa8sCUjSAaUlgvtAmI3Wzawx3wYAP/+yoPaW/X3kaPm X-Received: by 10.181.29.36 with SMTP id jt4mr23509122wid.21.1432480999637; Sun, 24 May 2015 08:23:19 -0700 (PDT) Received: from hugin (HSI-KBW-109-192-048-088.hsi6.kabel-badenwuerttemberg.de. [109.192.48.88]) by mx.google.com with ESMTPSA id a19sm7615010wiv.2.2015.05.24.08.23.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 May 2015 08:23:18 -0700 (PDT) Received: from flo by hugin with local (Exim 4.85) (envelope-from ) id 1YwXkD-0004Os-SR; Sun, 24 May 2015 17:23:17 +0200 From: Florian Fieber To: Jo-Philipp Wich Date: Sun, 24 May 2015 17:22:38 +0200 Message-Id: <1432480958-16875-1-git-send-email-florian@florianfieber.de> X-Mailer: git-send-email 2.1.4 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH] [package] opkg: Fix --force-checksum when using SHA256 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Allow installing packages with mismatching SHA256 checksums via $ opkg install --force-checksum $PACKAGE Signed-off-by: Florian Fieber --- .../240-fix-force-checksum-for-sha256.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/system/opkg/patches/240-fix-force-checksum-for-sha256.patch 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);