Received: from eggs.gnu.org ([2001:4830:134:3::10]:45642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkHK6-00024q-IY for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:02:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkHK1-0002g2-6G for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:02:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkHK0-0002fH-Sp for qemu-devel@nongnu.org; Wed, 14 Sep 2016 17:02:21 -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> From: Thomas Huth Message-ID: <0a671aa0-e065-7feb-00b4-751537854771@redhat.com> Date: Wed, 14 Sep 2016 23:02:09 +0200 MIME-Version: 1.0 In-Reply-To: <5dbcf864-395d-455e-9af9-19449852820f@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wa0Or9nfxqx5FW96WTogqUBoCmFi6SpSI" 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: Eric Blake , "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) --wa0Or9nfxqx5FW96WTogqUBoCmFi6SpSI From: Thomas Huth To: Eric Blake , "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Peter Maydell , stefanha@redhat.com, Paolo Bonzini Message-ID: <0a671aa0-e065-7feb-00b4-751537854771@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> In-Reply-To: <5dbcf864-395d-455e-9af9-19449852820f@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 14.09.2016 16:44, Eric Blake wrote: > On 09/14/2016 05:35 AM, Thomas Huth wrote: >> Erik, >=20 > It's Eric, but don't sweat it (you're not the first, and probably not > the last, to typo names) Oops, big sorry! I must have been confused by the German spelling of that name :-( >>>>> +while [ $# -ge 1 ]; do >>>>> + case "$1" in >>>>> + -s) START=3D"$2" ; shift ;; >>>> >>>> POSIX recommends that short options with arguments be parseable both= as >>>> '-s foo' and '-sfoo'. I don't care that you aren't POSIX compliant,= but >>>> using getopt(1) or getopts(1) may make it easier to comply. >> >> OK. After googling a little bit, it sounds like getopts is the way to >> go, e.g. http://mywiki.wooledge.org/BashFAQ/035#getopts says that geto= pt >> should not be used. >=20 > getopts(1) is POSIX, but not universally present. I _think_ your script= > was portable to /bin/sh, but it may be easier to write by relying on > bashisms and changing line one to /bin/bash, at which point we know > getopts is present. Well, /bin/bash is also not really portable ... I've seen systems in the past where bash was installed in another directory or not at all... Anyway, FYI, I've found two more nice ways to check for POSIX compliance:= - There is a program called checkbashisms which reports bash related style - "posh" is a very minimalistic POSIX compliant shell which hardly supports any of the bash extras And indeed, both pointed me to another bashism in my script: The "function" keyword is not portable and should be avoided... oh well. 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... Thomas --wa0Or9nfxqx5FW96WTogqUBoCmFi6SpSI 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.0.22 (GNU/Linux) iQIcBAEBAgAGBQJX2brWAAoJEC7Z13T+cC21aGsP/ic3pvuL44iJvxQoDUu/OotA 3+rExUVa1FcHAn1PKsC/u/jW3d9RHiAh7KgODBwESXeGtaNRTar5eFxCuLvvqpnN VIJDW56YqwyH2+I+umhNaLOIT/KISfLOFXlJPDH7v+gcTrSCTdTtViH1Qb04GahW QMZf1/4/il5S43B0YFP9Y1rZrApDVH7nFlHaz4LzJSMsz1KSEMlT5h3A1LqE8g5k R5vOVdxmYnoCqv00Ki7tY0N7GlmbP/rdsl23npmF8f1XmErVFGZF/THDSNrRui5U njdZJDCubiiwW0QXf18yPoeGXo2rCSa086rHN4af4lO6a+nEhKft+vYx4OJVUAWq /7+R9zGBSffYamGI1ny3zeKdXiy0GVIMSr8vQMaSc+5iV4LaaX/oZ1yF8yULlkun OzhBIEcWWXzJ+PKLiIL32UjSg6AdaTZaIP+tA3M/g3npIUKIcJ1ReSugkEB7mMAI PU9igFliIbILDkP5j+WGsJAnSxKVn4VLi5hdcze2mfoc1v0fsjbansZG54RAVXct kJDOAB+oyQAVbYB7rvCuIXMEPd5rP8Ud9WBM81L+7oCKAH99m0PcTN7tUAin1PQ1 NB4JN/M43UuoukvxQX14+ssctUTazooboqDPfbWBMBi+YgRmei/aLMVw/Owyx/gW n+263i4litdO+nPmGe/G =l8sJ -----END PGP SIGNATURE----- --wa0Or9nfxqx5FW96WTogqUBoCmFi6SpSI--