configure: pull the version number from Bazaar

Michael Hope michael.hope@linaro.org
Wed Nov 9 00:43:00 GMT 2011


On Wed, Nov 2, 2011 at 1:02 PM, Yann E. MORIN
<yann.morin.1998@anciens.enib.fr> wrote:
> Michael, Thomas, All,
>
> On Thursday 20 October 2011 23:51:32 Yann E. MORIN wrote:
>> On Thursday 20 October 2011 05:38:13 Michael Hope wrote:
>> > If '.version' ends with bzr then use bzr to automatically add the
>> > revision number to the version string.
>> The official repository is using Mercurial, and only that will be
>> supported upstream.
>
> During the Prague events last week, a suggestion was made (by Thomas)
> regarding this issue:
>  - ./configure checks if a script is present
>  - ./configure runs the script
>  - the script is expected to output a single line, using whatever
>   is deemed fit to compute a VCS version
>  - ./configure appends the line above to the version it internally
>   computed
>
> That way, it is easy to add such a script to the different VCSes used by
> the different users, without the need to always port the change to the
> ./configure script, and without the change always trying to escape up
> to upstream. ;-)
>
> What do you think? Would that be OK with you? With others?

That would work.  Something like a 'version.sh' that returns the whole
version string to allow for arbitrary formatting.

Along the lines of:

version=`cat .version`
if [ -x version.sh ]; then version=`./version.sh $version`
else if version ends with hg; then version=$version + `hg revno`

I'll see about sending a patch.

-- Michael

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list