@@ -134,16 +134,6 @@ function abspath($path) // {{{
134
134
return str_replace ('\\' , '/ ' , function_exists ('realpath ' ) ? realpath ($ path ) : $ path );
135
135
} // }}}
136
136
137
- function quietechorun ($ e ) // {{{
138
- {
139
- // enclose in "" on Windows for PHP < 5.3
140
- if (is_windows () && phpversion () < '5.3 ' ) {
141
- $ e = '" ' .$ e .'" ' ;
142
- }
143
-
144
- passthru ($ e );
145
- } // }}}
146
-
147
137
function find_file ($ file_array ) // {{{
148
138
{
149
139
$ paths = explode (PATH_SEPARATOR , getenv ('PATH ' ));
@@ -327,6 +317,19 @@ function getFileModificationHistory(): array {
327
317
return $ history_file ;
328
318
}
329
319
320
+ if ( true ) # Initial clean up
321
+ {
322
+ $ dir = escapeshellarg ( __DIR__ );
323
+ $ cmd = "git -C $ dir clean temp -fdx --quiet " ;
324
+ $ ret = 0 ;
325
+ passthru ( $ cmd , $ ret );
326
+ if ( $ ret != 0 )
327
+ {
328
+ echo "doc-base/temp clean up FAILED. \n" ;
329
+ exit ( 1 );
330
+ }
331
+ }
332
+
330
333
$ srcdir = dirname (__FILE__ );
331
334
$ workdir = $ srcdir ;
332
335
$ basedir = $ srcdir ;
@@ -635,7 +638,6 @@ function getFileModificationHistory(): array {
635
638
// Notice how doing it this way results in generating less than half as many files.
636
639
$ infiles = array (
637
640
'manual.xml.in ' ,
638
- 'scripts/file-entities.php.in ' ,
639
641
);
640
642
641
643
// Show local repository status to facilitate debug
@@ -736,9 +738,27 @@ function getFileModificationHistory(): array {
736
738
737
739
globbetyglob ("{$ ac ['basedir ' ]}/scripts " , 'make_scripts_executable ' );
738
740
739
- $ redir = ($ ac ['quiet ' ] == 'yes ' ) ? ' > ' . (is_windows () ? 'nul ' : '/dev/null ' ) : '' ;
740
741
741
- quietechorun ("\"{$ ac ['PHP ' ]}\" -q \"{$ ac ['basedir ' ]}/scripts/file-entities.php \"{$ redir }" );
742
+ { # file-entities.php
743
+
744
+ $ cmd = array ();
745
+ $ cmd [] = $ ac ['PHP ' ];
746
+ $ cmd [] = __DIR__ . "/scripts/file-entities.php " ;
747
+ if ( $ ac ["LANG " ] != "en " )
748
+ $ cmd [] = $ ac ["LANG " ];
749
+ if ( $ ac ['CHMENABLED ' ] == 'yes ' )
750
+ $ cmd [] = '--chmonly ' ;
751
+ foreach ( $ cmd as & $ part )
752
+ $ part = escapeshellarg ( $ part );
753
+ $ ret = 0 ;
754
+ $ cmd = implode ( ' ' , $ cmd );
755
+ passthru ( $ cmd , $ ret );
756
+ if ( $ ret != 0 )
757
+ {
758
+ echo "doc-base/scripts/file-entities.php FAILED. \n" ;
759
+ exit ( 1 );
760
+ }
761
+ }
742
762
743
763
744
764
checking ("for if we should generate a simplified file " );
0 commit comments