[Linux-ha-dev] Ldirectord Version Number

Andrew Beekhof beekhof at gmail.com
Mon Mar 19 06:19:16 MDT 2007


try looking at ha_version.h which defines HA_HG_VERSION using some
makefile magic i concocted...

the variable will contain the current change-set ID and even works if
the user downloaded a Hg tarball rather than using "hg clone"

On 3/19/07, Horms <horms at verge.net.au> wrote:
> Back in the days of CVS the ldirectord version number was set
> by SCCS keyword substitution. While I'm not a big fan of keyword
> substitution, it was very useful to be able to correlate the
> ldirectord that someone was running to a CVS version.
>
> Enter mercurial. Exit keyword substitution.
>
> Currently the version number is set as follows:
>
> my $VERSION="Heartbeat-Mercurial"
>
> This is:
>   a) not a very informative version (number) and
>   b) a syntax error that causes perl to generate all sorts of
>      nasty errors before failing completely.
>
> Clearly there is some room for improvement here. To this end I looked
> around at how to do substitutions using hg. The best that I have
> been able to come up with so far is the following snippet in my hgrc.
>
> # Based on
> # http://www.arcknowledge.com/gmane.comp.version-control.mercurial.devel/2006-01/msg00001.html
> [encode]
> ldirectord/ldirectord.in = sed -e 's,$HGSET [^$]* [$],$HGSET '`hg tip | sed -n -e 's/changeset:.*://; T; p; q'`' $,'
>
> This does seem to effect substitution as desired (by me).
> But I don't think this hgrc snippet will get replicated
> by an "hg clone", which means I'll likely be the only person
> with it in effect. As I make most of the ldirectord changes
> this might not be such a problem. But it is less than ideal.
>
> Any ideas?
>
> --
> Horms
>   H: http://www.vergenet.net/~horms/
>   W: http://www.valinux.co.jp/en/
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>


More information about the Linux-HA-Dev mailing list