summaryrefslogtreecommitdiff
path: root/officecfg/util/template.gen
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2000-09-18 15:33:13 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2000-09-18 15:33:13 +0000
commitee27dd72550ce8815e06e337d3682d5b8d9d7b11 (patch)
treec785600f8cc75cd1191fc9966bee9cb0742bb780 /officecfg/util/template.gen
parentc25ec0608a167bcf1d891043f02273761c351701 (diff)
initial import
Diffstat (limited to 'officecfg/util/template.gen')
-rw-r--r--officecfg/util/template.gen34
1 files changed, 34 insertions, 0 deletions
diff --git a/officecfg/util/template.gen b/officecfg/util/template.gen
new file mode 100644
index 000000000000..5b2c3d40886a
--- /dev/null
+++ b/officecfg/util/template.gen
@@ -0,0 +1,34 @@
+: # -*- perl -*-
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+
+open(OUTFILE, ">$ARGV[1]");
+
+print OUTFILE "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
+print OUTFILE "<org.openoffice.Templates>\n";
+
+
+chdir($ARGV[0]) or die "can't chdir() to $ARGV[0]";
+
+opendir(DIR, ".");
+
+@files=readdir(DIR);
+
+foreach $file (@files) {
+ if ( $file =~ /\w*\.tpl/ ) {
+ open(INFILE, "<$file") or die "can't open file $file";
+ while(<INFILE>) {
+ if ( /xml version=/ ) {
+ next;
+ }
+ print OUTFILE;
+ }
+ close(INFILE);
+ }
+}
+
+print OUTFILE "</org.openoffice.Templates>\n";
+
+closedir(DIR);
+
+close(OUTFILE);