Author: gedmurphy Date: Thu Mar 30 17:39:58 2006 New Revision: 21415
URL: http://svn.reactos.ru/svn/reactos?rev=21415&view=rev Log: add basic audit progress script
Added: trunk/web/reactos.org/scripts/audit_progress.pl
Added: trunk/web/reactos.org/scripts/audit_progress.pl URL: http://svn.reactos.ru/svn/reactos/trunk/web/reactos.org/scripts/audit_progre... ============================================================================== --- trunk/web/reactos.org/scripts/audit_progress.pl (added) +++ trunk/web/reactos.org/scripts/audit_progress.pl Thu Mar 30 17:39:58 2006 @@ -1,0 +1,59 @@ +#!/usr/bin/perl + +# This script runs on a machine with access to a local ReactOS repositry +# Issues with the SVN perl bindings made this method easier. +# Also requires svn in your path. + +use strict; +use warnings; + +my $in_path = "/reactos"; # enter the local path of the main reactos folder +my $out_file = "/progress_bar.html"; # enter the html output path +my $log_file = "/audit_progress.log"; # enter the log file path +my $total_width = 200; +my ($unclean_files, $total_files, $todo_width, $done_width, $done_pct); + +open HTML, "> $out_file" + or die "couldn't open $out_file for writing: $!\n"; + +my @files = `svn ls -v -R $in_path`; + +foreach (@files) { + next if //$/; + $total_files++; + if (/\sO\s/) { + $unclean_files++; + } +} + +if ($unclean_files != 0) { + $todo_width = ($unclean_files / $total_files) * $total_width; + $done_width = (($total_files - $unclean_files) / $total_files) * $total_width; + $done_pct = (($total_files - $unclean_files) / $total_files) * 100; +} else { + $todo_width = 0; + $done_width = $total_width; + $done_pct = 100; +} + +output_html(); + +open LOG, ">> $log_file" + or die "couldn't open $log_file for writing: $!\n"; +my $date = localtime; +print LOG "$date : total files = $total_files\tfiles unaudited = $unclean_files\tcompleted $done_pct%\n"; + + + + +sub output_html { + print HTML "<center>\n"; + print HTML " <img border="0" src="http://www.reactos.org/images/progress-end.gif%5C" width="1" height="20">"; + printf HTML "<img border="0" src="http://www.reactos.org/images/progress-done.gif%5C" width="%d" height="20">", $done_width; + printf HTML "<img border="0" src="http://www.reactos.org/images/progress-todo.gif%5C" width="%d" height="20">", $todo_width; + print HTML "<img border="0" src="http://www.reactos.org/images/progress-end.gif%5C" width="1" height="20">\n"; + print HTML " <br>\n"; + printf HTML " <font size="2" face="Verdana, Arial, Helvetica, sans-serif">%.1f%% complete</font>\n", $done_pct; + print HTML "</center>\n"; +} +