mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-19 10:29:30 +01:00
Move $VERSION out of PBot.pm and to its own VERSION.pm module
This commit is contained in:
parent
4e4574d2b6
commit
b1c2a12500
@ -10,15 +10,10 @@ package PBot::PBot;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
# These are set automatically by the build/commit script
|
use PBot::VERSION;
|
||||||
use constant {
|
|
||||||
BUILD_NAME => "PBot",
|
|
||||||
BUILD_REVISION => 140,
|
|
||||||
BUILD_DATE => "2010-06-04",
|
|
||||||
};
|
|
||||||
|
|
||||||
use vars qw($VERSION);
|
use vars qw($VERSION);
|
||||||
$VERSION = BUILD_NAME . " revision " . BUILD_REVISION . " " . BUILD_DATE;
|
$VERSION = PBot::VERSION::BUILD_NAME . " revision " . PBot::VERSION::BUILD_REVISION . " " . PBot::VERSION::BUILD_DATE;
|
||||||
|
|
||||||
# unbuffer stdout
|
# unbuffer stdout
|
||||||
STDOUT->autoflush(1);
|
STDOUT->autoflush(1);
|
||||||
|
20
PBot/VERSION.pm
Normal file
20
PBot/VERSION.pm
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# File: VERSION.pm
|
||||||
|
# Author: pragma_
|
||||||
|
#
|
||||||
|
# Purpose: Keeps track of bot version.
|
||||||
|
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
package PBot::VERSION;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
# These are set automatically by the build/commit script
|
||||||
|
use constant {
|
||||||
|
BUILD_NAME => "PBot",
|
||||||
|
BUILD_REVISION => 141,
|
||||||
|
BUILD_DATE => "2010-06-04",
|
||||||
|
};
|
||||||
|
|
||||||
|
1;
|
@ -13,11 +13,11 @@ $rev++;
|
|||||||
|
|
||||||
print "New version: $rev $date\n";
|
print "New version: $rev $date\n";
|
||||||
|
|
||||||
open my $in, '<', "PBot/PBot.pm" or die "Couldn't open PBot.pm for reading: $!";
|
open my $in, '<', "PBot/VERSION.pm" or die "Couldn't open VERSION.pm for reading: $!";
|
||||||
my @lines = <$in>;
|
my @lines = <$in>;
|
||||||
close $in;
|
close $in;
|
||||||
|
|
||||||
open my $out, '>', "PBot/PBot.pm" or die "Couldn't open PBot.pm for writing: $!";
|
open my $out, '>', "PBot/VERSION.pm" or die "Couldn't open VERSION.pm for writing: $!";
|
||||||
|
|
||||||
foreach my $text (@lines) {
|
foreach my $text (@lines) {
|
||||||
$text =~ s/BUILD_NAME\s+=> ".*",/BUILD_NAME => "PBot",/;
|
$text =~ s/BUILD_NAME\s+=> ".*",/BUILD_NAME => "PBot",/;
|
||||||
|
Loading…
Reference in New Issue
Block a user