summaryrefslogtreecommitdiff
path: root/upgrade-templates.pl
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-16 23:52:04 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-16 23:52:04 +0000
commit9a99847224b406851d3db3967c2e82ee8c1bb628 (patch)
tree8edf5c69d9f270a7decba756044e780313cb4e05 /upgrade-templates.pl
parent62fe75d32f53b37cd90aa1135582bcc56d4aa8a7 (diff)
upgrade.pl now called upgrade-templates.pl
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@918 4979c152-3d1c-0410-bac9-87ea11338e46
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`
+ }
+ }
+}