tiny-slitaz annotate step4.php @ rev 5

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