Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 6 additions & 31 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,12 @@ function errbox($msg) {
echo "| ", $msg, " |", "\n";
echo $line, "\n\n";
}

function errors_are_bad($status) {
echo "\nEyh man. No worries. Happ shittens. Try again after fixing the errors above.\n";
exit($status);
}

function is_windows() {
return PHP_OS === 'WINNT';
}

function checking($for) // {{{
{
global $ac;
Expand Down Expand Up @@ -199,27 +196,6 @@ function globbetyglob($globber, $userfunc)
}
} // }}}

function find_dot_in($filename) // {{{
{
if (substr($filename, -3) == '.in') {
$GLOBALS['infiles'][] = $filename;
}
} // }}}

function generate_output_file($in, $out, $ac) // {{{
{
$data = file_get_contents($in);

if ($data === false) {
return false;
}
foreach ($ac as $k => $v) {
$data = str_replace("@$k@", $v, $data);
}

return file_put_contents($out, $data);
} // }}}

function make_scripts_executable($filename) // {{{
{
if (substr($filename, -3) == '.sh') {
Expand Down Expand Up @@ -575,7 +551,7 @@ function find_xml_files($path) // {{{
}


// Show local repository status to facilitate debug
// Show local repository status to facilitate remote debugging

$repos = array();
$repos['doc-base'] = $ac['basedir'];
Expand All @@ -587,12 +563,11 @@ function find_xml_files($path) // {{{
foreach ( $repos as $name => $path )
{
$path = escapeshellarg( $path );
$branch = trim(shell_exec("git -C $path rev-parse --abbrev-ref HEAD"));
$suffix = $branch == "master" ? "" : " (branch $branch)";
$branch = trim( shell_exec( "git -C $path rev-parse --abbrev-ref HEAD" ));
$branch = $branch == "master" ? "" : " (branch $branch)";
$output .= str_pad( "$name:" , 10 );
$output .= rtrim(shell_exec("git -C $path rev-parse HEAD") ?? "") . "$suffix ";
$output .= rtrim(shell_exec("git -C $path for-each-ref --format=\"%(push:track)\" refs/heads/$branch") ?? "") . "\n";
$output .= rtrim(shell_exec("git -C $path status -s") ?? "") . "\n";
$output .= rtrim( shell_exec( "git -C $path rev-parse HEAD" ) ?? "" . $branch ) . "\n";
$output .= rtrim( shell_exec( "git -C $path status -s") ?? "" ) . "\n";
}
while( str_contains( $output , "\n\n" ) )
$output = str_replace( "\n\n" , "\n" , $output );
Expand Down
Loading