From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56332 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTgOi-00071f-BO for qemu-devel@nongnu.org; Fri, 17 Dec 2010 14:55:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTgOE-0006vG-Of for qemu-devel@nongnu.org; Fri, 17 Dec 2010 14:55:02 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:59004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTgOE-0006uy-6P for qemu-devel@nongnu.org; Fri, 17 Dec 2010 14:54:54 -0500 Message-ID: <4D0BC00B.3040800@mail.berlios.de> Date: Fri, 17 Dec 2010 20:54:51 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] win32: Fix CRLF problem in make_device_config.sh References: <1292536325-12881-1-git-send-email-weil@mail.berlios.de> <4D0A95BC.8040509@redhat.com> <4D0B6922.3090401@redhat.com> <4D0BB3A1.30001@mail.berlios.de> <7DDF4A15-DEEC-422A-94C7-8ED20B6DAA92@web.de> In-Reply-To: <7DDF4A15-DEEC-422A-94C7-8ED20B6DAA92@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: QEMU Developers Am 17.12.2010 20:33, schrieb Andreas Färber: > Am 17.12.2010 um 20:01 schrieb Stefan Weil: > >> Am 17.12.2010 14:44, schrieb Paolo Bonzini: >>> On 12/17/2010 02:34 PM, Andreas Färber wrote: >>>>>> >>>>>> Fix this by removing any \r at end of line. >>>>> >>>>> Why isn't cygwin (or whatever you're using) removing it? >>>> >>>> I believe Cygwin had an option to choose the line ending style once >>>> during setup. By default it uses Unix-style line endings. >>>> If someone edits source files in some Windows editor, the above issue >>>> seems likely. >>> >>> Hmm, MSYS is more problematic: the manual says "In the MSYS >>> environment under Windows, `gawk' automatically uses binary mode for >>> reading and writing files. Thus there is no need to use the >>> `BINMODE' variable. This can cause problems with other Unix-like >>> components that have been ported to Windows that expect `gawk' to do >>> automatic translationof `"\r\n"', since it won't.". >> >> I had the \r problem when using msys. There seem to be several factors: >> >> * git configuration (add CR / don't add CR) >> * msys mount options (binmode / textmode) >> * (g)awk (read binary) >> >>> >>>> My awk foo is insufficient to ack the patch but if it doesn't break >>>> Unices it looks reasonable to me. >>> >>> I'd be worried a bit about Solaris and other proprietary OSes with >>> prehistoric Unix utilities. Perhaps using \012 instead of \r is >>> better. >>> >>> Paolo >> >> I currently have no possibility to run tests with other awk >> implementations, >> so I cannot tell whether \012 is needed at all (\r is not a new >> invention). >> Do all awk versions support regular expressions with characters in >> octal encoding?. >> >> Perhaps we can wait several days for feedback from users with an old awk >> and apply the patch if there is none. > > I have an open bug ticket wrt configure being broken on Solaris 10 due > to tracing shell incompatibilities. > > If you provide a small self-contained example I can check though. > > Andreas Example (needs bash's echo -e): # create line with crlf ending: echo -e 'include xy\r' >file # returns xy\r: awk '/^include / {ORS=" "; print $2}' file | od # should return xy: awk '/^include / {ORS=" "; sub(/\r$/, "", $2); print $2}' file | od Regards, Stefan