diff -urN tiarra-20031116/ChangeLog tiarra-20031117/ChangeLog --- tiarra-20031116/ChangeLog 2003-11-17 07:44:39.000000000 +0900 +++ tiarra-20031117/ChangeLog 2003-11-17 10:27:48.000000000 +0900 @@ -1,5 +1,8 @@ 2003-11-17 Topia + * tiarra: enhancement. + パッケージ用にいくつかのバージョン変数を追加した。 + * module/Log/Channel.pm: enhancement/need reload. デフォルトのログファイルパーミッションを 644 から 600 にした。 @@ -1055,7 +1058,7 @@ * これ以前のログは書いていません。 -# Id: $Id: ChangeLog,v 1.119 2003/11/16 19:04:39 topia Exp $ +# Id: $Id: ChangeLog,v 1.120 2003/11/17 01:27:19 topia Exp $ # Author: $Author: topia $ -# Date: $Date: 2003/11/16 19:04:39 $ -# Revision: $Revision: 1.119 $ +# Date: $Date: 2003/11/17 01:27:19 $ +# Revision: $Revision: 1.120 $ diff -urN tiarra-20031116/tiarra tiarra-20031117/tiarra --- tiarra-20031116/tiarra 2003-11-17 07:44:39.000000000 +0900 +++ tiarra-20031117/tiarra 2003-11-17 10:27:48.000000000 +0900 @@ -5,7 +5,7 @@ # This is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # ----------------------------------------------------------------------------- -# $Id: tiarra,v 1.28 2003/11/16 19:04:39 topia Exp $ +# $Id: tiarra,v 1.29 2003/11/17 01:27:19 topia Exp $ # ----------------------------------------------------------------------------- require 5.006; use strict; @@ -16,12 +16,25 @@ use ModuleManager; use ReloadTrigger; use IO::Handle; -my $version = '0'; my $conf_file = ''; my $quiet = 0; my $no_fork = 0; -&check_changelog; + +# version はバージョン番号 +my $version = '0'; + +# based はベースにしている Tiarra のバージョン(パッケージまたは fork 時用) +my $based_version = ''; + +# short は短いバージョン番号。(CTCP-Version の返答に使われる) +my $short_version = ''; + + +# オリジナル(based_version が未定義)ならば ChangeLog を検索する。 +&check_changelog unless $based_version; +# short_version が未定義なら version の値を使う。 +$short_version ||= $version; &install_signal_handlers; @@ -63,8 +76,8 @@ print "\n"; print "options:\n"; print " --help print this message\n"; - print " --dumpversion print version\n"; print " --version print version infomation\n"; + print " --dumpversion print version\n"; print " --config= tiarra configuration file; default is 'tiarra.conf'\n"; print " --quiet don't output any messages to stdout and stderr\n"; print " --no-fork don't move to background when started in quiet mode\n"; @@ -118,7 +131,7 @@ print join("\n",get_credit()) . "\n"; exit; } elsif (&find_option('dumpversion')) { - print &version . "\n"; + print $version . "\n"; exit; } @@ -240,11 +253,16 @@ } sub version { - $version; + $short_version; } sub get_credit { - return ("- T i a r r a - :::version #${version}:::", + return ( + (!$based_version ? + "- T i a r r a - :::version #${version}:::" : + ("- T i a r r a - :::version ${version}:::", + " based #${based_version}") + ), "Copyright (c) 2002-2003 phonohawk. All rights reserved.", "This is free software; you can redistribute it and/or modify it", " under the same terms as Perl itself.");