tiny-slitaz view step4.php @ rev 25

Add mkrootfs.pre_exec
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 06 11:02:35 2019 +0200 (2019-09-06)
parents 080c97de1a5d
children 26423b57df46
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 if (is_array($val)) $val = implode(",",$val);
14 fwrite($fp,"export ".$key."='".$val."'\n");
15 }
16 fclose($fp);
17 shell_exec("sudo ./helper --post-install $pkg ".$_POST['tmp_dir']);
18 }
20 if (isset($_POST['suggested'])) {
21 foreach ($_POST['suggested'] as $pkg) {
22 if (!strstr(" ".$_POST['toconfigure']." ", " ".$pkg." "))
23 $_POST['toconfigure'] .= " ".$pkg;
24 }
25 unset($_POST['suggested']);
26 }
28 $output = '';
29 if (!empty($_POST['toconfigure'])) {
30 $pkgs = explode(" ",$_POST['toconfigure']);
31 foreach ($pkgs as $key => $pkg) {
32 shell_exec("sudo ./helper --pre-install $pkg ".$_POST['tmp_dir']);
33 $output = shell_exec("./helper --get-form $pkg ".
34 $_POST['tmp_dir']);
35 unset($pkgs[$key]);
36 $_POST['toconfigure'] = implode(" ", $pkgs);
37 $suggested = shell_exec("./helper --get-suggested $pkg ".
38 $_POST['tmp_dir']);
39 if ($suggested != "") {
40 $sugghead = <<<EOT
41 <hr />
42 <p>
43 You may want to install the following package(s) too:
44 </p>
45 <ol>
46 EOT;
47 $checked = "checked=\"checked\" ";
48 if (file_exists($_POST["tmp_dir"]."uploadconf")) $checked = "";
49 foreach (explode(" ", $suggested) as $sug)
50 if (!strstr(" ".$_POST['packages']." ",
51 " ".$sug." ")) {
52 $output .= $sugghead ;
53 $sugghead = "";
54 $output .= <<<EOT
55 <li>
56 <input type="checkbox" name="suggested[]" value="$sug" $checked/>$sug
57 </li>
58 EOT;
59 }
60 if ($sugghead == "")
61 $output .= " </ol>\n";
62 }
63 if ($output == "") {
64 shell_exec("sudo ./helper --post-install $pkg ".
65 $_POST['tmp_dir']);
66 continue;
67 }
68 ?>
70 <div class="box">
71 <h3>[Step 4/5] <?php echo $pkg; ?> configuration</h3>
73 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
75 <input name="configuring" value="<?php echo $pkg; ?>" type="hidden" />
76 <div class="large">
77 <?php
78 echo $output;
79 post_hidden();
80 ?>
81 </div>
83 <div align="center">
84 <input name="continue" value="Continue" type="submit" />
85 </div>
87 </form>
88 </div>
90 <?php
91 echo shell_exec("./helper --get-note $pkg ".$_POST['tmp_dir']);
92 break;
93 }
95 }
96 ?>