From 5994535a9fd47190a54ac1a0d723cd64ec713641 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 1 Sep 2006 16:06:39 +0000 Subject: rbot now tries to report svn revision when ran from a svn checkout --- bin/rbot | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bin/rbot') diff --git a/bin/rbot b/bin/rbot index ce5c86bd..8fba53d6 100755 --- a/bin/rbot +++ b/bin/rbot @@ -32,6 +32,25 @@ require 'fileutils' $version="0.9.11-svn" $opts = Hash.new +if $version =~ /svn/ + up = File.dirname(__FILE__) + "/.." + rev = " (unknown revision)" + begin + svn_out = `svn info #{up}` + if svn_out =~ /Last Changed Rev: (\d+)/ + rev = " (revision #{$1}" + end + svn_st = `svn st #{up}` + if svn_st =~ /^M / + rev << ", local changes" + end + rev << ")" + rescue => e + puts e.inspect + end + $version += rev +end + orig_opts = ARGV.dup opts = GetoptLong.new( -- cgit v1.2.3