From patchwork Fri Sep 25 03:59:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Sangorrin X-Patchwork-Id: 11798757 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68EB46CA for ; Fri, 25 Sep 2020 04:00:06 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E75F21481 for ; Fri, 25 Sep 2020 04:00:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.cip-project.org header.i=@lists.cip-project.org header.b="DcWTq7so" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E75F21481 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=toshiba.co.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+64572+5474+4520428+8129116@lists.cip-project.org X-Received: by 127.0.0.2 with SMTP id ScezYY4521763xwvSxpiRr5F; Thu, 24 Sep 2020 21:00:05 -0700 X-Received: from mo-csw.securemx.jp (mo-csw.securemx.jp [210.130.202.153]) by mx.groups.io with SMTP id smtpd.web12.84.1601006404984444884 for ; Thu, 24 Sep 2020 21:00:05 -0700 X-Received: by mo-csw.securemx.jp (mx-mo-csw1514) id 08P3xWJW022861; Fri, 25 Sep 2020 12:59:33 +0900 X-Iguazu-Qid: 34trwK96OzdGqIiWJg X-Iguazu-QSIG: v=2; s=0; t=1601006372; q=34trwK96OzdGqIiWJg; m=0A6v3RRok59zAY2jTxX/hBnIkFRpU7/C4tA/vZCQLwI= X-Received: from imx12.toshiba.co.jp (imx12.toshiba.co.jp [61.202.160.132]) by relay.securemx.jp (mx-mr1513) id 08P3xVcT040152; Fri, 25 Sep 2020 12:59:31 +0900 X-Received: from enc02.toshiba.co.jp ([61.202.160.51]) by imx12.toshiba.co.jp with ESMTP id 08P3xVPC016919; Fri, 25 Sep 2020 12:59:31 +0900 (JST) X-Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id 08P3xVZd000452; Fri, 25 Sep 2020 12:59:31 +0900 From: "Daniel Sangorrin" To: sz.lin@moxa.com, ben.hutchings@codethink.co.u, wens@csie.org Cc: cip-dev@lists.cip-project.org Subject: [cip-dev] [cip-kernel-sec 1/3] report_affected: word-wrap for the 'description' Date: Fri, 25 Sep 2020 12:59:25 +0900 X-TSB-HOP: ON Message-Id: <20200925035927.1958987-2-daniel.sangorrin@toshiba.co.jp> In-Reply-To: <20200925035927.1958987-1-daniel.sangorrin@toshiba.co.jp> References: <20200925035927.1958987-1-daniel.sangorrin@toshiba.co.jp> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: cip-dev@lists.cip-project.org List-Id: Mailing-List: list cip-dev@lists.cip-project.org; contact cip-dev+owner@lists.cip-project.org Delivered-To: mailing list cip-dev@lists.cip-project.org Reply-To: cip-dev@lists.cip-project.org X-Gm-Message-State: Il17zF3EREZih4EjhvpovML9x4520428AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.cip-project.org; q=dns/txt; s=20140610; t=1601006405; bh=8hJo3tXQN0y9sWzF2RweEGnv91rK0032EpXwFihlr9s=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=DcWTq7soW/Y6+5Rl0pEUQ2uh1/Rf4GM4dXuJPUEQOWFFMI0IYzBH9ilRRgBvltBVUTf YcNwsmxgHrs/efEM6EPWQfZjGlb1gGaIO4qpBkIYPj0Aj/Mv+IEPaU59YkcSw9adPfiD9 bbrBMvZRm+HA0ROmmaEiCF1ej1r+ctmLl/A= From: Nguyen Van Hieu Currently some descriptions are quite long, and it is hard to read. Add line-breaks so every line is at most 80 characters long. Signed-off-by: Nguyen Van Hieu Signed-off-by: Daniel Sangorrin --- scripts/report_affected.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/report_affected.py b/scripts/report_affected.py index a97b700..a181d97 100755 --- a/scripts/report_affected.py +++ b/scripts/report_affected.py @@ -19,6 +19,7 @@ import kernel_sec.branch import kernel_sec.issue import kernel_sec.version +import textwrap def main(git_repo, remotes, only_fixed_upstream, include_ignored, show_description, *branch_names): @@ -136,8 +137,11 @@ def main(git_repo, remotes, only_fixed_upstream, if show_description: print('%s:' % branch['full_name']) for cve_id in sorted_cve_ids: - print(cve_id, '=>', - kernel_sec.issue.load(cve_id).get('description', 'None')) + description=kernel_sec.issue.load(cve_id).get('description', 'None') + wrap_description = '' + for line in textwrap.wrap(description, 80, break_long_words=False): + wrap_description += line + '\n ' + print(cve_id, '=>',wrap_description) else: print('%s:' % branch['full_name'], *sorted_cve_ids)