From patchwork Sun Dec 13 18:35:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 556217 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 3ACF31402D9 for ; Mon, 14 Dec 2015 05:35:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=pdViED0P; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7681AA5E08; Sun, 13 Dec 2015 18:35:54 +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 17MOeynkodbx; Sun, 13 Dec 2015 18:35:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5266CA5D58; Sun, 13 Dec 2015 18:35:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 18AB51BFBFD for ; Sun, 13 Dec 2015 18:35:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 03023A5D09 for ; Sun, 13 Dec 2015 18:35:44 +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 PSdQnvmjGO93 for ; Sun, 13 Dec 2015 18:35:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 8259BA5D9A for ; Sun, 13 Dec 2015 18:35:41 +0000 (UTC) Received: by wmnn186 with SMTP id n186so93990935wmn.0 for ; Sun, 13 Dec 2015 10:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=D/pGWmsDWA8KsA+40qcNsqqg+ezYwfVuwHJoF61rZ8Y=; b=pdViED0PoEUBexgshcdqutvq0+PTMeHR0+VuZVVn1g6wyrdZd5ZZ95Lyywye6BTygQ mKA1yFF6rR1D3aPQzVaViQXYU6Pja3o3dHzggP+MZTb6cuw/1zVnHjA6JgRfL2qNYdI3 valIHela4q6SbKk1Fenkza+SmFR7h9XITAGznxGjpEwaMEKpbLzFkVPMYLe2l7mfAqUM vhlWQqH8YRzWH8Q2iM/KzL1/rktDV6S8DoGCKDsSuJgpztMS4A95CqNwRAbYCHNh7Ggi fibEA05xo+JCeU4M5UDDUnKyrFOh7LG/VkAPDxQar80dVMGyqDOfVUXqnOvOjUIOo7Ky Mz7w== X-Received: by 10.194.178.70 with SMTP id cw6mr32978790wjc.73.1450031740255; Sun, 13 Dec 2015 10:35:40 -0800 (PST) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id an7sm26302823wjc.44.2015.12.13.10.35.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 13 Dec 2015 10:35:39 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 13 Dec 2015 19:35:17 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Luca Ceresoli , "Yann E. MORIN" Subject: [Buildroot] [PATCH 08/13 v2] core/apply-patches: store full path of applied patches X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, we only store the filename of the applied patches. However, we are soon to want to install those patches in the legal-info directory, so we'll have to know where those patches come from. Instead of duplicating the logic to find the patches (bundled, downloaded, from a global patch dir...), just store the full path to each of those patches so we can retrieve them more easily later on. Also always create the list-file, even if empty, so that we need not test for its existence before reading it. Signed-off-by: "Yann E. MORIN" Cc: Luca Ceresoli Reviewed-by: Luca Ceresoli Tested-by: Luca Ceresoli --- Changes v1 -> v2: - do not duplicate '/' in paths (Luca) --- support/scripts/apply-patches.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh index aa13e88..5110458 100755 --- a/support/scripts/apply-patches.sh +++ b/support/scripts/apply-patches.sh @@ -63,8 +63,12 @@ find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print0 | \ xargs -0 -r rm -f function apply_patch { - path=$1 - patch=$2 + path="${1%%/}" + patch="${2}" + case "${path}" in + /*) ;; + *) path="$(pwd)/${path}";; + esac if [ "$3" ]; then type="series"; uncomp="cat" else @@ -99,7 +103,7 @@ function apply_patch { echo "Error: missing patch file ${path}/$patch" exit 1 fi - echo $patch >> ${builddir}/.applied_patches_list + echo "${path}/${patch}" >> ${builddir}/.applied_patches_list ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent if [ $? != 0 ] ; then echo "Patch failed! Please fix ${patch}!" @@ -141,6 +145,7 @@ function scan_patchdir { fi } +touch ${builddir}/.applied_patches_list scan_patchdir "$patchdir" "$patchpattern" # Check for rejects...