@@ -134,16 +134,6 @@ function abspath($path) // {{{
134134 return str_replace ('\\' , '/ ' , function_exists ('realpath ' ) ? realpath ($ path ) : $ path );
135135} // }}}
136136
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-
147137function find_file ($ file_array ) // {{{
148138{
149139 $ paths = explode (PATH_SEPARATOR , getenv ('PATH ' ));
@@ -327,6 +317,19 @@ function getFileModificationHistory(): array {
327317 return $ history_file ;
328318}
329319
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+
330333$ srcdir = dirname (__FILE__ );
331334$ workdir = $ srcdir ;
332335$ basedir = $ srcdir ;
@@ -635,7 +638,6 @@ function getFileModificationHistory(): array {
635638// Notice how doing it this way results in generating less than half as many files.
636639$ infiles = array (
637640 'manual.xml.in ' ,
638- 'scripts/file-entities.php.in ' ,
639641);
640642
641643// Show local repository status to facilitate debug
@@ -736,9 +738,27 @@ function getFileModificationHistory(): array {
736738
737739globbetyglob ("{$ ac ['basedir ' ]}/scripts " , 'make_scripts_executable ' );
738740
739- $ redir = ($ ac ['quiet ' ] == 'yes ' ) ? ' > ' . (is_windows () ? 'nul ' : '/dev/null ' ) : '' ;
740741
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+ }
742762
743763
744764checking ("for if we should generate a simplified file " );
0 commit comments