From nobody Thu May 9 02:13:06 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1505822641956839.6030728164795; Tue, 19 Sep 2017 05:04:01 -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 9C24C13A98; Tue, 19 Sep 2017 12:04:00 +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 EB42F53CCE; Tue, 19 Sep 2017 12:03:58 +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 B0C153FAD1; Tue, 19 Sep 2017 12:03:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8JB9fX9017089 for ; Tue, 19 Sep 2017 07:09:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id A583F60E3B; Tue, 19 Sep 2017 11:09:41 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.219]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0676B60BEC for ; Tue, 19 Sep 2017 11:09:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9C24C13A98 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 19 Sep 2017 13:09:32 +0200 Message-Id: <20170919110933.8721-2-abologna@redhat.com> In-Reply-To: <20170919110933.8721-1-abologna@redhat.com> References: <20170919110933.8721-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/2] perl: Don't hardcode interpreter path 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: , MIME-Version: 1.0 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.29]); Tue, 19 Sep 2017 12:04:01 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is particularly useful on operating systems that don't ship Perl as part of the base system (eg. FreeBSD) while still working just as well as it did before on Linux. In one case (src/rpc/genprotocol.pl) the interpreter path was missing altogether. Signed-off-by: Andrea Bolognani --- build-aux/augeas-gentest.pl | 2 +- build-aux/check-spacing.pl | 2 +- build-aux/mock-noinline.pl | 2 +- build-aux/prohibit-duplicate-header.pl | 2 +- docs/genaclperms.pl | 2 +- docs/hvsupport.pl | 2 +- src/access/genpolkit.pl | 2 +- src/check-aclperms.pl | 2 +- src/check-aclrules.pl | 2 +- src/check-driverimpls.pl | 2 +- src/check-drivername.pl | 2 +- src/check-symfile.pl | 2 +- src/check-symsorting.pl | 2 +- src/dtrace2systemtap.pl | 2 +- src/rpc/gendispatch.pl | 3 ++- src/rpc/genprotocol.pl | 1 + src/rpc/gensystemtap.pl | 2 +- tests/check-file-access.pl | 2 +- tests/oomtrace.pl | 2 +- 19 files changed, 20 insertions(+), 18 deletions(-) diff --git a/build-aux/augeas-gentest.pl b/build-aux/augeas-gentest.pl index ece9a8a00..18a1c5bce 100755 --- a/build-aux/augeas-gentest.pl +++ b/build-aux/augeas-gentest.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # augeas-gentest.pl: Generate an augeas test file, from an # example config file + test file template diff --git a/build-aux/check-spacing.pl b/build-aux/check-spacing.pl index 448acf234..ca8b43491 100755 --- a/build-aux/check-spacing.pl +++ b/build-aux/check-spacing.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # check-spacing.pl: Report any usage of 'function (..args..)' # Also check for other syntax issues, such as correct use of ';' diff --git a/build-aux/mock-noinline.pl b/build-aux/mock-noinline.pl index eafe20d2e..c6b40001c 100644 --- a/build-aux/mock-noinline.pl +++ b/build-aux/mock-noinline.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =20 my %noninlined; my %mocked; diff --git a/build-aux/prohibit-duplicate-header.pl b/build-aux/prohibit-du= plicate-header.pl index f0539aeca..4a2ea6566 100644 --- a/build-aux/prohibit-duplicate-header.pl +++ b/build-aux/prohibit-duplicate-header.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =20 use strict; =20 diff --git a/docs/genaclperms.pl b/docs/genaclperms.pl index c0514a022..d878321a9 100755 --- a/docs/genaclperms.pl +++ b/docs/genaclperms.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl index edbe19faf..fc6eb1f15 100755 --- a/docs/hvsupport.pl +++ b/docs/hvsupport.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =20 use strict; use warnings; diff --git a/src/access/genpolkit.pl b/src/access/genpolkit.pl index eb7069a6d..6258fd3a1 100755 --- a/src/access/genpolkit.pl +++ b/src/access/genpolkit.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2012-2013 Red Hat, Inc. # diff --git a/src/check-aclperms.pl b/src/check-aclperms.pl index 5b1b4dbad..55b659831 100755 --- a/src/check-aclperms.pl +++ b/src/check-aclperms.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl index 8739cda73..5b6c711dc 100755 --- a/src/check-aclrules.pl +++ b/src/check-aclrules.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013-2014 Red Hat, Inc. # diff --git a/src/check-driverimpls.pl b/src/check-driverimpls.pl index e32055835..4c28f2092 100755 --- a/src/check-driverimpls.pl +++ b/src/check-driverimpls.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/src/check-drivername.pl b/src/check-drivername.pl index 5c8de0aa1..3a62193e3 100755 --- a/src/check-drivername.pl +++ b/src/check-drivername.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2013 Red Hat, Inc. # diff --git a/src/check-symfile.pl b/src/check-symfile.pl index d59a213eb..4f8830086 100755 --- a/src/check-symfile.pl +++ b/src/check-symfile.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =20 # Copyright (C) 2012-2013 Red Hat, Inc. # diff --git a/src/check-symsorting.pl b/src/check-symsorting.pl index 81265e04d..51e38bded 100755 --- a/src/check-symsorting.pl +++ b/src/check-symsorting.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =20 # Copyright (C) 2012-2013 Red Hat, Inc. # diff --git a/src/dtrace2systemtap.pl b/src/dtrace2systemtap.pl index 19d980564..92c76a66e 100755 --- a/src/dtrace2systemtap.pl +++ b/src/dtrace2systemtap.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2011-2012 Red Hat, Inc. # diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index e7a48d578..fb15cc484 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # Copyright (C) 2010-2015 Red Hat, Inc. # @@ -32,6 +32,7 @@ # Extended by Matthias Bolte =20 use strict; +use warnings; =20 use Getopt::Long; =20 diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl index 69d20a344..6ce268c02 100755 --- a/src/rpc/genprotocol.pl +++ b/src/rpc/genprotocol.pl @@ -1,3 +1,4 @@ +#!/usr/bin/env perl # # Generate code for an XDR protocol, optionally applying # fixups to the glibc rpcgen code so that it compiles diff --git a/src/rpc/gensystemtap.pl b/src/rpc/gensystemtap.pl index 7b80fbf83..c0d343509 100755 --- a/src/rpc/gensystemtap.pl +++ b/src/rpc/gensystemtap.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Copyright (C) 2011-2012 Red Hat, Inc. # diff --git a/tests/check-file-access.pl b/tests/check-file-access.pl index 0c75ae998..977a2bc53 100755 --- a/tests/check-file-access.pl +++ b/tests/check-file-access.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # # Copyright (C) 2016 Red Hat, Inc. # diff --git a/tests/oomtrace.pl b/tests/oomtrace.pl index 6d423e796..f799262f2 100755 --- a/tests/oomtrace.pl +++ b/tests/oomtrace.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =20 use strict; use warnings; --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 9 02:13:06 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1505822670057416.9011229490352; Tue, 19 Sep 2017 05:04:30 -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 ADCB31A229E; Tue, 19 Sep 2017 12:04:28 +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 4254A5D984; Tue, 19 Sep 2017 12:04:28 +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 C509D3FAD0; Tue, 19 Sep 2017 12:04:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8JB9gDT017099 for ; Tue, 19 Sep 2017 07:09:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7720860E3B; Tue, 19 Sep 2017 11:09:42 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.219]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F314060BEC for ; Tue, 19 Sep 2017 11:09:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ADCB31A229E Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 19 Sep 2017 13:09:33 +0200 Message-Id: <20170919110933.8721-3-abologna@redhat.com> In-Reply-To: <20170919110933.8721-1-abologna@redhat.com> References: <20170919110933.8721-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/2] python: Don't hardcode interpreter path 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: , MIME-Version: 1.0 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.26]); Tue, 19 Sep 2017 12:04:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is particularly useful on operating systems that don't ship Python as part of the base system (eg. FreeBSD) while still working just as well as it did before on Linux. While at it, make it explicit that our scripts are only going to work with Python 2, and remove the usage of unbuffered I/O, which as far as I can tell has no effect on the output files. Signed-off-by: Andrea Bolognani --- docs/apibuild.py | 2 +- docs/index.py | 2 +- docs/reformat-news.py | 2 +- src/esx/esx_vi_generator.py | 2 +- src/hyperv/hyperv_wmi_generator.py | 2 +- tests/cputestdata/cpu-cpuid.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 87e81f5c3..a788086a6 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python2 # # This is the API builder, it parses the C sources and build the # API formal description in XML. diff --git a/docs/index.py b/docs/index.py index 2f0ad2672..bedec8ae0 100755 --- a/docs/index.py +++ b/docs/index.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -u +#!/usr/bin/env python2 # # imports the API description and fills up a database with # name relevance to modules, functions or web pages diff --git a/docs/reformat-news.py b/docs/reformat-news.py index 39499d933..89f7ccb3d 100755 --- a/docs/reformat-news.py +++ b/docs/reformat-news.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 =20 # reformat-news.py: Reformat the NEWS file properly # diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index bc026bd71..a2b8bef72 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 =20 # # esx_vi_generator.py: generates most of the SOAP type mapping code diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index 9c0accea0..b60335e26 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 =20 # # hyperv_wmi_generator.py: generates most of the WMI type mapping code diff --git a/tests/cputestdata/cpu-cpuid.py b/tests/cputestdata/cpu-cpuid.py index 385d6d1a1..a2fd938c2 100755 --- a/tests/cputestdata/cpu-cpuid.py +++ b/tests/cputestdata/cpu-cpuid.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python2 =20 import sys import json --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list