summaryrefslogtreecommitdiff
path: root/upgrade-templates.pl
diff options
context:
space:
mode:
Diffstat (limited to 'upgrade-templates.pl')
-rw-r--r--upgrade-templates.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/upgrade-templates.pl b/upgrade-templates.pl
new file mode 100644
index 00000000..d6befb4f
--- /dev/null
+++ b/upgrade-templates.pl
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+my $dirpath = $ARGV[1];
+$dirpath ||= 'templates';
+
+&process_dir($dirpath);
+
+sub process_dir {
+ my $dirpath = shift @_;
+ opendir DIR, $dirpath || die "can't open dir $dirpath for reading:$!";
+ my @entries = readdir DIR;
+ closedir DIR;
+ for $entry(@entries){
+ my $path = "$dirpath/$entry";
+ if (-d $path && $entry !~ /^\./){
+ &process_dir($path);
+ } elsif ($entry !~ /^\./){
+ print "Processing path $path\n";
+ `perl -ibak -pe 's|\<\%(.*)\%\>|<?lsmb \$1 ?>|g' $path`
+ }
+ }
+}