From patchwork Tue May 8 13:28:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 910191 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="SzV+9quF"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gL0r4NByz9s4n for ; Tue, 8 May 2018 23:28:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 436E9866DC; Tue, 8 May 2018 13:28:42 +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 rHX4dG3JXgoI; Tue, 8 May 2018 13:28:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2282886615; Tue, 8 May 2018 13:28:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AF65A1C012F for ; Tue, 8 May 2018 13:28:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AC883880B9 for ; Tue, 8 May 2018 13:28:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RWfjWRoyYN-4 for ; Tue, 8 May 2018 13:28:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by hemlock.osuosl.org (Postfix) with ESMTPS id 790A9880B0 for ; Tue, 8 May 2018 13:28:37 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id j4so18869279wme.1 for ; Tue, 08 May 2018 06:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=XnKgw1yDzrMWhlC3Xc5O0KDzueOB/Q2MnCFrQVeYWfE=; b=SzV+9quFAa4GO/V8r1TFP7x9RqcyPCy7i3IZYGm+b41/JYwglwKPr5WjXUarN0xa6O T4eVqKnXePBdfe1rCTE8bR7xB+kaR1pQxMqUYE+KcYZgiOdKigpTuCEzpz5E429e8lnx b30ywZzUVAZOgL2V1kFXAjbk/dxECA6JVWUHY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XnKgw1yDzrMWhlC3Xc5O0KDzueOB/Q2MnCFrQVeYWfE=; b=bjZpwGk4I4gbA0F4R98YlgXlTbmfjw6VK67FOPc599oqSv5tVo7fDEHQ97oKEB11Bg hytcXACvE4/nbUtsr+irWkZfGQJlgvpnwyqpKvz4GdpSR15RlE/11vb5XWEM+zyxQQFh WoHcRle7eZqXeyB1xDTUjhXtEu1fI96kU0srWM3Z1DbQq8KtqUGsTluzM2QznWo3sKx0 1P2WykP3YMnLJUpdgJjqK8W/AgwZVSAPepYSa0aYzU/42CWgAqhozBlUsehZ7mRVBg2f SlJ0FXHr5IBRpejtmGByFkiCDpd+rxL+IMEigpt0tcC9U3XTz8saSSNr+hPeJj4qoCPT sR8w== X-Gm-Message-State: ALKqPweu4IgBJs/hbQMYNL9E5ssx2O6uihj148FB3ahvkvejDeUj6vii g3H1DzjIfK7Th4LlxbOpZ42nV0uGOqw= X-Google-Smtp-Source: AB8JxZqs8tIsEiDhzm9Ung3QOtl3kha+75iNAbcYILgK6YqfDxeRbKuHOZ72GWh9St3Gy74noTkzjQ== X-Received: by 2002:a1c:9310:: with SMTP id v16-v6mr3447864wmd.60.1525786115406; Tue, 08 May 2018 06:28:35 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id q17-v6sm8022995wmf.3.2018.05.08.06.28.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 May 2018 06:28:34 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 8 May 2018 15:28:31 +0200 Message-Id: <1525786111-6206-1-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH v2] support/download/file: fix file:// protocol handling 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: yann.morin.1998@free.fr, Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a file is used a source for download using the file:// protocol, a malformed url is passed to the file download script which then crashes. Following an example of a wrong path passed to the script: eval cp -v ''\''file:///home/angelo/DEV/TOOLCHAINSarmv7-eabihf--glibc--bleeding-edge-2017.11-1.tar.bz2'\''' ''\''/home/angelo/DEV/BUILDROOT/br_qemu_arm/build/.armv7-eabihf--glibc--bleeding-edge-2017.11-1.tar.bz2.f403PT/output'\'''. Path passed to cp lacks of a / between dir and file part of the url, moreover it presents a wrong file:// prefix. Fixes: cp: cannot stat 'file:///home/angelo/DEV/TOOLCHAINSarmv7-eabihf--glibc--bleeding-edge-2017.11-1.tar.bz2': No such file or directory Signed-off-by: Angelo Compagnucci Reviewed-by: "Yann E. MORIN" --- support/download/file | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/download/file b/support/download/file index fefd6d2..6dd37b0 100755 --- a/support/download/file +++ b/support/download/file @@ -40,4 +40,4 @@ _localfiles() { eval ${LOCALFILES} "${@}" } -_localfiles ${verbose} "'${dir}${file}'" "'${output}'" +_localfiles ${verbose} "'${dir##file://}/${file}'" "'${output}'"