From nobody Tue Feb 10 15:45:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602546135; cv=none; d=zohomail.com; s=zohoarc; b=O5AsIdq8dZnTsjR6Wt3GpyUfA1B3N1Q8nzXHXals0UYZNccdHsMDWi6tiRvFaSyRcmxNvqqHRcP29mXjlO0yGDX8pWdxmbPmzz9jfQlH4At0EHF92k615aUl/36ugeR6gVTalMue5l0WNkdP9Z3Dkmpq/sFPkyG+ixuQyJSFSeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602546135; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L6PNQoyNWpTKNJhBfsEjGJ+daBNStQN7zXzdYI1k/ZU=; b=SQ0pboqdGYhTiuXSxErEh4re1RlmSpNqpm0UBRNFGJ3cu3hpulXN8AgQer3PczKn/iYK2sYC7KtZbOlLGND9xgQykhsGutYd1bw5scaZXzEzaDEaePXmxnO1Cq6Jy+p0G5F4cEtSVXfb/stiRfxx97ABhg8f6+9oop094aX/gtc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1602546135748349.37523330315116; Mon, 12 Oct 2020 16:42:15 -0700 (PDT) Received: from localhost ([::1]:60240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kS7SI-00070q-I4 for importer@patchew.org; Mon, 12 Oct 2020 19:42:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kS7OQ-00035p-0R; Mon, 12 Oct 2020 19:38:14 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:36955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kS7OO-00073Y-0H; Mon, 12 Oct 2020 19:38:13 -0400 Received: by mail-pf1-x42f.google.com with SMTP id 144so15243295pfb.4; Mon, 12 Oct 2020 16:38:11 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id x12sm21975783pfr.156.2020.10.12.16.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 16:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L6PNQoyNWpTKNJhBfsEjGJ+daBNStQN7zXzdYI1k/ZU=; b=jIt/qDWhnuxApOXOtkUiNpAdl7lLSiUTyKSGPauriZmyYjE/GpKJIqg5audgdjfcWi 2kqym5Uj2n3B0fYeNArKi9fTFc9gXOqtadK6Mca3Z9MO0OUwf9NDobjThlvAFIpGVScw NN5dkSyULw0Mq1A8W2vBXPSy+SCOcJdM7yHCP1mg0jqtLTonNug+/wMmRWGL2Hh8nJXz gtupvC3PeplF2IOZUOc3UQW2enuXHjFcsQreCLgSIQeazxtiOwAn2GqHAT1JkTHYbty9 ftDsVLu7XpUnRR/ZaHGmhlNPsm4KnkA7Kj1BKiOBWRKroOz5f6B+8ljCakZ4rd+zQs4H hYdg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=L6PNQoyNWpTKNJhBfsEjGJ+daBNStQN7zXzdYI1k/ZU=; b=B+Oaw83uFXp3ojwGvF8JuqA6jIt88DijqvBIZTCGB98F2O6kZygxNCTioUhg9Y6Mqq Y3EY31Sc7gWhwZCouTlmExdzkUZERc/OYQSZLvkRHF4n7UUlz/1cX0U979Ev0ZpUxEqU DwBjTTNnfPP/T4yb6TdoJS97vbqKSi/65bgQ5x2+eecP8t1nUpTo1dM7JscsR3EKnVZ0 3jqttVpa8TTqsZmQc/3UdsrIivesk8qWIPyE/hts7ACq4EqBYnSu8CDjxixD5NVIEiwq Z9LDWb/wyhsusccy+YqHfIMJkSSqNb4vU10Hgpj+11TyjZYdxmuM9gawAMPCqTNzv0tX 3lxA== X-Gm-Message-State: AOAM531BwBstTp++QcIWrCQwKbnhh6MQD5F8t3ASk8UjWi8kbF0CXNfc vkoGh0Chq/vYuFALnkbRn8X1awmU+Ut/6g== X-Google-Smtp-Source: ABdhPJyZYsLCZVcXZWCFW6/YxJathcD31bENolQpBfkxQujNBmDkgmNZU0aQMYf09Ho4DE9CIGUHBA== X-Received: by 2002:a62:e104:0:b029:152:4f37:99da with SMTP id q4-20020a62e1040000b02901524f3799damr25438622pfh.17.1602545889832; Mon, 12 Oct 2020 16:38:09 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v7 3/4] docs: Fixes build docs on msys2/mingw Date: Tue, 13 Oct 2020 07:37:39 +0800 Message-Id: <20201012233740.190-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201012233740.190-1-luoyonggang@gmail.com> References: <20201012233740.190-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , QEMU Trivial , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yonggang Luo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Yonggang Luo --- docs/conf.py | 2 +- docs/sphinx/kerneldoc.py | 2 +- scripts/rst-sanitize.py | 21 +++++++++++++++++++++ tests/qapi-schema/meson.build | 5 +++-- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 scripts/rst-sanitize.py diff --git a/docs/conf.py b/docs/conf.py index 00e1b750e2..e584f68393 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -241,7 +241,7 @@ texinfo_documents =3D [ # We use paths starting from qemu_docdir here so that you can run # sphinx-build from anywhere and the kerneldoc extension can still # find everything. -kerneldoc_bin =3D os.path.join(qemu_docdir, '../scripts/kernel-doc') +kerneldoc_bin =3D ['perl', os.path.join(qemu_docdir, '../scripts/kernel-do= c')] kerneldoc_srctree =3D os.path.join(qemu_docdir, '..') hxtool_srctree =3D os.path.join(qemu_docdir, '..') qapidoc_srctree =3D os.path.join(qemu_docdir, '..') diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 3e87940206..3ac277d162 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -67,7 +67,7 @@ class KernelDocDirective(Directive): =20 def run(self): env =3D self.state.document.settings.env - cmd =3D [env.config.kerneldoc_bin, '-rst', '-enable-lineno'] + cmd =3D env.config.kerneldoc_bin + ['-rst', '-enable-lineno'] =20 filename =3D env.config.kerneldoc_srctree + '/' + self.arguments[0] export_file_patterns =3D [] diff --git a/scripts/rst-sanitize.py b/scripts/rst-sanitize.py new file mode 100644 index 0000000000..26060f1208 --- /dev/null +++ b/scripts/rst-sanitize.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +# +# Script for remove cr line ending in file +# +# Authors: +# Yonggang Luo +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or, at your option, any later version. See the COPYING file in +# the top-level directory. + +import sys + +def main(_program, file, *unused): + with open(file, 'rb') as content_file: + content =3D content_file.read() + sys.stdout.buffer.write(content.replace(b'\r', b'')) + +if __name__ =3D=3D "__main__": + main(*sys.argv) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index 1f222a7a13..20a7641af8 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -251,18 +251,19 @@ qapi_doc_out =3D custom_target('QAPI rST doc', # using an explicit '\' character in the command arguments to # a custom_target(), as Meson will unhelpfully replace it with a '/' # (https://github.com/mesonbuild/meson/issues/1564) +rst_sanitize_cmd =3D [find_program('../../scripts/rst-sanitize.py'), '@INP= UT@'] qapi_doc_out_nocr =3D custom_target('QAPI rST doc newline-sanitized', output: ['doc-good.txt.nocr'], input: qapi_doc_out[0], build_by_default: build_docs, - command: ['perl', '-pe', '$x =3D chr 13;= s/$x$//', '@INPUT@'], + command: rst_sanitize_cmd, capture: true) =20 qapi_doc_ref_nocr =3D custom_target('QAPI rST doc reference newline-saniti= zed', output: ['doc-good.ref.nocr'], input: files('doc-good.txt'), build_by_default: build_docs, - command: ['perl', '-pe', '$x =3D chr 13;= s/$x$//', '@INPUT@'], + command: rst_sanitize_cmd, capture: true) =20 if build_docs --=20 2.28.0.windows.1