diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | modules/Version.pm | 25 | ||||
-rwxr-xr-x | mpc.pl | 14 | ||||
-rwxr-xr-x | mwc.pl | 14 |
4 files changed, 58 insertions, 10 deletions
@@ -1,6 +1,19 @@ -Tue May 18 07:22:53 2004 Chad Elliott <elliott_c@ociweb.com> +Tue May 18 09:37:29 2004 Chad Elliott <elliott_c@ociweb.com> * modules/Version.pm: + + Added code to automatically determine the beta version number at + run-time. This number is determined by the manipulating the total + number of ChangeLog entries. + + * mpc.pl: + * mwc.pl: + + Provide a getBasePath() function to allow MPC to determine the + location of the ChangeLog. + +Tue May 18 07:22:53 2004 Chad Elliott <elliott_c@ociweb.com> + * modules/ProjectCreator.pm: When parsing the component list, convert any $(...) to relative diff --git a/modules/Version.pm b/modules/Version.pm index 8897a25b..f1a9b4f5 100644 --- a/modules/Version.pm +++ b/modules/Version.pm @@ -16,7 +16,30 @@ use strict; # Data Section # ************************************************************ -my($version) = '3.1.1'; +## This is the starting major and minor version +my($version) = '3.1'; + +## Here we determine the beta version. The base variable +## is the negated number of existing ChangeLog entries at the +## time of the release of the major and minor version. We then +## add the total number of ChangeLog entries to the base to +## get the beta version. +my($base) = -36; +if (open(CLH, ::getBasePath() . '/ChangeLog')) { + while(<CLH>) { + if (/^\w\w\w\s/) { + ++$base; + } + } + close(CLH); + + ## We then append the beta version number to the version string + $version .= ".$base"; +} +else { + print "WARNING: Unable to determine the beta version number of MPC\n"; +} + # ************************************************************ # Subroutine Section @@ -14,6 +14,7 @@ eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' use strict; use Cwd; +use Config; use File::Basename; my($basePath) = getExecutePath($0); @@ -25,13 +26,18 @@ require MPC; # Subroutine Section # ************************************************************ +sub getBasePath { + return $basePath; +} + + sub which { - my($prog) = shift; - my($exec) = $prog; - my($part) = ''; - my($envSep) = ($^O eq 'MSWin32' ? ';' : ':'); + my($prog) = shift; + my($exec) = $prog; if (defined $ENV{'PATH'}) { + my($part) = ''; + my($envSep) = $Config{'path_sep'}; foreach $part (split(/$envSep/, $ENV{'PATH'})) { $part .= "/$prog"; if ( -x $part ) { @@ -14,6 +14,7 @@ eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' use strict; use Cwd; +use Config; use File::Basename; my($basePath) = getExecutePath($0); @@ -25,13 +26,18 @@ require MWC; # Subroutine Section # ************************************************************ +sub getBasePath { + return $basePath; +} + + sub which { - my($prog) = shift; - my($exec) = $prog; - my($part) = ''; - my($envSep) = ($^O eq 'MSWin32' ? ';' : ':'); + my($prog) = shift; + my($exec) = $prog; if (defined $ENV{'PATH'}) { + my($part) = ''; + my($envSep) = $Config{'path_sep'}; foreach $part (split(/$envSep/, $ENV{'PATH'})) { $part .= "/$prog"; if ( -x $part ) { |