summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2009-11-16 02:55:16 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2009-11-16 02:55:16 +0000
commit0d0f002356834b1c6302cda5c019760d7980a8fc (patch)
treed036258e83bb4ae123760145b6a4a387040f28ea
parentade94faca119fc627bcc7fa6b762d743d09e9fd6 (diff)
downloadMPC-0d0f002356834b1c6302cda5c019760d7980a8fc.tar.gz
ChangeLogTag: Mon Nov 16 02:52:53 UTC 2009 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog11
-rw-r--r--config/msgfmt.mpb11
-rw-r--r--modules/ProjectCreator.pm35
3 files changed, 55 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9bb4607a..18b7da80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Mon Nov 16 02:52:53 UTC 2009 Chad Elliott <elliott_c@ociweb.com>
+
+ * config/msgfmt.mpb:
+
+ Added a base project to utilize the msgfmt executable.
+
+ * modules/ProjectCreator.pm:
+
+ Fixed a bug where adding to a scoped template variable nullified
+ the setting of the non-scoped template variable.
+
Fri Nov 13 15:30:00 UTC 2009 Simon Massey <sma@prismtech.com>
* modules/ProjectCreator.pm:
diff --git a/config/msgfmt.mpb b/config/msgfmt.mpb
new file mode 100644
index 00000000..2c885fec
--- /dev/null
+++ b/config/msgfmt.mpb
@@ -0,0 +1,11 @@
+// $Id$
+
+project {
+ Define_Custom(PO) {
+ command = msgfmt
+ commandflags = -c
+ output_option = -o
+ inputext = .po
+ generic_outputext = .mo
+ }
+}
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 0a5d58f0..f3ffa231 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -1075,7 +1075,17 @@ sub update_template_variable {
$name = $values[1] if (!defined $name);
if ($name =~ s/.*:://) {
my $value = $self->get_assignment($name);
- $atemp->{$values[1]} = [[0, $value, undef, $name]] if (defined $value);
+ ## Regardless of whether there was and assignment value, we need to
+ ## look at the template value of the base so that modification of a
+ ## scoped variable includes the base values.
+ if (defined $atemp->{$name}) {
+ foreach my $arr (@{$atemp->{$name}}) {
+ my @copy = @$arr;
+ push(@{$atemp->{$values[1]}}, \@copy);
+ }
+ }
+ unshift(@{$atemp->{$values[1]}},
+ [0, $value, undef, $name]) if (defined $value);
}
}
@@ -1083,7 +1093,8 @@ sub update_template_variable {
## pseudo quote variable; and then subsitute all pseudo variables
## for the project specific characters.
$values[2] =~ s/\"/<%quote%>/g;
- $values[2] = $self->replace_parameters($values[2], $self->{'command_subs'});
+ $values[2] = $self->replace_parameters($values[2], $self->{'command_subs'})
+ if (index($values[2], '<%') >= 0);
if (defined $atemp->{$values[1]}) {
## If there are template variable settings, then we need to add
@@ -1104,6 +1115,26 @@ sub update_template_variable {
$atemp->{$values[1]} = [];
}
+ ## If the variable name is not scoped, we need to look through existing
+ ## scoped variables that match the base. If we find one, we need to
+ ## propagate this value into the scoped settings.
+ if (index($values[1], '::') == -1) {
+ foreach my $key (keys %$atemp) {
+ if ($key ne $name) {
+ foreach my $entry (@{$atemp->{$key}}) {
+ if ($$entry[3] eq $name) {
+ push(@{$atemp->{$key}}, [$values[0], $values[2], undef, $name]);
+ last;
+ }
+ }
+ }
+ }
+ }
+
+ ## 0: (0 set, 1 add, -1 subtract)
+ ## 1: The text value
+ ## 2: (true set on command line, false set in project)
+ ## 3: The original variable name if it's scoped or mapped
push(@{$atemp->{$values[1]}}, [$values[0], $values[2], undef, $name]);
}