Mike,

> +        vers = '$HeadURL$'
> +        vers = vers.split('/tools/ccc')[0]
> +        vers = ' (' + vers[10:] + ')'
> +        print >>sys.stderr,'ccc version 1.0' + vers

I think:
--
vers = '$Rev$'
vers = vers.split(':',1)[1].strip()
print >>sys.stderr,'ccc version 1.0 (%s)' % vers
--
does the same thing more simply & robustly.

However, I have real doubts this is the way we want to go; I don't
think using the svn keyword for this is appropriate. It will only
change when Driver.py changes, and that will hopefully become fairly
uncorrelated to the clang tree revision. LLVM already has a scheme for
managing the Apple build version; why don't we follow that precedent?

 - Daniel


On Tue, Feb 10, 2009 at 5:01 PM, Mike Stump <[email protected]> wrote:
> Author: mrs
> Date: Tue Feb 10 19:01:17 2009
> New Revision: 64271
>
> URL: http://llvm.org/viewvc/llvm-project?rev=64271&view=rev
> Log:
> More version experimentation.
>
> Modified:
>    cfe/trunk/tools/ccc/ccclib/Driver.py
>
> Modified: cfe/trunk/tools/ccc/ccclib/Driver.py
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Driver.py?rev=64271&r1=64270&r2=64271&view=diff
>
> ==============================================================================
> --- cfe/trunk/tools/ccc/ccclib/Driver.py (original)
> +++ cfe/trunk/tools/ccc/ccclib/Driver.py Tue Feb 10 19:01:17 2009
> @@ -304,7 +304,10 @@
>
>     def printVersion(self):
>         # FIXME: Print default target triple.
> -        print >>sys.stderr,'ccc version 1.0 ($HeadURL$)'
> +        vers = '$HeadURL$'
> +        vers = vers.split('/tools/ccc')[0]
> +        vers = ' (' + vers[10:] + ')'
> +        print >>sys.stderr,'ccc version 1.0' + vers
>
>     def handleImmediateOptions(self, args):
>         # FIXME: Some driver Arguments are consumed right off the bat,
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to