diff --git a/docs/scripts/revcheck.php b/docs/scripts/revcheck.php index dc98cbd8..5f036c1d 100755 --- a/docs/scripts/revcheck.php +++ b/docs/scripts/revcheck.php @@ -26,7 +26,7 @@ Check the revision of translated files against the actual english xml files, and print statistics Usage: - [] [>] + [] [>] must be a valid language code used in the repository @@ -189,7 +189,7 @@ function get_file_status($file) if (!@file_exists($trans_file)) { $files_by_mark[REV_NOTRANS]++; $trans_name = substr($trans_file, strlen($DOCDIR) + strlen($LANG) + 1); - $size = round(filesize($file)/1024, 1); + $size = intval(filesize($file)/1024); $missing_files[$trans_name] = array( $size ); $file_sizes_by_mark[REV_NOTRANS] += $size; // compute en-tags just if they're needed in the WIP-Table @@ -355,6 +355,7 @@ function get_dir_status($dir) } // get_dir_status() function end + // Check for files removed in the EN tree, but still living in the translation function get_old_files($dir) { @@ -429,6 +430,7 @@ function get_old_files($dir) } // get_old_files() function end + // ========================================================================= // Functions to read in the translation.xml file and process contents // ========================================================================= @@ -547,18 +549,6 @@ function parse_translation($DOCDIR, $LANG, $MAINT) } // parse_translation() function end() -// ========================================================================= -// Debug functions for all the functions and code on this page -// ========================================================================= - -// Print preformatted (debug function) -function print_pre($var) -{ - print("
");
-    print_r($var);
-    print("
"); -} // print_pre() function end - // ========================================================================= // Start of the program execution // ========================================================================= @@ -839,31 +829,38 @@ END_OF_MULTILINE; // If we have a 'numeric' revision diff and it is not zero, // make a link to the CVS repository's diff script if ($file["revision"][2] != "n/a" && $file["revision"][2] !== 0) { - $file["short_name"] = "" . $file["short_name"] . ""; + $url = 'http://cvs.php.net/diff.php/' . + preg_replace( "'^".$DOCDIR."'", 'smarty/docs/', $file['full_name']) . + '?r1=' . $file['revision'][1] . + '&r2=' . $file['revision'][0] . + CVS_OPT; + $url_ws = $url . '&ws=0'; + + $file['short_name'] = ''. $file["short_name"] . ' '. + '[NoWS]'; } // Guess the new directory from the full name of the file $new_dir = dirname($file["full_name"]); - // If this is a new directory, put out dir headline - if ($new_dir != $prev_dir) { - - // Drop out the unneeded parts from the dirname... - $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full_name"])); - - // Print out directory header - print "$display_dir\n"; - + // If this is a new directory, put out old dir lines + if ($new_dir != $prev_dir && isset($lines)) { + echo $prev_diplay_dir; + echo " ($line_number)"; + echo $lines; + + $lines = ''; + $line_number = 0; + // Store the new actual directory $prev_dir = $new_dir; } + // Drop out the unneeded parts from the dirname... + $display_dir = str_replace($DOCDIR."en/", "", dirname($file["full_name"])); + $prev_diplay_dir = "$display_dir"; - // Write out the line for the current file (get file name shorter) - print "{$file['short_name']}". + // Save the line for the current file (get file name shorter) + $lines .= "{$file['short_name']}". " {$file['revision'][0]}" . " {$file['revision'][1]}". "{$file['revision'][2]} ". @@ -875,9 +872,14 @@ END_OF_MULTILINE; "{$file['date'][2]} ". "{$file['maintainer']}". "".trim($file['status'])."\n"; + $line_number++; } + // echo the last dir and $lines + echo "$prev_diplay_dir ($line_number)"; + echo $lines; + print("\n

 

\n$navbar

 

\n"); } @@ -1048,7 +1050,8 @@ if ($count > 0) { print "\n

 

\n$navbar

 

\n"; } + // All OK, end the file print "\n\n"; -?> \ No newline at end of file +?>