summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2004-05-18 14:39:41 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2004-05-18 14:39:41 +0000
commitf562e697f50add73fd6157b169bc9bac02aff1a1 (patch)
tree4c6083c657aa16357449be9d958ceba684ee1ef4
parentab62dcd73f740c95da4d6480a51b4016f47414d4 (diff)
downloadMPC-f562e697f50add73fd6157b169bc9bac02aff1a1.tar.gz
ChangeLogTag: Tue May 18 09:37:29 2004 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog15
-rw-r--r--modules/Version.pm25
-rwxr-xr-xmpc.pl14
-rwxr-xr-xmwc.pl14
4 files changed, 58 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ca23d180..08bae018 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/mpc.pl b/mpc.pl
index 69be9b02..c146e544 100755
--- a/mpc.pl
+++ b/mpc.pl
@@ -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 ) {
diff --git a/mwc.pl b/mwc.pl
index 73d08e40..a4905d2d 100755
--- a/mwc.pl
+++ b/mwc.pl
@@ -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 ) {