|
From: | Matthias Neeracher |
Subject: | Re: Proposed patch: configure version number checking |
Date: | Sun, 27 Aug 2006 11:51:33 -0700 |
On Aug 26, 2006, at 11:36 PM, Mats Bengtsson wrote:
• The first grep is looking for [0-9][0-9]*\.[0-9] at the beginning of a line or following a space • The tr transforms both situations into "beginning of a line". • Therefore, adding the beginning of line anchor makes sure that the second grep looks for the same pattern as the first grep. The unpatched version will bite on any word containing a dotted number in the same line that the first grep identified. However, I must admit that upon further review, my patch was not entirely sound in that it would have broken in the case of a tool with a double digit major version number (none of which are currently used in the lilypond build process, but ghostscript may eventually get there), so this would be a bit safer: ----------------------- diff -ruN lilypond-2.9.16-orig/aclocal.m4 lilypond-2.9.16/aclocal.m4 --- lilypond-2.9.16-orig/aclocal.m4 2006-08-26 20:47:16.000000000 -0700 +++ lilypond-2.9.16/aclocal.m4 2006-08-26 21:43:45.000000000 -0700 @@ -34,7 +34,7 @@ ## grab the first version number in --version output. eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '\(^\| \)[0-9][0-9]*\.[0-9]' \ | head -n 1 \ - | tr ' ' '\n' | grep '[0-9]\.[0-9]' | head -n 1 | sed 's/\([0-9.]*\).*/\1/g'\`\" + | tr ' ' '\n' | grep '^[0-9][0-9]*\.[0-9]' | head -n 1 | sed 's/\([0-9.]*\).*/\1/g'\`\" if test -z "$_ver"; then ## If empty, try date [fontforge] ------------------------- Either of the two versions of the patch correctly handle two version strings which were broken in the unpatched version: powerpc-apple-darwin8-g++-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5247) guile-1.6-config - Guile version 1.6.7 while the second of these is probably quite specific to fink on MacOS X, the first might be quite a bit more common. Matthias |
[Prev in Thread] | Current Thread | [Next in Thread] |