From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWaEF-0006hv-G5 for qemu-devel@nongnu.org; Mon, 31 Aug 2015 21:19:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWaEC-00048q-Bi for qemu-devel@nongnu.org; Mon, 31 Aug 2015 21:19:15 -0400 Date: Tue, 1 Sep 2015 10:56:11 +1000 From: David Gibson Message-ID: <20150901005611.GM11475@voom.redhat.com> References: <1440746120-21577-1-git-send-email-gwshan@linux.vnet.ibm.com> <1440746120-21577-4-git-send-email-gwshan@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QqzFzR/RUlLahzby" Content-Disposition: inline In-Reply-To: <1440746120-21577-4-git-send-email-gwshan@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v7 3/8] scripts: Submit changes while updating linux headers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gavin Shan Cc: aik@ozlabs.ru, peter.maydell@linaro.org, thuth@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --QqzFzR/RUlLahzby Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 28, 2015 at 05:15:15PM +1000, Gavin Shan wrote: > This submits changes with formatted commit log while updating Linux > headers using scripts/update-linux-headers.sh. >=20 > Signed-off-by: Gavin Shan > --- > scripts/update-linux-headers.sh | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) >=20 > diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-heade= rs.sh > index 18daabe..1be02b8 100755 > --- a/scripts/update-linux-headers.sh > +++ b/scripts/update-linux-headers.sh > @@ -63,6 +63,28 @@ cp_virtio() { > fi > } > =20 > +submit_change() { > + from=3D$1 > + to=3D$2 > + if ! [ -e $to/include/qemu-common.h ]; then > + echo "$to not QEMU source directory, skip submitting changes" > + exit 3 > + fi > + > + version=3D$(make -C $from -s kernelversion) > + commit=3D$(cd $from && git log --oneline -1 | cut -d " " -f 1) "git rev-parse HEAD" might be a simpler way to get the current commit id. > + subject=3D"Synchronize Linux headers from kernel $version" > + message=3D"Synchronize the Linux headers from kernel version $versio= n" > + message=3D$(echo "$message\n(commit $commit)") Might be more readable to use the shell < + res=3D$(cd $to && git commit -qa -m "$subject" -m "$message" -s && e= cho $?) > + if [ "$res" =3D "0" ]; then > + echo "Changes submitted successfully" > + else > + echo "Error $res submitting changes" > + exit 4 > + fi > +} > + > # This will pick up non-directories too (eg "Kconfig") but we will > # ignore them in the next loop. > ARCHLIST=3D$(cd "$linux/arch" && echo *) > @@ -132,3 +154,5 @@ cat <$output/include/standard-headers/linux/if_= ether.h > EOF > =20 > rm -rf "$tmpdir" > + > +submit_change "$linux" "$output" Obviously this will fail if you run it against an exported qemu source tree, instead of a git tree. I'm not sure if that's a problem. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --QqzFzR/RUlLahzby Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV5PerAAoJEGw4ysog2bOSJz0P/3tjGCZ5RxWCPePJtr7cnHJh VktPCEZZc8x9So/PxnS3eML0bXuExdg5eiij1+VObhCTeEztCQelxHI3TwMPpqNf wUsN4jVATs5UkDmuDyl2sYfI07VjW1BeHrYfqIBG4pD8yCD6speJ/NcLW8wMw+ZW RW2kkdW4DsSIRTs9479SebxpOUERTS9lioK6De06F4m3FB7QYO4kucycCORLJaZx 6F74VLJRkxxRVNLMR0LhOs+zPUFY6n1jJBgIrJO1jsBo+G07vW3kDz9EiTiDBc+K 8vVDJ8ZMsDUMZaKwrCpckKuaoV5jOe9rb8792WZcf4cPwLHJM4TMvI3C2T5bwUmN NS986ZulIXPtAlRj69s17KB9xd9dn2HBXrk0oLQZsBX9mnXbEFy3MSpDfYlGGDFx TFgujYGInbAPksW8hJNze9X5G6sDlZ3R2fhdKwXNcBSzMShlRgucfxnscrWyt+FO mxFtocgvZNnJyK+vEqzDjMBA+G1+jJVmpl4KF63eHBo5B0IJig6vX+7UOkDEIf89 /+FmCNPndxJgWbrojL52YsNcMi9vERBO1xEOqVz8HmI7KiX5UQO6YWFaYXnQ8BsR QwhsteCNwLsbkqTkRvOyaM3+40q1ueiQ09q+qr1yFf2+4n32jVS87f53p0+9LkSD dkZrwNm8GbEry8OuxfUS =VE9D -----END PGP SIGNATURE----- --QqzFzR/RUlLahzby--