From nobody Tue Apr 23 16:08:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568219296; cv=none; d=zoho.com; s=zohoarc; b=UarsxkR8/3r7GcgQyMVtjJpoR4wyO0Y1Vt4eUxPAy+Vl31QERrTB/BOLIXMadtw805BQLPKWg0FXScY+F8kxZXmwfb3UH/luK4JpFgcgU0E0ju5SRGWCLTut+Ewj5scePN07neEGgBWojgwAG4UAbetYB0hn0YtMovHxqrR19zs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568219296; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=hIckg8CjR6dVNYHvfctweijgLqSG2m96qLQOP8FBWQs=; b=YXRPQqo20OPLVRHkZmHIA8C91KUtkh+g6HlddB0qX4muxweF2fN4GD1teJ1B99n5Jc0TNGVjWrWcwCB8I+5fbx0lilaWTkwPZwBqNze8bXu25RDa+kmrFXmyFyWdoxJFuRjFszi7SvnHUuqD653F0/+E3Ddg+FMv0atqezt2zCw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568219296404296.1115039929025; Wed, 11 Sep 2019 09:28:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 551C1C04D312; Wed, 11 Sep 2019 16:28:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 309515DA8D; Wed, 11 Sep 2019 16:28:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4C670180BA96; Wed, 11 Sep 2019 16:28:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BGSBfQ013040 for ; Wed, 11 Sep 2019 12:28:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id AFBBB6017E; Wed, 11 Sep 2019 16:28:11 +0000 (UTC) Received: from catbus.gsslab.fab.redhat.com (dhcp-32.gsslab.fab.redhat.com [10.33.9.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FB7260167; Wed, 11 Sep 2019 16:28:10 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 17:23:10 +0100 Message-Id: <20190911162333.8668-2-berrange@redhat.com> In-Reply-To: <20190911162333.8668-1-berrange@redhat.com> References: <20190911162333.8668-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 01/24] docs: document that C & Python are the preferred languages X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 11 Sep 2019 16:28:14 +0000 (UTC) Blacklist Perl and Shell code in favour of Python for sake of readability and portability. Signed-off-by: Daniel P. Berrang=C3=A9 --- docs/hacking.html.in | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 90376968c3..edf2f54ce3 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -343,6 +343,36 @@ Richard Jones' guide to working with open source projects.

=20 +

Language Usage

+ +

+ The libvirt repository makes use of a large number of programming + languages. It is anticipated that in the future libvirt will adopt + use of other new languages. To reduce the overall burden on develope= rs, + there is thus a general desire to phase out usage of some of the + existing languages. +

+ +

+ The preferred languages at this time are: +

+ +
    +
  • C - for the main libvirt codebase. Dialect supported by + GCC/CLang only.
  • +
  • Python - for supporting build scripts / tools. Code must + run with both version 2.7 and 3.x at this time.
  • +
+ +

+ Languages that should not be used for any new contributions: +

+ +
    +
  • Perl - build scripts must be written in Python instead.
  • +
  • Shell - build scripts must be written in Python instead.
  • +
+

Tooling

=20

--=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 23 16:08:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568219296; cv=none; d=zoho.com; s=zohoarc; b=nRhO0T7+qO2tdgWkDJUtO2QcWfn6u1w45JpUIJ5L9W4hSIgHW1qtLApv6oY5fru0l7pdyJc0p+vbfGExrxYVo5TbE1OFJGvjVUVA7yzgeWh+yjSnZLKRUEPwhIsRhrT+wxia3HhhUaupoDbToqMtbvdzADYJyLZa86guetDTjd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568219296; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=eABY+NEYXXL8F8f7AiN07oZujWIYUQYM87U/hgoohZk=; b=Bh1JYG9F0Z1n5IWtRxFboXuYlkvfMix1xqXWb3QDiRlMVRcgOdoaV62P626LqWf8mHFJEF7PM0AHvdXSw6c8HwtD2K8NvDrCPoh3g8xFIqAdJM0OM6UoEkZmL/mXEHR9WOrWqh/o0oF8SERAMqEbJvID5ze/OBTx29EVhWTYUgw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568219296813797.4492870121716; Wed, 11 Sep 2019 09:28:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 420051DB6; Wed, 11 Sep 2019 16:28:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14EFB6012A; Wed, 11 Sep 2019 16:28:14 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6E2E62551C; Wed, 11 Sep 2019 16:28:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BGSCWh013045 for ; Wed, 11 Sep 2019 12:28:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 91ECC6012A; Wed, 11 Sep 2019 16:28:12 +0000 (UTC) Received: from catbus.gsslab.fab.redhat.com (dhcp-32.gsslab.fab.redhat.com [10.33.9.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0239E60167; Wed, 11 Sep 2019 16:28:11 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 17:23:11 +0100 Message-Id: <20190911162333.8668-3-berrange@redhat.com> In-Reply-To: <20190911162333.8668-1-berrange@redhat.com> References: <20190911162333.8668-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 02/24] cfg.mk: fix comment detection for python semicolon check X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Wed, 11 Sep 2019 16:28:14 +0000 (UTC) The pattern ^[^#].*\;$$ Was attempting to detect any trailing ';' in python code which was not in a comment. This does not allow for the comment '#' character to be indented with whitespace. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake --- cfg.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfg.mk b/cfg.mk index 1f29729949..d09ab507e0 100644 --- a/cfg.mk +++ b/cfg.mk @@ -815,7 +815,7 @@ sc_require_enum_last_marker: =20 # In Python files we don't want to end lines with a semicolon like in C sc_prohibit_semicolon_at_eol_in_python: - @prohibit=3D'^[^#].*\;$$' \ + @prohibit=3D'^[ \t]*[^# \t].*\;$$' \ in_vc_files=3D'\.py$$' \ halt=3D'python does not require to end lines with a semicolon' \ $(_sc_search_regexp) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 23 16:08:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568219303; cv=none; d=zoho.com; s=zohoarc; b=Dcp9qyCZl0mk3KTEdJxbiQ8m42Uz4AYhkStb2W5PmGkTxf3cjrzmBDRT4B0WV8G1psgny099AELpJW/K/6c4SOazWJue4gLmDT00c2IV5Mk/0ArCS+2KovGqPkp/pyvwDSKcHyZwnuRye5Fe02nfLt6b+ohGXI6k2Hzdl/Cz3Gc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568219303; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=semYKeqoEzCxdKliGCnPhhIhHabR6FDDjBYKkX0vNLM=; b=Xwp9IPZsZRR4a+u0KiuqK8EDWEH1K6YUpKmLx8TIcHisUrFBUBavLQEtegXPcEXr5PPzT5IN1HRU6OyK2Rr9Y2LbxGnP9QUAHLpP2fr4lfsxaz9dPD6AgMrHOj8VyHU0uY875sY4lGtrWUCxKLstl0XoaX2Mb7XZkZ7RD/YozvI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568219303937389.1827682968368; Wed, 11 Sep 2019 09:28:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FB2A10DCC86; Wed, 11 Sep 2019 16:28:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED181601B3; Wed, 11 Sep 2019 16:28:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A033924FDF; Wed, 11 Sep 2019 16:28:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BGSDU2013055 for ; Wed, 11 Sep 2019 12:28:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 734AF601B3; Wed, 11 Sep 2019 16:28:13 +0000 (UTC) Received: from catbus.gsslab.fab.redhat.com (dhcp-32.gsslab.fab.redhat.com [10.33.9.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id D793C60167; Wed, 11 Sep 2019 16:28:12 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 17:23:12 +0100 Message-Id: <20190911162333.8668-4-berrange@redhat.com> In-Reply-To: <20190911162333.8668-1-berrange@redhat.com> References: <20190911162333.8668-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 03/24] build: force a UTF-8 locale for python X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Wed, 11 Sep 2019 16:28:22 +0000 (UTC) Python3 versions less than 3.7 have very unhelpful handling of the C locale where they assume data is 7-bit only. This violates POSIX which requires the C locale to be 8-bit clean. Python3 >=3D 3.7 now assumes that the C locale is always UTF-8. Set env variables to force LC_CTYPE to en_US.UTF-8 so that we get UTF-8 handling on all python versions. Note we do not use C.UTF-8 since not all C libraries support that. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake --- Makefile.am | 2 +- configure.ac | 8 ++++++++ docs/Makefile.am | 3 ++- src/esx/Makefile.inc.am | 2 +- src/hyperv/Makefile.inc.am | 2 +- src/util/Makefile.inc.am | 8 ++++---- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index cf9ff94f4f..711f365504 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,7 @@ NEWS: \ $(srcdir)/docs/news.xml \ >$@-tmp \ || { rm -f $@-tmp; exit 1; }; \ - $(PYTHON) $(srcdir)/docs/reformat-news.py $@-tmp >$@ \ + $(RUNUTF8) $(PYTHON) $(srcdir)/docs/reformat-news.py $@-tmp >$@ \ || { rm -f $@-tmp; exit 1; }; \ rm -f $@-tmp; \ fi diff --git a/configure.ac b/configure.ac index 7c76a9c9ec..31810b9010 100644 --- a/configure.ac +++ b/configure.ac @@ -706,6 +706,14 @@ AC_PATH_PROGS([PYTHON], [python3 python2 python]) if test -z "$PYTHON"; then AC_MSG_ERROR(['python3', 'python2' or 'python' binary is required to b= uild libvirt]) fi + +dnl Python3 < 3.7 treats the C locale as 7-bit only. +dnl We must force env vars so it treats it as UTF-8 +dnl regardless of the user's locale. +RUNUTF8=3D"LC_ALL=3D LANG=3DC LC_CTYPE=3Den_US.UTF-8" +AC_SUBST(RUNUTF8) + + AC_PATH_PROG([PERL], [perl]) if test -z "$PERL"; then AC_MSG_ERROR(['perl' binary is required to build libvirt]) diff --git a/docs/Makefile.am b/docs/Makefile.am index 1cdb584b0b..14f3faffd4 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -348,7 +348,8 @@ $(APIBUILD_STAMP): $(srcdir)/apibuild.py \ $(top_srcdir)/src/util/virerror.c \ $(top_srcdir)/src/util/virevent.c \ $(top_srcdir)/src/util/virtypedparam.c - $(AM_V_GEN)srcdir=3D$(srcdir) builddir=3D$(builddir) $(PYTHON) $(APIBUILD) + $(AM_V_GEN)srcdir=3D$(srcdir) builddir=3D$(builddir) \ + $(RUNUTF8) $(PYTHON) $(APIBUILD) touch $@ =20 =20 diff --git a/src/esx/Makefile.inc.am b/src/esx/Makefile.inc.am index 2d55c6573c..70a13ea829 100644 --- a/src/esx/Makefile.inc.am +++ b/src/esx/Makefile.inc.am @@ -63,7 +63,7 @@ $(ESX_DRIVER_GENERATED): $(ESX_GENERATED_STAMP) =20 $(ESX_GENERATED_STAMP): $(srcdir)/esx/esx_vi_generator.input \ $(srcdir)/esx/esx_vi_generator.py - $(AM_V_GEN)srcdir=3D$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py= \ + $(AM_V_GEN)srcdir=3D$(srcdir) $(RUNUTF8) $(PYTHON) $(srcdir)/esx/esx_vi_g= enerator.py \ && touch $@ =20 MAINTAINERCLEANFILES +=3D $(ESX_DRIVER_GENERATED) $(ESX_GENERATED_STAMP) diff --git a/src/hyperv/Makefile.inc.am b/src/hyperv/Makefile.inc.am index 51be8bcacc..6728b39c90 100644 --- a/src/hyperv/Makefile.inc.am +++ b/src/hyperv/Makefile.inc.am @@ -41,7 +41,7 @@ $(HYPERV_DRIVER_GENERATED): $(HYPERV_GENERATED_STAMP) =20 $(HYPERV_GENERATED_STAMP): $(srcdir)/hyperv/hyperv_wmi_generator.input \ $(srcdir)/hyperv/hyperv_wmi_generator.py - $(AM_V_GEN)srcdir=3D$(srcdir) $(PYTHON) \ + $(AM_V_GEN)srcdir=3D$(srcdir) $(RUNUTF8) $(PYTHON) \ $(srcdir)/hyperv/hyperv_wmi_generator.py \ && touch $@ =20 diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index 46866cf213..adb5e6d727 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -300,7 +300,7 @@ util/virkeycodetable_%.h: $(srcdir)/keycodemapdb/data/k= eymaps.csv \ $(AM_V_GEN)export NAME=3D`echo $@ | sed -e 's,util/virkeycodetable_,,' \ -e 's,\.h,,'` && \ $(MKDIR_P) util/ && \ - $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ + $(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ --lang stdc --varname virKeyCodeTable_$$NAME code-table \ $(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \ mv $@-tmp $@ || rm -f $@-tmp @@ -310,7 +310,7 @@ util/virkeynametable_%.h: $(srcdir)/keycodemapdb/data/k= eymaps.csv \ $(AM_V_GEN)export NAME=3D`echo $@ | sed -e 's,util/virkeynametable_,,' \ -e 's,\.h,,'` && \ $(MKDIR_P) util/ && \ - $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ + $(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ --lang stdc --varname virKeyNameTable_$$NAME name-table \ $(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \ mv $@-tmp $@ || rm -f $@-tmp @@ -320,7 +320,7 @@ util/virkeycode-%.pod: $(srcdir)/keycodemapdb/data/keym= aps.csv \ $(AM_V_GEN)export NAME=3D`echo $@ | sed -e 's,util/virkeycode-,,' \ -e 's,\.pod,,'` && \ $(MKDIR_P) util/ && \ - $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ + $(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ --lang pod \ --varname "virkeycode-$$NAME - Key code values for $$NAME" \ code-docs \ @@ -332,7 +332,7 @@ util/virkeyname-%.pod: $(srcdir)/keycodemapdb/data/keym= aps.csv \ $(AM_V_GEN)export NAME=3D`echo $@ | sed -e 's,util/virkeyname-,,' \ -e 's,\.pod,,'` && \ $(MKDIR_P) util/ && \ - $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ + $(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \ --lang pod \ --varname "virkeyname-$$NAME - Key name values for $$NAME" \ name-docs \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 23 16:08:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568219304; cv=none; d=zoho.com; s=zohoarc; b=f6spqosyZsP7ihsxleUli+gnyyap8lmEe4QB9Lnv11x8QHKOYU6ZXi3td5JCpXYKp7xOyN71e3bEbCFAsLxSWB3PVO82k8/uL5af7Ad4JLHRtTtra98eKlbdGI+Q03kGecpRNVfVStWRsQr5GKgt/ATzH/7JrcWWfc7+UQih4YU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568219304; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=787IGNDVJ4Ql84o6prOJxQhMfhvwBOF7g/nHbaFOozc=; b=N74yNAjAvobtVpmvaM45gHc+xy+QCnfQkFiiac3PEC5qN6vRluJHo24p4c7TAil2s3mFs5ZZduJWFqCtv7Nif53vX1TlFLHRjTceA3c7VIK/Y1YebcEW8Ed7Wf+CnkiNZfcndxtDobGsGVumxPeMORyGqpPSa7FLsDliO0Nj284= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156821930403943.28785993598012; Wed, 11 Sep 2019 09:28:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 162DE3082B3F; Wed, 11 Sep 2019 16:28:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1B4960606; Wed, 11 Sep 2019 16:28:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 98ED424FDE; Wed, 11 Sep 2019 16:28:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BGSE10013066 for ; Wed, 11 Sep 2019 12:28:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 78238601A5; Wed, 11 Sep 2019 16:28:14 +0000 (UTC) Received: from catbus.gsslab.fab.redhat.com (dhcp-32.gsslab.fab.redhat.com [10.33.9.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id B98FE60167; Wed, 11 Sep 2019 16:28:13 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 17:23:13 +0100 Message-Id: <20190911162333.8668-5-berrange@redhat.com> In-Reply-To: <20190911162333.8668-1-berrange@redhat.com> References: <20190911162333.8668-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 04/24] build-aux: rewrite augest test generator in Python X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 11 Sep 2019 16:28:22 +0000 (UTC) As part of an goal to eliminate Perl from libvirt build tools, rewrite the augeas-gentest.pl tool in Python. This was a straight conversion, manually going line-by-line to change the syntax from Perl to Python. Thus the overall structure of the file and approach is the same. The use of $(AUG_GENTEST) as a dependancy in the makefiles needed to be fixed, because this was assumed to be the filename of the script, but is in fact a full shell command line. Signed-off-by: Daniel P. Berrang=C3=A9 --- Makefile.am | 2 +- build-aux/augeas-gentest.pl | 60 --------------------------- build-aux/augeas-gentest.py | 72 +++++++++++++++++++++++++++++++++ src/Makefile.am | 3 +- src/bhyve/Makefile.inc.am | 4 +- src/interface/Makefile.inc.am | 2 +- src/libxl/Makefile.inc.am | 4 +- src/locking/Makefile.inc.am | 6 +-- src/logging/Makefile.inc.am | 2 +- src/lxc/Makefile.inc.am | 4 +- src/network/Makefile.inc.am | 2 +- src/node_device/Makefile.inc.am | 2 +- src/nwfilter/Makefile.inc.am | 2 +- src/qemu/Makefile.inc.am | 4 +- src/remote/Makefile.inc.am | 4 +- src/secret/Makefile.inc.am | 2 +- src/storage/Makefile.inc.am | 2 +- src/vbox/Makefile.inc.am | 2 +- src/vz/Makefile.inc.am | 2 +- 19 files changed, 97 insertions(+), 84 deletions(-) delete mode 100755 build-aux/augeas-gentest.pl create mode 100755 build-aux/augeas-gentest.py diff --git a/Makefile.am b/Makefile.am index 711f365504..17448a914e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,7 +41,7 @@ EXTRA_DIST =3D \ run.in \ README.md \ AUTHORS.in \ - build-aux/augeas-gentest.pl \ + build-aux/augeas-gentest.py \ build-aux/check-spacing.pl \ build-aux/gitlog-to-changelog \ build-aux/header-ifdef.pl \ diff --git a/build-aux/augeas-gentest.pl b/build-aux/augeas-gentest.pl deleted file mode 100755 index 65834b533b..0000000000 --- a/build-aux/augeas-gentest.pl +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env perl -# -# augeas-gentest.pl: Generate an augeas test file, from an -# example config file + test file template -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library. If not, see -# . - -use strict; -use warnings; - -die "syntax: $0 CONFIG TEMPLATE\n" unless @ARGV =3D=3D 2; - -my $config =3D shift @ARGV; -my $template =3D shift @ARGV; - -open CONFIG, "<", $config or die "cannot read $config: $!"; -open TEMPLATE, "<", $template or die "cannot read $template: $!"; - -my $group =3D 0; -while (