1 | #ifndef EXTENSIONS_H |
---|
2 | #define EXTENSIONS_H |
---|
3 | |
---|
4 | //flag 0: inputbox |
---|
5 | //flag 1: auto |
---|
6 | void screenfeed(int flag) |
---|
7 | { |
---|
8 | char* tmpstr = NULL, *line = NULL, *lastline = NULL; |
---|
9 | char* pos = NULL; |
---|
10 | |
---|
11 | tmpstr = readsys(getconfig("feed", NULL), 4); //line4 |
---|
12 | tmpstr = string_replace("src/gz secret http://", "", tmpstr, 1); |
---|
13 | |
---|
14 | if(tmpstr != NULL) |
---|
15 | pos = strchr(tmpstr, '/'); |
---|
16 | if(pos != NULL) |
---|
17 | pos[0] = '\0'; |
---|
18 | |
---|
19 | if(tmpstr == NULL || ostrcmp(tmpstr, "") == 0 || ostrcmp(tmpstr, "\n") == 0) |
---|
20 | tmpstr = ostrcat(tmpstr, "000.000.000.000", 1, 0); |
---|
21 | |
---|
22 | if(flag == 1) |
---|
23 | lastline = ostrcat("999.999.999.999", NULL, 0, 0); |
---|
24 | else |
---|
25 | lastline = numinput(_("Feed"), tmpstr, "000.000.000.000", 1); |
---|
26 | |
---|
27 | //for devs, who have secret feed not in mind |
---|
28 | if(ostrcmp("999.999.999.999", lastline) == 0) |
---|
29 | { |
---|
30 | free(lastline); lastline = NULL; |
---|
31 | lastline = ostrcat("097.074.032.010", NULL, 0, 0); |
---|
32 | } |
---|
33 | |
---|
34 | if(lastline != NULL) |
---|
35 | { |
---|
36 | free(tmpstr); tmpstr = NULL; |
---|
37 | tmpstr = fixip(lastline, 1); |
---|
38 | free(lastline); lastline = tmpstr; |
---|
39 | |
---|
40 | tmpstr = readsys(getconfig("feed", NULL), 1); //line1 |
---|
41 | if(tmpstr == NULL || (tmpstr != NULL && strlen(tmpstr) == 0)) |
---|
42 | line = ostrcat(line, "#", 1, 0); |
---|
43 | else |
---|
44 | line = ostrcat(line, tmpstr, 1, 0); |
---|
45 | free(tmpstr); tmpstr = NULL; |
---|
46 | |
---|
47 | if(line[strlen(line) - 1] != '\n') |
---|
48 | line = ostrcat(line, "\n", 1, 0); |
---|
49 | |
---|
50 | tmpstr = readsys(getconfig("feed", NULL), 2); //line2 |
---|
51 | if(tmpstr == NULL || (tmpstr != NULL && strlen(tmpstr) == 0)) |
---|
52 | line = ostrcat(line, "#\n", 1, 0); |
---|
53 | else |
---|
54 | line = ostrcat(line, tmpstr, 1, 0); |
---|
55 | free(tmpstr); tmpstr = NULL; |
---|
56 | ///// |
---|
57 | if(line[strlen(line) - 1] != '\n') |
---|
58 | line = ostrcat(line, "\n", 1, 0); |
---|
59 | |
---|
60 | tmpstr = readsys(getconfig("feed", NULL), 3); //line3 |
---|
61 | if(tmpstr == NULL || (tmpstr != NULL && strlen(tmpstr) == 0)) |
---|
62 | line = ostrcat(line, "#\n", 1, 0); |
---|
63 | else |
---|
64 | line = ostrcat(line, tmpstr, 1, 0); |
---|
65 | free(tmpstr); tmpstr = NULL; |
---|
66 | ///// |
---|
67 | if(line[strlen(line) - 1] == '\n') |
---|
68 | tmpstr = ostrcat(line, "src/gz secret http://", 0, 0); |
---|
69 | else |
---|
70 | tmpstr = ostrcat(line, "\nsrc/gz secret http://", 0, 0); |
---|
71 | |
---|
72 | if(strlen(lastline) == 0) |
---|
73 | { |
---|
74 | free(tmpstr); |
---|
75 | tmpstr = ostrcat(line, NULL, 0, 0); |
---|
76 | } |
---|
77 | |
---|
78 | tmpstr = ostrcat(tmpstr, lastline, 1, 0); |
---|
79 | // tmpstr = ostrcat(tmpstr, "/svn/tpk/sh4", 1, 0); |
---|
80 | #ifdef SH4 |
---|
81 | tmpstr = ostrcat(tmpstr, "/svn/tpk/nightly-sh4-secret", 1, 0); |
---|
82 | #else |
---|
83 | tmpstr = ostrcat(tmpstr, "/svn/tpk/nightly-mipsel-secret", 1, 0); |
---|
84 | #endif |
---|
85 | writesys(getconfig("feed", NULL), tmpstr, 0); |
---|
86 | } |
---|
87 | |
---|
88 | free(tmpstr); |
---|
89 | free(line); |
---|
90 | free(lastline); |
---|
91 | } |
---|
92 | |
---|
93 | //flag 0: install ok |
---|
94 | //flag 1: install err |
---|
95 | //flag 2: remove ok |
---|
96 | //flag 3: remove err |
---|
97 | char* gettpklog(char* installpath, int flag) |
---|
98 | { |
---|
99 | char* tmpstr = NULL; |
---|
100 | |
---|
101 | if(flag == 0 || flag == 1) |
---|
102 | tmpstr = ostrcat(tmpstr, _("Installation start"), 1, 0); |
---|
103 | else |
---|
104 | tmpstr = ostrcat(tmpstr, _("Remove start"), 1, 0); |
---|
105 | tmpstr = ostrcat(tmpstr, "\n\n", 1, 0); |
---|
106 | |
---|
107 | tmpstr = ostrcat(tmpstr, readfiletomem(TPKLOG, 0), 1, 1); |
---|
108 | |
---|
109 | tmpstr = ostrcat(tmpstr, "\n\n", 1, 0); |
---|
110 | |
---|
111 | if(installpath != NULL) |
---|
112 | { |
---|
113 | tmpstr = ostrcat(tmpstr, _("New free space (KB): "), 1, 0); |
---|
114 | tmpstr = ostrcat(tmpstr, ollutoa(getfreespace(installpath) / 1024), 1, 1); |
---|
115 | tmpstr = ostrcat(tmpstr, "\n", 1, 0); |
---|
116 | } |
---|
117 | |
---|
118 | if(flag == 0) |
---|
119 | tmpstr = ostrcat(tmpstr, _("Install success"), 1, 0); |
---|
120 | if(flag == 1) |
---|
121 | tmpstr = ostrcat(tmpstr, _("Install error"), 1, 0); |
---|
122 | if(flag == 2) |
---|
123 | tmpstr = ostrcat(tmpstr, _("Remove success"), 1, 0); |
---|
124 | if(flag == 3) |
---|
125 | tmpstr = ostrcat(tmpstr, _("Remove error"), 1, 0); |
---|
126 | |
---|
127 | if(installpath == NULL || ostrcmp("/var/swap", installpath) == 0) |
---|
128 | sync(); |
---|
129 | |
---|
130 | return tmpstr; |
---|
131 | } |
---|
132 | |
---|
133 | char* getinstallpath(char* path, char* size) |
---|
134 | { |
---|
135 | int count = 0, isize = 0; |
---|
136 | char* tmpstr = NULL; |
---|
137 | struct menulist* mlist = NULL, *mbox = NULL, *tmpmlist = NULL; |
---|
138 | |
---|
139 | if(size != NULL) isize = atoi(size); |
---|
140 | |
---|
141 | if(path == NULL || path[0] == '*' || ostrstr(path, "mnt") != NULL) |
---|
142 | { |
---|
143 | if(tpkchecksize(NULL, "/mnt/swapextensions", isize) == 0) |
---|
144 | { |
---|
145 | tmpmlist = addmenulist(&mlist, _("Install to MNT"), NULL, NULL, 0, 0); |
---|
146 | changemenulistparam(tmpmlist, "/mnt/swapextensions", NULL, NULL, NULL); |
---|
147 | free(tmpstr); tmpstr = NULL; |
---|
148 | tmpstr = ostrcat("/mnt/swapextensions", NULL, 0, 0); |
---|
149 | count++; |
---|
150 | } |
---|
151 | } |
---|
152 | |
---|
153 | if(path == NULL || path[0] == '*' || ostrstr(path, "var") != NULL) |
---|
154 | { |
---|
155 | if(tpkchecksize(NULL, "/var", isize) == 0) |
---|
156 | { |
---|
157 | tmpmlist = addmenulist(&mlist, _("Install to FLASH"), NULL, NULL, 0, 0); |
---|
158 | changemenulistparam(tmpmlist, "/var", NULL, NULL, NULL); |
---|
159 | free(tmpstr); tmpstr = NULL; |
---|
160 | tmpstr = ostrcat("/var", NULL, 0, 0); |
---|
161 | count++; |
---|
162 | } |
---|
163 | } |
---|
164 | |
---|
165 | if(path == NULL || path[0] == '*' || ostrstr(path, "swap") != NULL) |
---|
166 | { |
---|
167 | if(file_exist("/tmp/.swapextensionsdev") == 1 || file_exist("/var/swap")) |
---|
168 | { |
---|
169 | if(tpkchecksize(NULL, "/var/swap", isize) == 0) |
---|
170 | { |
---|
171 | tmpmlist = addmenulist(&mlist, _("Install to SWAP"), NULL, NULL, 0, 0); |
---|
172 | changemenulistparam(tmpmlist, "/var/swap", NULL, NULL, NULL); |
---|
173 | free(tmpstr); tmpstr = NULL; |
---|
174 | tmpstr = ostrcat("/var/swap", NULL, 0, 0); |
---|
175 | count++; |
---|
176 | } |
---|
177 | } |
---|
178 | } |
---|
179 | |
---|
180 | //if(count > 1) // if only 1 installpath, don't show choicebox |
---|
181 | if(count > 0) // show always choicebox |
---|
182 | { |
---|
183 | free(tmpstr); tmpstr = NULL; |
---|
184 | mbox = menulistbox(mlist, "tpkinstallinfo", _("Choice Install Medium"), NULL, NULL, NULL, 0, 0); |
---|
185 | if(mbox != NULL) |
---|
186 | tmpstr = ostrcat(mbox->param, NULL, 0, 0); |
---|
187 | } |
---|
188 | else if(count == 0) |
---|
189 | { |
---|
190 | textbox(_("Tpk Install Info"), _("Can't install Package. Package to big."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 0, 0); |
---|
191 | free(tmpstr); tmpstr = NULL; |
---|
192 | } |
---|
193 | |
---|
194 | freemenulist(mlist, 0); mlist = NULL; |
---|
195 | return tmpstr; |
---|
196 | } |
---|
197 | |
---|
198 | void screenextensions(int mode, char* path, char* defentry, int first) |
---|
199 | { |
---|
200 | char* tmpstr = NULL, *tmpinfo = NULL, *installpath = NULL; |
---|
201 | struct menulist* mlist = NULL, *mbox = NULL; |
---|
202 | struct menulist* mlist1 = NULL, *mbox1 = NULL; |
---|
203 | struct skin* load = getscreen("loading"); |
---|
204 | |
---|
205 | status.hangtime = 99999; |
---|
206 | unlink(TPKLOG); |
---|
207 | |
---|
208 | if(mode == 0) |
---|
209 | { |
---|
210 | drawscreen(load, 0, 0); |
---|
211 | |
---|
212 | if(first == 1) tpkgetindex(0); |
---|
213 | tpklist(); |
---|
214 | |
---|
215 | clearscreen(load); |
---|
216 | |
---|
217 | mbox = tpkmenulist(mlist, NULL, _("Tpk Install - select section"), NULL, NULL, 1, defentry, 0); |
---|
218 | |
---|
219 | if(mbox != NULL) |
---|
220 | { |
---|
221 | debug(130, "section: %s", mbox->name); |
---|
222 | mbox1 = tpkmenulist(mlist1, "tpkinstall", _("Tpk Install - select file"), "/tmp/tpk", mbox->name, 2, NULL, 1); |
---|
223 | |
---|
224 | if(mbox1 != NULL && mbox1->param != NULL && mbox1->param1 != NULL) |
---|
225 | { |
---|
226 | debug(130, "file: %s", mbox1->name); |
---|
227 | if(ostrstr(mbox1->name, _("There may only be one package installed from this section. To install another package from this section, remove the installed one. If the package is not visible after a software update, perform a TPK update to: ")) == NULL) |
---|
228 | { |
---|
229 | installpath = getinstallpath(mbox1->param2, mbox1->param3); |
---|
230 | if(installpath != NULL) |
---|
231 | { |
---|
232 | tmpinfo = ostrcat(tmpinfo, _("Installing"), 1, 0); |
---|
233 | tmpinfo = ostrcat(tmpinfo, " ", 1, 0); |
---|
234 | tmpinfo = ostrcat(tmpinfo, mbox->name, 1, 0); |
---|
235 | tmpinfo = ostrcat(tmpinfo, "-", 1, 0); |
---|
236 | tmpinfo = ostrcat(tmpinfo, mbox1->name, 1, 0); |
---|
237 | tmpinfo = ostrcat(tmpinfo, " ", 1, 0); |
---|
238 | tmpinfo = ostrcat(tmpinfo, _("starting"), 1, 0); |
---|
239 | tmpinfo = ostrcat(tmpinfo, " ?", 1, 0); |
---|
240 | |
---|
241 | if(textbox(_("Tpk Install Info"), _(tmpinfo), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0) == 1) |
---|
242 | { |
---|
243 | drawscreen(load, 0, 0); |
---|
244 | resettvpic(); |
---|
245 | char* log = NULL; |
---|
246 | int tpkret = tpkgetpackage(mbox1->param, mbox1->param1, installpath, 0, 0); |
---|
247 | if(tpkret == 0) |
---|
248 | { |
---|
249 | log = gettpklog(installpath, 0); |
---|
250 | textbox(_("Tpk Install Info - Install OK"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 2); |
---|
251 | } |
---|
252 | else if(tpkret == 2) |
---|
253 | { |
---|
254 | textbox(_("Tpk Install Info - Install ERROR"), _("There may only be one package installed from this section. To install another package from this section, remove the installed one. If the package is not visible after a software update, perform a TPK update to: "), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 2); |
---|
255 | } |
---|
256 | else |
---|
257 | { |
---|
258 | log = gettpklog(installpath, 1); |
---|
259 | textbox(_("Tpk Install Info - Install ERROR"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 2); |
---|
260 | } |
---|
261 | // textbox(_("Message"), _("Some plugins needs restart.\nIf the plugin is not active\nreboot the box."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0); |
---|
262 | loadplugin(); |
---|
263 | free(log), log = NULL; |
---|
264 | unlink(TPKLOG); |
---|
265 | if(file_exist("/tmp/.tpk_needs_reboot")) |
---|
266 | { |
---|
267 | textbox(_("Message"), _("TPK Install done, your system will reboot !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 0, 0); |
---|
268 | //write only config file |
---|
269 | writeallconfig(3); |
---|
270 | oshutdown(2,2); |
---|
271 | system("init 6"); |
---|
272 | } |
---|
273 | } |
---|
274 | } |
---|
275 | } |
---|
276 | } |
---|
277 | } |
---|
278 | free(installpath); installpath = NULL; |
---|
279 | free(tmpstr); tmpstr = NULL; |
---|
280 | freemenulist(mlist1, 0); mlist1 = NULL; |
---|
281 | if(mbox != NULL) tmpstr = ostrcat(mbox->name, NULL, 0, 0); |
---|
282 | freemenulist(mlist, 0); mlist = NULL; |
---|
283 | free(tmpinfo); tmpinfo = NULL; |
---|
284 | freetpk(); |
---|
285 | if(mbox != NULL) screenextensions(0, path, tmpstr, 0); |
---|
286 | free(tmpstr); tmpstr = NULL; |
---|
287 | } |
---|
288 | else if(mode == 1) |
---|
289 | { |
---|
290 | tpklistinstalled(0); |
---|
291 | mbox = tpkmenulist(mlist, NULL, _("Tpk Remove - select file"), NULL, NULL, 1, defentry, 2); |
---|
292 | |
---|
293 | if(mbox != NULL && mbox->param != NULL) |
---|
294 | { |
---|
295 | debug(130, "file: %s", mbox->name); |
---|
296 | |
---|
297 | tmpinfo = ostrcat(tmpinfo, _("Removeing"), 1, 0); |
---|
298 | tmpinfo = ostrcat(tmpinfo, " ", 1, 0); |
---|
299 | tmpinfo = ostrcat(tmpinfo, mbox->name, 1, 0); |
---|
300 | tmpinfo = ostrcat(tmpinfo, " ?", 1, 0); |
---|
301 | |
---|
302 | if(textbox(_("Tpk Remove Info"), _(tmpinfo), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 0, 0) == 1) |
---|
303 | { |
---|
304 | drawscreen(load, 0, 0); |
---|
305 | resettvpic(); |
---|
306 | char* log = NULL; |
---|
307 | if(tpkremove(mbox->param, 0, 0) == 0) |
---|
308 | { |
---|
309 | log = gettpklog(NULL, 2); |
---|
310 | textbox(_("Tpk Remove Info - Remove OK"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 2); |
---|
311 | //del plugin from memory if Titanname is defined in plugin control file |
---|
312 | if(mbox->param1 != NULL && mbox->param1[0] != '*') delplugin(mbox->param1); |
---|
313 | } |
---|
314 | else |
---|
315 | { |
---|
316 | log = gettpklog(NULL, 3); |
---|
317 | textbox(_("Tpk Remove Info - Remove ERROR"), _(log), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 2); |
---|
318 | } |
---|
319 | // textbox(_("Message"), _("Some plugins needs restart.\nIf the plugin is not active\nreboot the box."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0); |
---|
320 | free(log); log = NULL; |
---|
321 | unlink(TPKLOG); |
---|
322 | if(file_exist("/tmp/.tpk_needs_reboot")) |
---|
323 | { |
---|
324 | textbox(_("Message"), _("TPK Remove done, your system will reboot !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 0, 0); |
---|
325 | //write only config file |
---|
326 | writeallconfig(3); |
---|
327 | oshutdown(2,2); |
---|
328 | system("init 6"); |
---|
329 | } |
---|
330 | } |
---|
331 | } |
---|
332 | free(tmpstr); tmpstr = NULL; |
---|
333 | freemenulist(mlist, 0); mlist = NULL; |
---|
334 | if(mbox != NULL) tmpstr = ostrcat(mbox->name, NULL, 0, 0); |
---|
335 | free(tmpinfo); tmpinfo = NULL; |
---|
336 | freetpk(); |
---|
337 | if(mbox != NULL) screenextensions(1, path, tmpstr, 0); |
---|
338 | free(tmpstr); tmpstr = NULL; |
---|
339 | } |
---|
340 | else if(mode == 2) |
---|
341 | { |
---|
342 | char* text1 = "Tpk Tmp Install - select file"; |
---|
343 | char* text2 = "Tpk Tmp Info"; |
---|
344 | |
---|
345 | if(path == NULL) |
---|
346 | tmpstr = gettpktmplist("/tmp"); |
---|
347 | else |
---|
348 | { |
---|
349 | tmpstr = gettpktmplist(path); |
---|
350 | text1 = "Tpk Media Install - select file"; |
---|
351 | text2 = "Tpk Media Info"; |
---|
352 | } |
---|
353 | |
---|
354 | if(tmpstr == NULL || strlen(tmpstr) == 0) |
---|
355 | { |
---|
356 | textbox(_("Message"), _("No plugin found."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
357 | } |
---|
358 | else |
---|
359 | { |
---|
360 | addmenulistall(&mlist, tmpstr, NULL, 0, defentry); |
---|
361 | mbox = menulistbox(mlist, NULL, text1, NULL, NULL, "/skin/plugin.png", 1, 0); |
---|
362 | } |
---|
363 | |
---|
364 | free(tmpstr); tmpstr = NULL; |
---|
365 | |
---|
366 | if(mbox != NULL) |
---|
367 | { |
---|
368 | installpath = getinstallpath(NULL, 0); |
---|
369 | debug(130, "installpath: %s", installpath); |
---|
370 | if(installpath != NULL) |
---|
371 | { |
---|
372 | debug(130, "file: %s", mbox->name); |
---|
373 | |
---|
374 | tmpinfo = ostrcat(tmpinfo, _("Installing"), 1, 0); |
---|
375 | tmpinfo = ostrcat(tmpinfo, " ", 1, 0); |
---|
376 | tmpinfo = ostrcat(tmpinfo, mbox->name, 1, 0); |
---|
377 | tmpinfo = ostrcat(tmpinfo, " ", 1, 0); |
---|
378 | tmpinfo = ostrcat(tmpinfo, _("starting"), 1, 0); |
---|
379 | tmpinfo = ostrcat(tmpinfo, " ?", 1, 0); |
---|
380 | debug(130, "tmpinfo: %s", tmpinfo); |
---|
381 | |
---|
382 | if(textbox(_(text2), _(tmpinfo), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0) == 1) |
---|
383 | { |
---|
384 | char* log = NULL; |
---|
385 | int ret = 0; |
---|
386 | drawscreen(load, 0, 0); |
---|
387 | resettvpic(); |
---|
388 | if(path == NULL) |
---|
389 | { |
---|
390 | tmpstr = ostrcat(tmpstr, "/tmp", 1, 0); |
---|
391 | tmpstr = ostrcat(tmpstr, "/", 1, 0); |
---|
392 | tmpstr = ostrcat(tmpstr, mbox->name, 1, 0); |
---|
393 | debug(130, "tmpstr: %s", tmpstr); |
---|
394 | ret = tpkinstall(tmpstr, installpath, 0); |
---|
395 | free(tmpstr); tmpstr = NULL; |
---|
396 | } |
---|
397 | else |
---|
398 | { |
---|
399 | tmpstr = ostrcat(tmpstr, path, 1, 0); |
---|
400 | tmpstr = ostrcat(tmpstr, "/", 1, 0); |
---|
401 | tmpstr = ostrcat(tmpstr, mbox->name, 1, 0); |
---|
402 | debug(130, "tmpstr: %s", tmpstr); |
---|
403 | ret = tpkinstall(tmpstr, installpath, 0); |
---|
404 | free(tmpstr); tmpstr = NULL; |
---|
405 | } |
---|
406 | |
---|
407 | if(ret == 0) |
---|
408 | log = gettpklog(installpath, 0); |
---|
409 | else if(ret == 2) |
---|
410 | log = ostrcat(_("There may only be one package installed from this section. To install another package from this section, remove the installed one. If the package is not visible after a software update, perform a TPK update to: "), NULL, 0, 0); |
---|
411 | else |
---|
412 | log = gettpklog(installpath, 1); |
---|
413 | textbox(_(text2), log, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 600, 0, 0); |
---|
414 | free(log); log = NULL; |
---|
415 | unlink(TPKLOG); |
---|
416 | textbox(_("Message"), _("Some plugins needs restart.\nIf the plugin is not active\nreboot the box."), "EXIT", getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, NULL, 0, 1000, 200, 0, 0); |
---|
417 | loadplugin(); |
---|
418 | if(file_exist("/tmp/.tpk_needs_reboot")) |
---|
419 | { |
---|
420 | textbox(_("Message"), _("TPK Tmp Install done, your system will reboot !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
421 | //write only config file |
---|
422 | writeallconfig(3); |
---|
423 | oshutdown(2,2); |
---|
424 | system("init 6"); |
---|
425 | } |
---|
426 | } |
---|
427 | } |
---|
428 | } |
---|
429 | free(installpath); installpath = NULL; |
---|
430 | free(tmpstr); tmpstr = NULL; |
---|
431 | freemenulist(mlist, 0); mlist = NULL; |
---|
432 | if(mbox != NULL) tmpstr = ostrcat(mbox->name, NULL, 0, 0); |
---|
433 | free(tmpinfo); tmpinfo = NULL; |
---|
434 | if(mbox != NULL) screenextensions(2, path, tmpstr, 0); |
---|
435 | free(tmpstr); tmpstr = NULL; |
---|
436 | } |
---|
437 | else if(mode == 3) |
---|
438 | { |
---|
439 | drawscreen(load, 0, 0); |
---|
440 | resettvpic(); |
---|
441 | if(first == 1) |
---|
442 | { |
---|
443 | if(tpkgetindex(0) != 0) |
---|
444 | textbox(_("Tpk Update Info - Update ERROR"), _("Can't get all TPK index !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
445 | } |
---|
446 | writesys("/tmp/.tpk_upgrade_start", "0", 0); |
---|
447 | if(tpkupdate(0) != 0) |
---|
448 | textbox(_("Tpk Update Info - Update ERROR"), _("Can't update all packages !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
449 | loadplugin(); |
---|
450 | clearscreen(load); |
---|
451 | drawscreen(skin, 0, 0); |
---|
452 | unlink(TPKLOG); |
---|
453 | |
---|
454 | if(file_exist("/tmp/.tpk_needs_reboot")) |
---|
455 | { |
---|
456 | textbox(_("Message"), _("TPK Upgrade done, your system will reboot !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
457 | //write only config file |
---|
458 | writeallconfig(3); |
---|
459 | oshutdown(2,2); |
---|
460 | system("init 6"); |
---|
461 | } |
---|
462 | unlink("/tmp/.tpk_upgrade_start"); |
---|
463 | } |
---|
464 | |
---|
465 | if(first == 1) tpkcleantmp(0); |
---|
466 | status.hangtime = getconfigint("hangtime", NULL); |
---|
467 | } |
---|
468 | |
---|
469 | //flag 0: without message |
---|
470 | //flag 1: with message |
---|
471 | void screenextensions_check(int flag) |
---|
472 | { |
---|
473 | int treffer = 0; |
---|
474 | struct hdd *node = NULL; |
---|
475 | char* tmpstr = NULL, *tmpstr1 = NULL; |
---|
476 | |
---|
477 | if(status.security >= 1) |
---|
478 | { |
---|
479 | addhddall(); |
---|
480 | node = hdd; |
---|
481 | |
---|
482 | while(node != NULL) |
---|
483 | { |
---|
484 | if(node->partition != 0) |
---|
485 | { |
---|
486 | tmpstr = ostrcat("/autofs/", node->device, 0, 0); |
---|
487 | tmpstr1 = gettpktmplist(tmpstr); |
---|
488 | |
---|
489 | if(tmpstr1 != NULL) |
---|
490 | { |
---|
491 | treffer = 1; |
---|
492 | screenextensions(2, tmpstr, NULL, 1); |
---|
493 | } |
---|
494 | |
---|
495 | free(tmpstr); tmpstr = NULL; |
---|
496 | free(tmpstr1); tmpstr1 = NULL; |
---|
497 | } |
---|
498 | node = node->next; |
---|
499 | } |
---|
500 | |
---|
501 | if(flag == 1 && treffer == 0) |
---|
502 | textbox(_("Tpk Install Info"), _("No plugin found."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
503 | } |
---|
504 | } |
---|
505 | |
---|
506 | #endif |
---|