From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbdLLKD2 (ORCPT ); Tue, 12 Dec 2017 05:03:28 -0500 Received: from mga18.intel.com ([134.134.136.126]:3242 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751400AbdLLKD0 (ORCPT ); Tue, 12 Dec 2017 05:03:26 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,394,1508828400"; d="scan'208";a="17546159" From: Andy Shevchenko To: Will Deacon , Dave Martin , Philippe Ombredanne , linux-kernel@vger.kernel.org, Andrew Morton Cc: Andy Shevchenko Subject: [PATCH v1] scripts/decodecode: Make it take multiline Code line Date: Tue, 12 Dec 2017 12:03:23 +0200 Message-Id: <20171212100323.33201-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.15.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of running scripts/decodecode without any parameters in order to give a copy'n'pasted Code line from, for example, email it would parse only first line of it, while in emails it's split to few. So, add a logic to join this split back if and only if the following lines have hex digits, or spaces, or '<', or '>' characters. It will be quite unlikely to have a broken input in well formed Oops or dmesg, thus a simple regex is being used. Signed-off-by: Andy Shevchenko --- scripts/decodecode | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/decodecode b/scripts/decodecode index 5ea071099330..9cef558528aa 100755 --- a/scripts/decodecode +++ b/scripts/decodecode @@ -21,12 +21,24 @@ trap cleanup EXIT T=`mktemp` || die "cannot create temp file" code= +cont= while read i ; do case "$i" in *Code:*) code=$i + cont=yes + ;; +*) + [ -n "$cont" ] && { + xdump="$(echo $i | grep '^[[:xdigit:]<>[:space:]]\+$')" + if [ -n "$xdump" ]; then + code="$code $xdump" + else + cont= + fi + } ;; esac -- 2.15.0