From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrCqu-0003az-RW for qemu-devel@nongnu.org; Tue, 17 Jul 2012 14:50:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrCqt-0002VA-B5 for qemu-devel@nongnu.org; Tue, 17 Jul 2012 14:50:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrCqt-0002V6-33 for qemu-devel@nongnu.org; Tue, 17 Jul 2012 14:50:31 -0400 Message-ID: <5005B3D9.10906@redhat.com> Date: Tue, 17 Jul 2012 12:50:01 -0600 From: Eric Blake MIME-Version: 1.0 References: <1342550012-5697-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1342550012-5697-1-git-send-email-aliguori@us.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig1C85090F83AE26316ED2CB35" Subject: Re: [Qemu-devel] [PATCH] build: add make dist target (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1C85090F83AE26316ED2CB35 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/17/2012 12:33 PM, Anthony Liguori wrote: > Let's stop screwing up releases by having a script do the work that Ant= hony's > fat fingers can't seem to get right. >=20 > Cc: Michael Roth > Signed-off-by: Anthony Liguori > --- > +++ b/scripts/make-release > @@ -0,0 +1,24 @@ > +#!/bin/bash -e Is it worth tightening this up to avoid bashisms like pushd, and use just POSIX sh? > +# This work is licensed under the terms of the GNU GPLv2 or later. > +# See the COPYING file in the top-level directory. > + > +src=3D"$1" > +version=3D"$2" > +destination=3Dqemu-${version} Inconsistent quoting. The fact that you quoted $2 when assigning to version makes me worry that you are trying to plan for someone calling this script where $2 contains whitespace, but then destination would contain whitespace. This is equivalent with minimal typing (regardless of whitespace, since variable assignment is not subject to word splitting= ): src=3D$1 version=3D$2 destination=3Dqemu-$version or if you want to consistently use full quoting: src=3D"${1}" version=3D"${2}" destination=3D"qemu-${version}" > + > +git clone "${src}" ${destination} But here is a line where it matters if $destination contains whitespace because $2 contained whitespace. > +pushd ${destination} > +git checkout "v${version}" > +git submodule update --init > +rm -rf .git roms/*/.git > +popd The POSIX spelling to avoid pushd would be: ( cd $destination git checkout v$version git submodule update --init rm -rf .git roms/*/.git ) [again, I did minimal typing; you may prefer the "v${version}" style instead of minimalism] > +tar cfj ${destination}.tar.bz2 ${destination} 'j' is a GNU tar extension. Are you okay hard-coding this script to only run on machines with GNU tar? Or should you split this into 'tar c =2E.. | bzip2 ...'? > +rm -rf ${destination} >=20 For the record, I think releases are done so seldom, and on a controlled-enough environment where extra tools can be relied on, that this script probably does not have to be super-portable. Therefore, since what you have works for your environment, then even though I raked it over the portability coals above I'm okay if you use it as-is rather than posting a v3. Hence, I give my: Reviewed-by: Eric Blake --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig1C85090F83AE26316ED2CB35 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQBbPZAAoJEKeha0olJ0NqrmYIAKbFXCos2igQRa98kveHXj7p NBU9K0bHoDvUjseuV+k/8FOB4SK1Dttwan7xx3EmxyEP6oz4v/HCH86IGAUkiFrE uJEg3vvoZdhZmgofJe5TPe96w4LqP14pYA4kFfKsHqBY+dDxLIKe1TTpMf6O2xrm II4eeMXi/l7/eVDm7kZcasDJZeWXbsAjZb3PRjCoPfMpTPeJwkpkA6+0eLMRK/g4 8yJaqUmkLbpWfqNwOcErlISHmsoqqDLDxTwYidwWU1GdAeE3dz9z6aj57XTKv4jX n7n1CBzOPBHB6fQoMY2SbTIGwrlop9QgUvmSHyjuQ0DE0Wpg5uDP75NOZQoapZU= =vf41 -----END PGP SIGNATURE----- --------------enig1C85090F83AE26316ED2CB35--