Received: from eggs.gnu.org ([2001:4830:134:3::10]:49847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkHiq-00062y-LN for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:28:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkHim-0001Wx-4L for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:28:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkHil-0001Wo-QV for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:27:56 -0400 References: <1473772858-30881-1-git-send-email-thuth@redhat.com> <64a69157-6f90-dd7d-e1bc-9b319b91ec55@redhat.com> <20160913160647.GA30949@redhat.com> <80ea53df-39c9-1087-4a72-5a6dd050abc4@redhat.com> <5dbcf864-395d-455e-9af9-19449852820f@redhat.com> <0a671aa0-e065-7feb-00b4-751537854771@redhat.com> From: Eric Blake Message-ID: <4468324d-b9fb-e629-9909-0651bf6f5ad7@redhat.com> Date: Wed, 14 Sep 2016 16:17:52 -0500 MIME-Version: 1.0 In-Reply-To: <0a671aa0-e065-7feb-00b4-751537854771@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vExBuOOIooBtEQ0nV13uIiaNHBFexMJRj" Subject: Re: [Qemu-devel] [PATCH v2] scripts: Add a script to check for bug URLs in the git log List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Peter Maydell , stefanha@redhat.com, Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vExBuOOIooBtEQ0nV13uIiaNHBFexMJRj From: Eric Blake To: Thomas Huth , "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Peter Maydell , stefanha@redhat.com, Paolo Bonzini Message-ID: <4468324d-b9fb-e629-9909-0651bf6f5ad7@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] scripts: Add a script to check for bug URLs in the git log References: <1473772858-30881-1-git-send-email-thuth@redhat.com> <64a69157-6f90-dd7d-e1bc-9b319b91ec55@redhat.com> <20160913160647.GA30949@redhat.com> <80ea53df-39c9-1087-4a72-5a6dd050abc4@redhat.com> <5dbcf864-395d-455e-9af9-19449852820f@redhat.com> <0a671aa0-e065-7feb-00b4-751537854771@redhat.com> In-Reply-To: <0a671aa0-e065-7feb-00b4-751537854771@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2016 04:02 PM, Thomas Huth wrote: > Well, /bin/bash is also not really portable ... I've seen systems in th= e > past where bash was installed in another directory or not at all... True, but we already liberally use /bin/bash scripts elsewhere in qemu.git, so at least you wouldn't be the first, and if someone wants to build qemu on a platform where /bin/bash doesn't exist, they'd do a search-and-replace change to all affected scripts. >=20 > Anyway, FYI, I've found two more nice ways to check for POSIX complianc= e: >=20 > - There is a program called checkbashisms which reports bash related > style >=20 > - "posh" is a very minimalistic POSIX compliant shell which hardly > supports any of the bash extras Yep, both of those are nice. >=20 > And indeed, both pointed me to another bashism in my script: The > "function" keyword is not portable and should be avoided... oh well. In fact, even bash users discourage the use of the 'function' keyword. It exists because ksh has it, but ksh gives it different semantics than bash (what's worse, 'local' variables in bash functions always have dynamic scope; while in ksh, 'local' variables in POSIX-style functions have static scope and the only way to get dynamic scope is to use the 'function' keyword, except that the ksh maintainer says that he hates dynamic scope and wishes he hadn't done it). > Not > sure whether I really should do a v3 of my patch, convert it to python > or just give up the idea of releasing such a script to the public... I think keeping it as a shell script is probably okay (certainly easier than trying to convert it to python, at this point in the review process). And it does seem like a useful script. Sometimes, it's hard to see the forest (improving the ecosystem by accepting useful scripts into the project, even if only a handful of people ever run the script) for the trees (nitpicking on portability details that won't impact anyone who never runs the script). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --vExBuOOIooBtEQ0nV13uIiaNHBFexMJRj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJX2b6AAAoJEKeha0olJ0NqEhoH/is4i2FwXeoJODRXhz/5muyz BqlIzriSrINNJDIrorBOENwWHFvi+uPw27TNpGRbFX9dcZT1coA3ON00plp/8xKK E/7NJ4Vj5c+ygWuF4Vh8K49S8vLg1mqs5G1fe1J+6KwAP7RNdOJjVY+hPnJEQkYE 5IcSCQU2QBh9BHuu9CerQhM/FWzIRqmwiu1IkBB9NpNfuxIIh73J9TLWJRC32TuU /YR9y8VjVZj1J9H58P+zIQ2a7zfPd+lu1Y+AdeY6CCr3peSU0o6j9D6L+LlCmIuR P6GKY9ndSNjNzseXtmTZZKxOa/qz8o+Af7mEhMNQw4+ZCTayYj0sa5sfIQZCjAo= =999P -----END PGP SIGNATURE----- --vExBuOOIooBtEQ0nV13uIiaNHBFexMJRj--