Update ooo320-m1
[ooovba.git] / officecfg / util / template.gen
blob5b2c3d40886ae321e17549b6ac9204d5524479e9
1 : # -*- perl -*-
2 eval 'exec perl -wS $0 ${1+"$@"}'
3         if 0;
5 open(OUTFILE, ">$ARGV[1]");
7 print OUTFILE "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
8 print OUTFILE "<org.openoffice.Templates>\n";
11 chdir($ARGV[0]) or die "can't chdir() to $ARGV[0]";
13 opendir(DIR, ".");
15 @files=readdir(DIR);
17 foreach $file (@files) {
18         if ( $file =~ /\w*\.tpl/ ) {
19                 open(INFILE, "<$file") or die "can't open file $file";
20                 while(<INFILE>) {
21                         if ( /xml version=/ ) {
22                                 next;
23                         }       
24                         print OUTFILE;
25                 }
26                 close(INFILE);
27         }       
30 print OUTFILE "</org.openoffice.Templates>\n";
32 closedir(DIR);
34 close(OUTFILE);