From patchwork Fri May 17 23:37:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 164435 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2768783ili; Fri, 17 May 2019 16:37:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjOq40wB3/S9kkzAjqdchRxn0bu7cB8ZxeETRbpOd4NARFVue2PAP364LPHMNFkOMzbARp X-Received: by 2002:a65:620a:: with SMTP id d10mr5799486pgv.42.1558136273428; Fri, 17 May 2019 16:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558136273; cv=none; d=google.com; s=arc-20160816; b=UR3CmJ/GWop8vhI8qF3SRnb/JnQw9Hi/gYvhcCdneMOMJrV9h2wMb8GtNvwFdT946m zFRE0UI+QCSSdWcpMU0uiv0YhvCtEMaf7E8MlbcLDIBctlVMugEDjzrYA2zRMfzTkbHk ZrRF45rZHrakVQjZiZHA/aUQX5VZRbzyTmdz+O5wsffbrDwfWGY7HJl7rOxg5rEYK/Ux MZLo1sVHwZnr9Wze9iijbIyQBAD1TyuB6t6g7GJ3ZgYXq7REszlb/z1h7xUL9kPodihi Sagz7aPZ3n45rrHtiRcqS/FwrHHkaEOs74Y4sQIWbjPh4cjIK7+cKOnLoGbeY3Mj3QGd 9LaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=oJQXgkCLvuIsOrgdIUge0PEXOa4sPV71IL0azmBAGqY=; b=UBomvIZ20WnOFJ5L5nf0UGEW8pseiKayMhNhU6QIM4R+SpnPs/ySWhV/nMNyEentV9 I0EQXU9//vglB0Kc9mDMZjpWy/E0cAwWOVO2Rdk2NTtHfvH1TsmksJTzLdjXNRLwZgKp B8wyjYjcOS+5IskRYrhd8DhqPs1Ro66mgy4oq7RBrWqRsQ4pmoYBPH/zsRLu1GI1P6Jw B6aqO7cyeBq/1/aQSCxFs1J9dBlbk9klPq5NxE5ku6nkZZ1CHBat1zesD2ENf6sfl9fP 9aUG4ukKULg4xOvGVIfabJZ9lsu73bmTAFvytZHxBzSx3THWDWZavSMBvRIV7U83ob2Y Vhrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Hb5Z0zBx; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id h1si4160993pgs.290.2019.05.17.16.37.52; Fri, 17 May 2019 16:37:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Hb5Z0zBx; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 438387E033; Fri, 17 May 2019 23:37:49 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by mail.openembedded.org (Postfix) with ESMTP id DF3097CFF8 for ; Fri, 17 May 2019 23:37:47 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id 145so3981214pgg.9 for ; Fri, 17 May 2019 16:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=dl5sliaXb7sIYiMQ6MQvajX5QPzo2QhReiOI0mJxMlU=; b=Hb5Z0zBx0taasZwdg4fLE4tX2m3/NLkindKEfA4FPMeRVY+8Z7vdneGngkVhIN5Ayv QPDaZLVbBPC2n2VMaMX8g6CwuP/cdMPPxgcW5C+8sSozP/bPP0qw8b1f6C2Pw43n9col I2zGL9OKXohG/ydKCz9+DdAdLRJRy2lJr+r1YBOzjSa2MG+vZFA5/vw0MXyqVMMUHhcR x4k0+L/MF5gJt4dKsVW1vd6FBhDt/XpA0E0wuh9hCxDhFWOMkkaA5kUn5xAVhbDuir/6 pLjiUwx7WM+whxKtuoI07PjsV7yA5wleQGA+Ugag/v7J0kBM2gHzpwW4an6Co3Zrg5J/ 5WfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=dl5sliaXb7sIYiMQ6MQvajX5QPzo2QhReiOI0mJxMlU=; b=MTSP/E6+1kPy33nuRJUzTTPhRsTaTDpQeQQyJ+AJxPX6FDENhWezMlcKMyUecdiU/m cvY2ZbEC6fvmZieEp9k5YmksDeiuQJ52FMpYniZS0innegmvg7eyK8lgFp5RBb96aojq q+gkrTif1gvqk4clPhZRsNm+IG6yFaEQYqEGprSuWuH/Dmr45aYSV979Hpiw6iqSMDg1 v6PDbd/F6W2V2zeSSaYg/pU/BtrsZfwWlcSdm6IWZ2EfsvEmc989OJYhUvPgttXlK2r2 Pz5Ffz+ObdxZlwwtTlA1NEDw3daXfcGGc34arAWCu7Vcv7oY4Migkc2RaN6YdRE+pNsy H8Jg== X-Gm-Message-State: APjAAAVXetM8KZzTVhPkUJB8WRRAZNk8+NyCqSjn3bQ83d5OiGJX4PzA Ov2nredukOrCysJmvcJg5lbRkX7Ao20= X-Received: by 2002:aa7:90ce:: with SMTP id k14mr62698461pfk.239.1558136268694; Fri, 17 May 2019 16:37:48 -0700 (PDT) Received: from blackadder.jf.intel.com (fmdmzpr04-ext.fm.intel.com. [192.55.54.39]) by smtp.gmail.com with ESMTPSA id s18sm14734195pgg.64.2019.05.17.16.37.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 May 2019 16:37:47 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Fri, 17 May 2019 16:37:43 -0700 Message-Id: <20190517233743.9646-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [OE-core] [PATCH v2] insane: add sanity checks to SRC_URI X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org The SRC_URI almost definitely shouldn't be using ${PN}, and GitHub */archive/* tarballs are dynamically generated so the checksums will change over time. Detect both of these, and emit a QA warning if found. Signed-off-by: Ross Burton --- meta/classes/insane.bbclass | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.20.1 (Apple Git-117) -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core Signed-off-by: Ross Burton <ross.burton@intel.com>
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 9ca5aefe544..59bb8be5470 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -25,7 +25,7 @@ QA_SANE = "True" WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \ textrel already-stripped incompatible-license files-invalid \ installed-vs-shipped compile-host-path install-host-path \ - pn-overrides infodir build-deps \ + pn-overrides infodir build-deps src-uri-bad \ unknown-configure-option symlink-to-sysroot multilib \ invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \ " @@ -898,6 +898,17 @@ def package_qa_check_host_user(path, name, d, elf, messages): return False return True +QARECIPETEST[src-uri-bad] = "package_qa_check_src_uri" +def package_qa_check_src_uri(pn, d, messages): + import re + + if "${PN}" in d.getVar("SRC_URI", False): + package_qa_handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d) + + pn = d.getVar("SRC_URI") + if re.search(r"github\.com/.+/.+/archive/.+", pn): + package_qa_handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub archives" % pn, d) + # The PACKAGE FUNC to scan each package python do_package_qa () {