tiny-slitaz diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/step4.php Tue Aug 21 11:16:18 2012 +0200 1.3 @@ -0,0 +1,60 @@ 1.4 +<?php 1.5 + 1.6 +if (isset($_POST['packages']) && !isset($_POST['toconfigure'])) { 1.7 + $_POST['toconfigure'] = shell_exec("./helper --depends ". 1.8 + $_POST['tmp_dir']." ".$_POST['packages']); 1.9 +} 1.10 + 1.11 +if (isset($_POST['configuring'])) { 1.12 + $pkg = $_POST['configuring']; 1.13 + $fp = fopen($_POST['tmp_dir']."vars","w"); 1.14 + foreach ($_POST as $key => $val) { 1.15 + if (in_array($key, $usedvars)) continue; 1.16 + fwrite($fp,"export ".$key."='".$val."'\n"); 1.17 + } 1.18 + fclose($fp); 1.19 + shell_exec("sudo ./helper --post-install $pkg ".$_POST['tmp_dir']); 1.20 +} 1.21 + 1.22 +$output = ''; 1.23 +if (isset($_POST['toconfigure']) && $_POST['toconfigure'] != "") { 1.24 + $pkgs = explode(" ",$_POST['toconfigure']); 1.25 + foreach ($pkgs as $key => $pkg) { 1.26 + shell_exec("sudo ./helper --pre-install $pkg ".$_POST['tmp_dir']); 1.27 + $output = shell_exec("./helper --get-form $pkg ". 1.28 + $_POST['tmp_dir']); 1.29 + unset($pkgs[$key]); 1.30 + $_POST['toconfigure'] = implode(" ", $pkgs); 1.31 + if ($output == "") { 1.32 + shell_exec("sudo ./helper --post-install $pkg ". 1.33 + $_POST['tmp_dir']); 1.34 + continue; 1.35 + } 1.36 +?> 1.37 + 1.38 +<a name="configuration"></a> 1.39 +<h2><?php echo $pkg; ?> configuration</h2> 1.40 + 1.41 +<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> 1.42 + 1.43 +<input name="configuring" value="<?php echo $pkg; ?>" type="hidden" /> 1.44 +<?php 1.45 + echo $output; 1.46 + post_hidden(); 1.47 +?> 1.48 +<p> 1.49 +</p> 1.50 + 1.51 +<div align="center"> 1.52 +<input name="continue" value="Continue" type="submit" /> 1.53 +</div> 1.54 + 1.55 +</form> 1.56 + 1.57 +<?php 1.58 + echo shell_exec("./helper --get-note $pkg ".$_POST['tmp_dir']); 1.59 + break; 1.60 + } 1.61 + 1.62 +} 1.63 +?>