From dbc7da9d3454d1f40de621af97218ebdf0e78268 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Fri, 4 Feb 2011 23:04:32 -0700 Subject: [PATCH] Added Git revision to version string for dev releases. --- bin/auto | 3 ++- doc/CHANGELOG | 1 + src/Core/IRC.pm | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/auto b/bin/auto index a5d3614..0be2214 100755 --- a/bin/auto +++ b/bin/auto @@ -25,7 +25,8 @@ BEGIN { VER => 3, SVER => 0, REV => 0, - RSTAGE => 'd' + RSTAGE => 'd', + GR => substr(`cat $Bin/../.git/refs/heads/indev`, 0, 7) }; } use API::Std qw(conf_get err); diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 03300bd..bc111a4 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Added Git revision to version string for dev releases. * Added an FML module for retrieving random FML quotes. * Privilege to use a command is now handled by the priv arg of cmd_add. diff --git a/src/Core/IRC.pm b/src/Core/IRC.pm index ad79b08..9e78498 100644 --- a/src/Core/IRC.pm +++ b/src/Core/IRC.pm @@ -17,7 +17,12 @@ sub version_reply my %src = usrc(substr($ex[0], 1)); if ($ex[3] eq ":\001VERSION\001") { - notice($svr, $src{nick}, "VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE." ".$OSNAME); + if (Auto::RSTAGE ne 'd') { + notice($svr, $src{nick}, "VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE." ".$OSNAME); + } + else { + notice($svr, $src{nick}, "VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE."-".Auto::GR." ".$OSNAME); + } } return 1;