]> git.pld-linux.org Git - packages/libreoffice.git/blob - openoffice-setup
- up
[packages/libreoffice.git] / openoffice-setup
1 #!/bin/awk -f
2 /^File /{flag=1;name=$2;}
3 /^Directory /{flag=2;name=$2;}
4 /^End/{flag=0;name="";}
5
6 (flag==1)&&/[ \t]Name[ \t]/{
7   gsub(/[\"; \t]/,"");
8   split($0,TAB,"=");
9   gsub(/Name/,"",TAB[1]);
10   if (TAB[1]=="")TAB[1]="01";
11   gsub(/[\(\)]/,"",TAB[1]);
12   files_name[TAB[1],name]=TAB[2];
13 };
14
15 (flag==1)&&/[ \t]PackedName[ \t]/{
16   gsub(/[\"; \t]/,"");
17   split($0,TAB,"=");
18   gsub(/PackedName/,"",TAB[1]);
19   if (TAB[1]=="")TAB[1]="01";
20   gsub(/[\(\)]/,"",TAB[1]);
21   files_packedname[TAB[1],name]=TAB[2];
22 };
23
24 (flag==1)&&/[ \t]Dir[ \t]/{
25   gsub(/[\"; \t]/,"");
26   split($0,TAB,"=");
27   gsub(/Dir/,"",TAB[1]);
28   if (TAB[1]=="")TAB[1]="01";
29   gsub(/[\(\)]/,"",TAB[1]);
30   files_dir[TAB[1],name]=TAB[2];
31 };
32
33 (flag==2)&&/[ \t]ParentID[ \t]/{
34   gsub(/[\"; \t]/,"");
35   split($0,TAB,"=");
36   dirs_parent[name]=TAB[2];
37 }
38
39 (flag==2)&&/[ \t]HostName[ \t]/{
40   gsub(/[\"; \t]/,"");
41   split($0,TAB,"=");
42   dirs_hostname[name]=TAB[2];
43 }
44
45 END{
46 #exit;
47   for (arg in ARGV){
48     split(ARGV[arg],TAB,"=");
49     param[TAB[1]]=TAB[2];
50   }
51   for (f in files_packedname){
52     f2=f;
53     gsub(/[0-9][0-9]/,"",f2);
54     lang=substr(f,1,2);
55     dir=files_dir["01"f2];
56 #    print lang;
57 #    print files_name[f];
58 #    print files_packedname[f];
59 #    print files_dir["01"f2];
60
61     path="";
62 #    p1=dirs_parent[lang,dir];
63     p1=dir;
64     while (p1!=""){
65       p2=p1;
66       path=dirs_hostname[p1] "/" path;
67       p1=dirs_parent[p1]
68     }
69     if (p2=="PREDEFINED_PROGDIR"){
70       path=param["DIRTO"] path;
71       file=param["DIRFROM"] lang "/normal/" files_packedname[f];
72       cmd="unzip -d "path" -o "file;
73       system("mkdir -p "path);
74       system(cmd);
75 #      print cmd;
76 #      print p2,path;
77     }
78     else if (p2=="PREDEFINED_HOMEDIR"){
79     }
80     else if (p2=="PREDEFINED_NS6PLUGINDIR"){
81     }
82     else if (p2=="PREDEFINED_NSPLUGINDIR"){
83     }
84
85 #    exit;
86
87 #    print path,dir;
88 #    print dirs_parent[lang,dir];
89 #    print "===";
90   }
91
92 }
This page took 0.04545 seconds and 3 git commands to generate.