Skip to content

Commit 1ca7eeb

Browse files
authored
Clean ups before more refactoring
1 parent ab95b71 commit 1ca7eeb

1 file changed

Lines changed: 6 additions & 31 deletions

File tree

configure.php

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,12 @@ function errbox($msg) {
123123
echo "| ", $msg, " |", "\n";
124124
echo $line, "\n\n";
125125
}
126+
126127
function errors_are_bad($status) {
127128
echo "\nEyh man. No worries. Happ shittens. Try again after fixing the errors above.\n";
128129
exit($status);
129130
}
130131

131-
function is_windows() {
132-
return PHP_OS === 'WINNT';
133-
}
134-
135132
function checking($for) // {{{
136133
{
137134
global $ac;
@@ -199,27 +196,6 @@ function globbetyglob($globber, $userfunc)
199196
}
200197
} // }}}
201198

202-
function find_dot_in($filename) // {{{
203-
{
204-
if (substr($filename, -3) == '.in') {
205-
$GLOBALS['infiles'][] = $filename;
206-
}
207-
} // }}}
208-
209-
function generate_output_file($in, $out, $ac) // {{{
210-
{
211-
$data = file_get_contents($in);
212-
213-
if ($data === false) {
214-
return false;
215-
}
216-
foreach ($ac as $k => $v) {
217-
$data = str_replace("@$k@", $v, $data);
218-
}
219-
220-
return file_put_contents($out, $data);
221-
} // }}}
222-
223199
function make_scripts_executable($filename) // {{{
224200
{
225201
if (substr($filename, -3) == '.sh') {
@@ -575,7 +551,7 @@ function find_xml_files($path) // {{{
575551
}
576552

577553

578-
// Show local repository status to facilitate debug
554+
// Show local repository status to facilitate remote debugging
579555

580556
$repos = array();
581557
$repos['doc-base'] = $ac['basedir'];
@@ -587,12 +563,11 @@ function find_xml_files($path) // {{{
587563
foreach ( $repos as $name => $path )
588564
{
589565
$path = escapeshellarg( $path );
590-
$branch = trim(shell_exec("git -C $path rev-parse --abbrev-ref HEAD"));
591-
$suffix = $branch == "master" ? "" : " (branch $branch)";
566+
$branch = trim( shell_exec( "git -C $path rev-parse --abbrev-ref HEAD" ));
567+
$branch = $branch == "master" ? "" : " (branch $branch)";
592568
$output .= str_pad( "$name:" , 10 );
593-
$output .= rtrim(shell_exec("git -C $path rev-parse HEAD") ?? "") . "$suffix ";
594-
$output .= rtrim(shell_exec("git -C $path for-each-ref --format=\"%(push:track)\" refs/heads/$branch") ?? "") . "\n";
595-
$output .= rtrim(shell_exec("git -C $path status -s") ?? "") . "\n";
569+
$output .= rtrim( shell_exec( "git -C $path rev-parse HEAD" ) ?? "" . $branch ) . "\n";
570+
$output .= rtrim( shell_exec( "git -C $path status -s") ?? "" ) . "\n";
596571
}
597572
while( str_contains( $output , "\n\n" ) )
598573
$output = str_replace( "\n\n" , "\n" , $output );

0 commit comments

Comments
 (0)