From patchwork Mon Nov 13 22:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 837572 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oOyr3TlZ"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ybPhV1YZfz9s8J for ; Tue, 14 Nov 2017 09:00:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 14B72871E5; Mon, 13 Nov 2017 22:00:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0xciVxGD42ga; Mon, 13 Nov 2017 22:00:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 142D886A90; Mon, 13 Nov 2017 22:00:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BF1041C2C08 for ; Mon, 13 Nov 2017 22:00:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B63ED87D12 for ; Mon, 13 Nov 2017 22:00:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09wPp5vvXT6n for ; Mon, 13 Nov 2017 22:00:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9C3D587CCD for ; Mon, 13 Nov 2017 22:00:18 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id b189so11346586wmd.0 for ; Mon, 13 Nov 2017 14:00:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=dyztOhOYVjupjaXBCe0GrK1gyVbtBUN9gBpSRgiZTSY=; b=oOyr3TlZ6H16JLdUer+EGlruRFmjVAxdDhIMpp0OBkyYkEqVyLl/GC38/EDIb4m1E4 n7LorZ9CC9Bj/oJR6Oli0+PKTD6OWYc4N2Gv+G2t1CoTFJlWxmx5xasD7kod5sUCtvjX hO4RRsRlmpzHxMQX2YV4+ZEi52gx7o6Ru7x0vEYJirLx4izxosD7px9qIUYYHLhEBuxA 3bfPvz3vQ0ZvwKPQAoVgwTVAQaw1W1Rwm5VJ7Y1UYGQbXcY0QC93tLHgk1E6j/Ci7aKw NehBJ9Ok1OU7l6mnwcQ8lVJPcw003uocOGjNpQT+FqxkTCurGNx2Ec8VcI5epQ4bX4VF gQMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=dyztOhOYVjupjaXBCe0GrK1gyVbtBUN9gBpSRgiZTSY=; b=tb6R5U5PU6KJZt+kj2X9QdjKYqZcIOabGk0KhcijvXpRiJ1Nm7F7n5bsXJNCMXNh72 +t0ZQ3nkaugwCnwYj227F3XMMaMVeo5rMrLtIc+Q28lgHz64PVHf9ecIQqRfzCbuOdMC 3/2IOKQnqzwcMo9TjI30UhayRBK5SjgRa4Np828es0Bdv2vuVhLNiPbN9wm3NTe6W/ld 79hVo2NZJm2RL8Hi+bd+rWofPp0eSdTq9RROPWC5bVAvBwouZ82DC6YNRQbX6fvIPKV6 UAEhlaHyYi4JPJnNj+Z4mOskspdqFm3rvpPP2FYPtGvLTCevVllIJ156Pbi4dQ1iR4iF Q8+A== X-Gm-Message-State: AJaThX4kDiDy+RTEUPc5fLCQnc8Sj031WUfd3bWnjaOD+UEj23CEfazN XA6N2Ra4ova85+qUGLUP6YtNTQ== X-Google-Smtp-Source: AGs4zMby+1TTWUSVBBTeyWhyHjcYVnZ8jc7767tlr+ccOv3AIAQI7HBRyftFXRDMPKoqJv0rFoidDA== X-Received: by 10.28.5.148 with SMTP id 142mr7540440wmf.142.1510610416858; Mon, 13 Nov 2017 14:00:16 -0800 (PST) Received: from localhost.localdomain (2a01cb088610730040016e3b5439ad97.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:4001:6e3b:5439:ad97]) by smtp.gmail.com with ESMTPSA id e71sm12009915wma.13.2017.11.13.14.00.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2017 14:00:15 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Mon, 13 Nov 2017 23:00:09 +0100 Message-Id: <20171113220009.3372-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.11.0 Subject: [Buildroot] [PATCH] Revert "pkg-download: remove explicit PKG_VERSION from github helper" X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , "Yann E. MORIN" , Marcin Nowakowski MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This reverts commit 1e5a8916b2ab4c9c99548fa6fbd4855eee323881. The idea was that the version string can be derived because we know the package name. However, this patch does not account for the fact that $(pkgname) always points to the latest pacakge scanned, which in all other situation we're using it, is the current package, because it is used inside one ot he xxx-inner macros that are $(eval)ualed. So $(pkgname) is evaluated "early" and gets the expected value. However, the github value is not in one of those macros, so it gets evaluated "late", when doing the actual download. So, by that time, $(pkgname) will expand to the last package scanned, which is actuall the manual (without a br2-external tree). That would require that the _SITE variable be assigned with the := assignment operator. This is weird, because that would make it the only variable to require that, but only when using the github helper, which is even less obvious and would cause a lot of trouble... The obvious fixup would seem to be to use $(PKG) instead, because that already contains the upper-case package name that vcan be used as a prefix to variables. However, that does not work either, because we have a check that forbids a trsailing slash in _SITE, check that is done in pacakge/pkg-generic, inside the xxx-inner macro, during the $(eval) call. And at that time, PKG is not yet defined, because it is only defined for an actual recipe. So we can't seem to have a workable solution. So, just revert the patch. Signed-off-by: "Yann E. MORIN" Cc: Marcin Nowakowski Cc: Peter Korsgaard Cc: Arnout Vandecappelle Cc: Thomas Petazzoni --- docs/manual/adding-packages-tips.txt | 5 +---- package/pkg-download.mk | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/manual/adding-packages-tips.txt b/docs/manual/adding-packages-tips.txt index 824f07547d..19577fa821 100644 --- a/docs/manual/adding-packages-tips.txt +++ b/docs/manual/adding-packages-tips.txt @@ -138,7 +138,7 @@ past, the 'github' helper function should be used as shown below. ------------------------ # Use a tag or a full commit ID FOO_VERSION = v1.0 -FOO_SITE = $(call github,,[,]) +FOO_SITE = $(call github,,,$(FOO_VERSION)) ------------------------ .Notes @@ -147,9 +147,6 @@ FOO_SITE = $(call github,,[,]) Buildroot (e.g.: +foo-f6fb6654af62045239caed5950bc6c7971965e60.tar.gz+), so it is not necessary to specify it in the +.mk+ file. - When using a commit ID as version, you should use the full 40 hex characters. -- The +version+ parameter is optional and should only be specified if anything - other than FOO_VERSION needs to be used, e.g. when this function is used to - specify a custom Linux or U-Boot tarball. If the package you wish to add does have a release section on GitHub, the maintainer may have uploaded a release tarball, or the release may just point diff --git a/package/pkg-download.mk b/package/pkg-download.mk index dc4ff1c8c7..fbbc2d7391 100644 --- a/package/pkg-download.mk +++ b/package/pkg-download.mk @@ -52,8 +52,8 @@ notdomain = $(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$ # default domainseparator is /, specify alternative value as first argument domainseparator = $(if $(1),$(1),/) -# github(user,package[,version]): returns site of GitHub repository -github = https://github.com/$(1)/$(2)/archive/$(or $(3),$($(call UPPERCASE,$(pkgname))_VERSION)) +# github(user,package,version): returns site of GitHub repository +github = https://github.com/$(1)/$(2)/archive/$(3) # Expressly do not check hashes for those files # Exported variables default to immediately expanded in some versions of