From patchwork Fri May 17 22:48:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 164433 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2729065ili; Fri, 17 May 2019 15:49:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoYPyvEi0bUBC+YZulidmYo18z5A0XkLONhCYVDG5U4tbcxv6J4BsjQ26Wl5jdvkIu1MAG X-Received: by 2002:a63:c54d:: with SMTP id g13mr59879524pgd.376.1558133354490; Fri, 17 May 2019 15:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558133354; cv=none; d=google.com; s=arc-20160816; b=Lg7BdCTPFAEKBJB6jbbtDC+Ih3YnR2ucg7qqGrBMskDqUVMRRrp9lnAF0o6nmC+jgz Vsw/CvowuynSVoxZCaYx1M0Qp3wkZ5TsHPPyrfvDOU2eVv5A0/3fUoXOJTtBJVH1480U zDETBFbiWKfSLGbBRizWJcV9mKeKAE4aDe/e7FcvHkkbeS0sHb4csn4xYQEyumIFisYs wl5LAoMDY1IbcE1pBBwNnz7Bvi4h4YJYj5EmNm7xFH7saCUHNQl+gaV2J6/Dp/gKK0ZX 5xPokA0MwnooxsBb6/RhIrKOI6xuGXsOWN+r02xa90o5wv0c3cfjAcyppcL+/e7CDd+I McDA== 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=Toqb4sMnlxHWl8zk8riHyY3cyGJZ/TZf0M0Fr7YOMek=; b=GBkmmuSnCDmqWctOFHXST9GQKBlq2v4ZUqVReklLi8sbK5+09gRTz0fuxl+5426tFf gxMoa/TvYIjkeIZTkn/U6AUhkyamNDP6TLKgln687cwNTpXXtKCALWOsLj3kw7t6CqFR mDJtZcEJ6K7r2zzGYPTvwImn/+NMZJsp8t4XfGZ2VmIvzQbKn8EiuTN6xhRhsgDTWimg LacPYP87cuWtdm8/9yth/Tq+Fa4ATdrAod3LUlSh1P/9BaBA1rT0D5kiy0GWdrl/1yQq wBpbnSwOAetPkSBwMMNqIXOzVGg/jErw0Ds4PdTjk36bWeSJHMErqCrlk6VvuqMUEDKM BQzw== 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=RziiYO8C; 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 f63si10900630pfh.120.2019.05.17.15.49.13; Fri, 17 May 2019 15:49:14 -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=RziiYO8C; 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 8B1D77E051; Fri, 17 May 2019 22:49:08 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mail.openembedded.org (Postfix) with ESMTP id D98847DF84 for ; Fri, 17 May 2019 22:49:06 +0000 (UTC) Received: by mail-pg1-f174.google.com with SMTP id i21so3932415pgi.12 for ; Fri, 17 May 2019 15:49:08 -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=a4RpvoDG91oue+ZpGvhXtVjzqC0PzdZfM0vUyMmi9qM=; b=RziiYO8CvKa5k3aytkxVIsrNCZ47jDjPoZ28qa94nZ8sqzBgbNUCcVLn1l+RB6wwju bgIkKiNCbmmeMSX4UKfwLyYDHyZs4JqTz4K9aXL0fLlVfA3HbhyNKvR7+j1a9n9ysAsM Oy7SMKYtBFMfAoy/AUZQHUUmaeOzi1GCTRI/JbdnBB3pIpHMAx5lOLeNUUzd1cP5iD7G /gHX0DsUcG+KCnBYS0WX6QjH5drfBfG/y+JWKdA5++GQaqQq74tet8PidrDqVqAjJzbR RkE0JVmmUgEpyxHP36EOAzfOODuHn66nS+GwrxqastmH5WIGDUmqbyipICvR/UvX388y 9kDQ== 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=a4RpvoDG91oue+ZpGvhXtVjzqC0PzdZfM0vUyMmi9qM=; b=hF4e4jcdyfl2g3IJwnMSxtZDfxyeuhxTHFReSRxWzVI6H8LqF3t10pUGX79th0DXth xD9Sw36fW5kQi6AiSMgll2kj8KEivmlC91WdFPv1GNZJoITLuOyibYQZbhUvezjz+Wtp v77fbiCnLmbMYqNXv3Shyr2qor/hCINZGvyPuQOYMdrHnyQfNpkwX9xOuY/EpdSz53TW 3Vz5LCaJSlvlG3hFcHAhRr9a2pW1EwbD8QgVHd2YEkDxKizxgoakGXC+7vCQBQdS5bUL DIF4a7EGtrOd0Dm5Jjh40g3j2Sb7GVQ+bgkvzhkF7JtayybQdK4FFXx+3zGpMzygHiFm 82sQ== X-Gm-Message-State: APjAAAVU8JhTR3pMZf3O4cp1OgtzF6ZY30FX2mzkjpwWQY5b2ClaHB0j k9m+CCNU2UghMIzacQII+vDVRkqkpeI= X-Received: by 2002:a62:198e:: with SMTP id 136mr45245391pfz.180.1558133347606; Fri, 17 May 2019 15:49:07 -0700 (PDT) Received: from blackadder.jf.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id a6sm12024913pgd.67.2019.05.17.15.49.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 May 2019 15:49:05 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Fri, 17 May 2019 15:48:59 -0700 Message-Id: <20190517224859.8270-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [OE-core] [PATCH] 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 ${BPN}, 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 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 () {