From patchwork Fri Nov 8 17:26:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1192073 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PUfkQ3ma"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 478nJQ6873z9sNH for ; Sat, 9 Nov 2019 04:27:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C741386DAD; Fri, 8 Nov 2019 17:26:59 +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 Padb5yeILS0d; Fri, 8 Nov 2019 17:26:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6203F86CD7; Fri, 8 Nov 2019 17:26:56 +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 14D261BF28D for ; Fri, 8 Nov 2019 17:26:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 112B786CB4 for ; Fri, 8 Nov 2019 17:26:55 +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 ZwQ49lde8kz7 for ; Fri, 8 Nov 2019 17:26:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by whitealder.osuosl.org (Postfix) with ESMTPS id E319986C80 for ; Fri, 8 Nov 2019 17:26:52 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id r10so7974260wrx.3 for ; Fri, 08 Nov 2019 09:26:52 -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:mime-version :content-transfer-encoding; bh=U0nHYK0yLzV2AXYXND4e3GrOE7/R7dilGDioFXWfs9s=; b=PUfkQ3maifZWRQ674vAyABQGqopxZjenuN5RWJeFOvFdV6GU+MN5vetMCY9tCmuHZX sXh9QMLKwpswgCsfpiuFQGPzKoYNT0I3tVV5JoT75Y/LLNLBJUv0yMyMQ94o+30Cu8Qd l+aRF6C99TGcwD1V9EXg5exhmeaysR0PrvRDQFhFxICrCXWAQkeKzI/w/tV11CfFlZxp Xb6EYloTwSsG6WL8iev+Gtz6M027Ijy9v5z4yUTDkc2FMSQlSrAvLz7R3DFy1F8TDMo/ KhrbB+CkfwuJVXjhXECaMM1sAeLciznaph0m4Ai4YbMTwH/05k0edDybeK/LhBbHRPFw 8omQ== 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 :mime-version:content-transfer-encoding; bh=U0nHYK0yLzV2AXYXND4e3GrOE7/R7dilGDioFXWfs9s=; b=H8qgQ+izwQ7YhInUPHvMWPe0+lxUnMf4A/c89TB055RgbSVpOcdm1DY1opmJfJbgUV j9oAdA8zDweWFNCJOiTdv3vf12BAXS/6muIpU7c/fE47SoB15Cj4oVoApmzrBdpi3szi jWjGqeDRB8iTda/Gj44B06oXUtNKCKtYw5bbeM5KoPUjaAAhvGsDXMIpNjUGR+CCtddo Ggpd4BX4xQt2YbCdUTXnGQ73qAI+10tSwtX5pSBd8DTi22uFsMHzJc95C9DtV7Rb+zy7 VTMwOIBq7fWXAeLz+JU5jhuzJJuJkUdCC0qqyBrbBzucE+weOnut/GczwCIKN8SIKu7N yntw== X-Gm-Message-State: APjAAAW6VFbfszW7Srmw1ZvoqYyxDPsdTc5597YiI3kposOvnw7LANWw Y03f8WyCPpnP4YvM1BIyY0ItLvyl X-Google-Smtp-Source: APXvYqyR4dpKtxM2r7+1S20n2IfdgPCHqqn0iqy33becs7sAwGxkx+ZozzhoNW8YcKV/7c/5HmyizQ== X-Received: by 2002:a5d:42c8:: with SMTP id t8mr9010174wrr.87.1573234011131; Fri, 08 Nov 2019 09:26:51 -0800 (PST) Received: from localhost.localdomain ([2a01:cb19:8b51:cb00:35ff:5940:d9d5:7b22]) by smtp.gmail.com with ESMTPSA id a15sm6104045wrw.10.2019.11.08.09.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 09:26:50 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 8 Nov 2019 18:26:45 +0100 Message-Id: <20191108172645.22584-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] infra/pkg-generic: use site method for same-site extra downloads X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jemy Zhang , "Yann E. MORIN" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a package specifies extra downloads, it has the option to only name the basename of the extra download, in which case that extra download will be retrieved from the same location the main download is retrieved from. In that case, if the extra download contains a '+', it would confuse the dl-wrapper, which believes the LHS of the '+' is the site method, and the RHS the actual URI, and so the dl-wrapper mangles and damages the URI when fetching such extra downloads, like that happens with android tools, where the proper URI and mangled URIs of the extra download are, respectively: https://launchpad.net/ubuntu/+archive/primary/+files/android-tools_4.2.2+git20130218-3ubuntu41.debian.tar.gz http://archive/primary/+files/android-tools_4.2.2+git20130218-3ubuntu41.debian.tar.gz We fix that by always propagating the site method to extra downloads, but only when they are specified as relative to the main download URI. For the extra downloads that specify a full URI, it is not systematic that it is the same site method. For example, a main download could be a git clone, but an extra download a pure http download; in that case we can't replicate the site method for extra downloads, so they'll have to take appropriate care to specify the required method and encoding if needed. Reported-by: Jemy Zhang Signed-off-by: Yann E. MORIN Cc: Jemy Zhang --- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 893faba22a..7d6fa08418 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -524,7 +524,7 @@ $(2)_ALL_DOWNLOADS = \ $$(if $$($(2)_SOURCE),$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$($(2)_SOURCE)) \ $$(foreach p,$$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS),\ $$(if $$(findstring ://,$$(p)),$$(p),\ - $$($(2)_SITE)/$$(p))) + $$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$(p))) ifndef $(2)_SITE ifdef $(3)_SITE