From patchwork Fri Feb 7 10:16:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 317660 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 659322C00A0 for ; Fri, 7 Feb 2014 21:16:42 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 957E233165; Fri, 7 Feb 2014 10:16:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6mA4Dz0vx4CV; Fri, 7 Feb 2014 10:16:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E49AC3314D; Fri, 7 Feb 2014 10:16:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 3A8DA1BF995 for ; Fri, 7 Feb 2014 10:16:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3AFB68C667 for ; Fri, 7 Feb 2014 10:16:38 +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 eJMfpEMi+Y3s for ; Fri, 7 Feb 2014 10:16:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ea0-f181.google.com (mail-ea0-f181.google.com [209.85.215.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4EEDE8C6AA for ; Fri, 7 Feb 2014 10:16:37 +0000 (UTC) Received: by mail-ea0-f181.google.com with SMTP id m10so1455995eaj.40 for ; Fri, 07 Feb 2014 02:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:content-transfer-encoding:subject :message-id:user-agent:date:from:to:cc; bh=lRXh4GUb9n26eshDI2Iwp01pqne9wHAy3zEYc3nheaI=; b=hFncMdfwi9T3c5JAuvi8PveSs2E63Q8w2n0i/PQYuQfGrEtlKNkwUtvRxT951ESUY+ 683VOscQpnAbsA9EVR8RgOeaWGcV0oIlgqZCDdGyS5coaTlKhO5yqc3hrNhXMOl9NkyQ b1+6miM5Gy+/gnJi7LsNDruFfKBhV/MFzHGZVcfliHXe0fLny+WxjYPz6+OPWMAU3Nr5 qJprDIeQ/XS6LZ3hTJ4yJr1EYNFzDfPMJm56A53qcxFhZMZ9E0wFwQ1Am4gO6Wfb553F wXRLxSjXlHNRrMOoNk14lqfvCL2fkNdfGGIeIOv1AaJmnCJU/OoGVQaQaSWojNxWX1Bl y/Bw== X-Received: by 10.15.41.14 with SMTP id r14mr3013189eev.78.1391768195693; Fri, 07 Feb 2014 02:16:35 -0800 (PST) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPSA id 46sm14574996ees.4.2014.02.07.02.16.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 02:16:35 -0800 (PST) MIME-Version: 1.0 X-Mercurial-Node: f1b0803ef9dea3b4f3769e354df08b3e2a7580ba Message-Id: User-Agent: Mercurial-patchbomb/2.2.2 Date: Fri, 07 Feb 2014 11:16:28 +0100 From: Thomas De Schampheleire To: buildroot@busybox.net Cc: daniel@exxm.de Subject: [Buildroot] [PATCH] apply-patches.sh: make scan_patchdir work recursively X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net scan_patchdir is called recursively. For this to work properly, the variable path which is set to $1 at the very beginning must be local not global. A test case is to set BR2_GLOBAL_PATCH_DIR to 'mypatches' and having the following tree in the buildroot root: $ find mypatches/ mypatches/ mypatches/busybox mypatches/busybox/subdir.patch mypatches/busybox/subdir.patch/busybox-0001-abc.patch mypatches/busybox/busybox-0002-def.patch mypatches/busybox/asubdir.patch mypatches/busybox/asubdir.patch/busybox-0003-xyz.patch When running 'make busybox-dirclean busybox-patch' originally, you'd get: Applying busybox-0003-xyz.patch using patch: Applying busybox-0002-def.patch using patch: Error: missing patch file mypatches/busybox/asubdir.patch/busybox-0002-def.patch While with this fix: Applying busybox-0003-xyz.patch using patch: Applying busybox-0002-def.patch using patch: Applying busybox-0001-abc.patch using patch: This fixes bug #6434 (https://bugs.busybox.net/show_bug.cgi?id=6434) Signed-off-by: Daniel Mentz [Thomas: update commit message with test case] Signed-off-by: Thomas De Schampheleire --- support/scripts/apply-patches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh --- a/support/scripts/apply-patches.sh +++ b/support/scripts/apply-patches.sh @@ -92,7 +92,7 @@ function apply_patch { } function scan_patchdir { - path=$1 + local path=$1 shift 1 patches=${@-*}