tiny-slitaz view step4.php @ rev 1

Auto-update files.list.lzma
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 21 11:16:18 2012 +0200 (2012-08-21)
parents
children 577e6e91216d
line source
1 <?php
3 if (isset($_POST['packages']) && !isset($_POST['toconfigure'])) {
4 $_POST['toconfigure'] = shell_exec("./helper --depends ".
5 $_POST['tmp_dir']." ".$_POST['packages']);
6 }
8 if (isset($_POST['configuring'])) {
9 $pkg = $_POST['configuring'];
10 $fp = fopen($_POST['tmp_dir']."vars","w");
11 foreach ($_POST as $key => $val) {
12 if (in_array($key, $usedvars)) continue;
13 fwrite($fp,"export ".$key."='".$val."'\n");
14 }
15 fclose($fp);
16 shell_exec("sudo ./helper --post-install $pkg ".$_POST['tmp_dir']);
17 }
19 $output = '';
20 if (isset($_POST['toconfigure']) && $_POST['toconfigure'] != "") {
21 $pkgs = explode(" ",$_POST['toconfigure']);
22 foreach ($pkgs as $key => $pkg) {
23 shell_exec("sudo ./helper --pre-install $pkg ".$_POST['tmp_dir']);
24 $output = shell_exec("./helper --get-form $pkg ".
25 $_POST['tmp_dir']);
26 unset($pkgs[$key]);
27 $_POST['toconfigure'] = implode(" ", $pkgs);
28 if ($output == "") {
29 shell_exec("sudo ./helper --post-install $pkg ".
30 $_POST['tmp_dir']);
31 continue;
32 }
33 ?>
35 <a name="configuration"></a>
36 <h2><?php echo $pkg; ?> configuration</h2>
38 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
40 <input name="configuring" value="<?php echo $pkg; ?>" type="hidden" />
41 <?php
42 echo $output;
43 post_hidden();
44 ?>
45 <p>
46 </p>
48 <div align="center">
49 <input name="continue" value="Continue" type="submit" />
50 </div>
52 </form>
54 <?php
55 echo shell_exec("./helper --get-note $pkg ".$_POST['tmp_dir']);
56 break;
57 }
59 }
60 ?>