1 |
slords |
1.1 |
diff -Nur -x '*.orig' -x '*.rej' e-smith-lib-1.18.0/root/etc/e-smith/events/actions/generic_template_expand mezzanine_patched_e-smith-lib-1.18.0/root/etc/e-smith/events/actions/generic_template_expand |
2 |
|
|
--- e-smith-lib-1.18.0/root/etc/e-smith/events/actions/generic_template_expand 2007-03-26 17:44:05.000000000 -0400 |
3 |
|
|
+++ mezzanine_patched_e-smith-lib-1.18.0/root/etc/e-smith/events/actions/generic_template_expand 2007-03-26 17:29:02.000000000 -0400 |
4 |
|
|
@@ -27,9 +27,6 @@ |
5 |
|
|
|
6 |
|
|
my $event = shift or die "Event name is required\n"; |
7 |
|
|
|
8 |
|
|
-my $filename; |
9 |
|
|
-my %args; |
10 |
|
|
-my ($param, $value); |
11 |
|
|
my $templates_dir = "/etc/e-smith/events/$event/templates2expand"; |
12 |
|
|
exit 0 unless -d $templates_dir; |
13 |
|
|
|
14 |
|
|
@@ -48,22 +45,11 @@ |
15 |
|
|
sub expand |
16 |
|
|
{ |
17 |
|
|
return unless -f $_; |
18 |
|
|
- # For each file found, read the file to find |
19 |
|
|
- # processTemplate args, then expand the template |
20 |
|
|
+ # For each file found, expand the template |
21 |
|
|
s/^\.//; |
22 |
|
|
- $filename = $_; |
23 |
|
|
- %args = ( |
24 |
|
|
+ warn "expanding $_\n"; |
25 |
|
|
+ esmith::templates::processTemplate({ |
26 |
|
|
MORE_DATA => { EVENT => $event }, |
27 |
|
|
- TEMPLATE_PATH => $filename, |
28 |
|
|
- OUTPUT_FILENAME => $filename, |
29 |
|
|
- ); |
30 |
|
|
- open(FILE, "${templates_dir}${filename}"); |
31 |
|
|
- while (<FILE>) |
32 |
|
|
- { |
33 |
|
|
- ($param, $value) = split(/=/, $_, 2); |
34 |
|
|
- $args{$param} = eval $value; warn $@ if $@; |
35 |
|
|
- } |
36 |
|
|
- close(FILE); |
37 |
|
|
- warn "expanding $filename\n"; |
38 |
|
|
- esmith::templates::processTemplate(\%args); |
39 |
|
|
+ TEMPLATE_PATH => $_, |
40 |
|
|
+ }); |
41 |
|
|
} |