From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnBEf-0008O9-Bs for qemu-devel@nongnu.org; Thu, 22 Sep 2016 17:08:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnBEZ-0000Jl-BN for qemu-devel@nongnu.org; Thu, 22 Sep 2016 17:08:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnBDb-0008Mk-1c for qemu-devel@nongnu.org; Thu, 22 Sep 2016 17:08:43 -0400 References: <20160922201916.20143-1-marcandre.lureau@redhat.com> <6bd5f0dc-488d-49a3-d3fc-1342ae66fca7@redhat.com> From: Eric Blake Message-ID: Date: Thu, 22 Sep 2016 16:06:51 -0500 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C64RBUsBLT6KbI2hrSw2NEnNKdKkxN7vU" Subject: Re: [Qemu-devel] [PATCH] build-sys: generate .gitignore List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --C64RBUsBLT6KbI2hrSw2NEnNKdKkxN7vU From: Eric Blake To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Message-ID: Subject: Re: [Qemu-devel] [PATCH] build-sys: generate .gitignore References: <20160922201916.20143-1-marcandre.lureau@redhat.com> <6bd5f0dc-488d-49a3-d3fc-1342ae66fca7@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/22/2016 03:47 PM, Marc-Andr=C3=A9 Lureau wrote: >>=20 >> # Consolidated targets >> +tests-cleanfiles =3D *.o >> +tests-cleanfiles =3D .gitignore >> +tests-cleanfiles +=3D qht-bench$(EXESUF) Missed this on the first round: you meant to use +=3D on the .gitignore line. Without it, you aren't excluding ANY .o files. >>> +ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if >> $(MAKECMDGOALS),,fail)) >>> +$(SRC_PATH)/tests/.gitignore: >>> + echo "$(tests-cleanfiles)" | xargs -n1 | sort > $@ >> >> This line is TOO noisy; you'll want to wrap it into a $(call >> quiet-command...). >> >=20 > Yep >=20 >=20 >> >> You could also do it with fewer processes and less typing, as: >> >> printf %s\\n $(tests-cleanfiles) | sort > $@ >> >=20 > Is there a way for printf to split the variable? >=20 > echo "*.o foo" | xargs -n1 > *.o > foo >=20 > vs >=20 > pritnf %s\\n "*.o foo" > *.o foo >=20 > If I remove the quote in the Makefile, then it will expand to all the > non/exisiting .o files. I thought you WANTED shell globbing; but now I see that you don't (you want a literal glob output into the .gitignore). I guess I got thrown by the fact that I didn't see *.o in the generated .gitignore (never mind that I didn't see ANY .o...), from the bug pointed out above. Okay, so you DO want to convert make's spaces into newlines, while avoiding globbing. My initial thought was that 'xargs -n1' feels a bit heavy-handed; tr ' ' '\n' would do the same thing but then you aren't shaving off any processes or any typing. You can temporarily disable file globbing by playing with 'set -f', but that also feels awkward. So maybe your approach is best after all. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --C64RBUsBLT6KbI2hrSw2NEnNKdKkxN7vU 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/ iQEcBAEBCAAGBQJX5EfrAAoJEKeha0olJ0NqAhkH/3QlQymij/VgBq21XxQ3j8gD H1GcmZqFbXFiHH7nfrWNvMlw/0D5AueIkz2/+T2bSSk61zwYD3qYuG+nOz5xGSmh YkjDRv01oIrwxhoCqZAfvr4SPkPXbEjVUCnUcu8pMbPUKcvxp2Zx0nnizTEKyM4k +Lda1yviJkc9V92LN4dEvQJpYSWCVSWIpp7+nuOVB6P5tVJAvQH6KRCWvEo9RGAr x0mOORvKsjhpvNIFJ+RcBCUWsuh0nid32dWRtULKNaZyKQCtSYFX5jFxixItSq0g z+0ta+W4zL3B9q52lm6mO3w4DdIJ6fftprXAB0rtSirJf9KmA+qXu9SI91IvyBQ= =YUJd -----END PGP SIGNATURE----- --C64RBUsBLT6KbI2hrSw2NEnNKdKkxN7vU--