summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rwxr-xr-xdevtools/document_template.pl20
-rw-r--r--docs/README7
-rw-r--r--modules/ProjectCreator.pm11
4 files changed, 42 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 709eedca..4692ec2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Thu Jul 10 15:28:50 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
+
+ * devtools/document_template.pl:
+
+ Fixed a bug where template variables used within template
+ functions were ignored.
+
+ * docs/README:
+ * modules/ProjectCreator.pm:
+
+ Added the ability to utilize project settings within the
+ Define_Custom command, commandflags, dependent, output_option,
+ and postcommand settings.
+
Thu Jul 10 14:29:44 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
* modules/MakeProjectCreator.pm:
diff --git a/devtools/document_template.pl b/devtools/document_template.pl
index b2b8aeb5..2b99a871 100755
--- a/devtools/document_template.pl
+++ b/devtools/document_template.pl
@@ -38,7 +38,7 @@ require StringProcessor;
my(%keywords) = ();
my(%arrow_op) = ();
my($doc_ext) = '.txt';
-my($version) = '1.1';
+my($version) = '1.2';
# ******************************************************************
# Subroutine Section
@@ -237,9 +237,21 @@ if (open($fh, $input)) {
}
elsif ($name eq 'if') {
$vname =~ s/(!|&&|\|\|)//g;
- foreach my $keyword (keys %keywords) {
- $vname =~ s/$keyword\(.*[\)]?//g;
- }
+
+ ## Keep pulling off keyword functions until we get down to
+ ## the actual template variable used in the function call.
+ my $retry;
+ do {
+ $retry = undef;
+ foreach my $keyword (keys %keywords) {
+ if ($vname =~ s/$keyword\((.*)[\)]?/$1/g) {
+ $retry = 1 if ($vname ne '');
+ last;
+ }
+ }
+ } while($retry);
+ $vname =~ s/\s*,.*//;
+
if ($vname !~ /^\s*$/) {
$name = lc($vname);
$key = lc($vname);
diff --git a/docs/README b/docs/README
index 5286b7c4..1010664b 100644
--- a/docs/README
+++ b/docs/README
@@ -504,9 +504,10 @@ postcommand Allows a user to execute arbitrary commands after
<%input_ext%>
<%output_ext%>
- The following pseudo template variables are valid for
- use within the command, commandflags, dependent,
- postcommand and output_option settings:
+ The following pseudo template variables, in addition to
+ all project settings, are valid for use within the
+ command, commandflags, dependent, postcommand and
+ output_option settings:
<%temporary%> - A temporary file name.
<%cat%> - Platform non-specific command to cat a file.
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 7cb1807b..121693f0 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -3803,9 +3803,14 @@ sub replace_parameters {
$modifier = $tmp;
}
- if (exists $$valid{$name}) {
- if (defined $$valid{$name}) {
- my $replace = $$valid{$name};
+ ## Support both pseudo variables and project settings
+ if (exists $$valid{$name} || $self->is_keyword($name)) {
+ ## If the pseudo variable is defined or the project setting has a
+ ## value, then we'll need to do the replacement.
+ my $prjval;
+ if (defined $$valid{$name} ||
+ ($prjval = $self->get_assignment($name))) {
+ my $replace = $$valid{$name} || $prjval;
if (defined $modifier) {
if ($modifier eq 'noextension') {
$replace =~ s/\.[^\.]+$//;