diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/astyle.sh | 2 | ||||
| -rw-r--r--[-rwxr-xr-x] | scripts/makeyhttpd.pl | 87 | ||||
| -rwxr-xr-x[-rw-r--r--] | scripts/modules/file.pm | 0 | ||||
| -rwxr-xr-x | scripts/stats.pl | 6 |
4 files changed, 16 insertions, 79 deletions
diff --git a/scripts/astyle.sh b/scripts/astyle.sh index b9dbc45..4376887 100755 --- a/scripts/astyle.sh +++ b/scripts/astyle.sh @@ -8,7 +8,7 @@ do for i in `find . -name "*.$f"` do echo $i - astyle --style=ansi -s2 $i + astyle --style=gnu $i rm -f $i.orig done done diff --git a/scripts/makeyhttpd.pl b/scripts/makeyhttpd.pl index 7dd0345..101343a 100755..100644 --- a/scripts/makeyhttpd.pl +++ b/scripts/makeyhttpd.pl @@ -8,19 +8,20 @@ use strict; use scripts::modules::file; my @delete = ( - 'CHANGES', + 'ChangeLog', 'g++.version', 'TODO', 'NEWS', 'docs', 'src/chat', - 'src/memb', 'src/data', 'src/irc', 'src/contrib/crypt', 'src/modl.h', 'src/modl.cpp', 'src/mods', + 'src/mods/commands', + 'src/mods/irc', 'obj', 'mods', 'html', @@ -40,7 +41,6 @@ my %substituate = ( 'yChat' => 'yhttpd', 'YCHAT' => 'YHTTPD', 'CHAT' => 'HTTPD', - 'yhttpd.org' => 'yChat.org', '//>>' => '' ); @@ -93,106 +93,43 @@ print "Moving html templates\n"; system("mv demo.html html/index.html"); system("mv test.cgi notfound.html style.css html"); -print "Editing etc/yhttpd.conf\n"; -&edit_yhttpd_conf(); print "Removing marked lines of code\n->"; &remove_marked_lines('.'); -print "\nEdit version numbers\n->"; -&edit_version_numbers('yhttpd/src/msgs.h','yhttpd/README'); sub remove_marked_lines { my $dir = shift; chdir($dir); - - for (&dopen(".")) - { + foreach (&dopen(".")) { next if /^\.+$/; print " $_"; - - if ( -f $_ ) - { + if ( -f $_ ) { my @newfile; my $flag = 0; - - for my $line (fopen($_)) - { + foreach my $line (fopen($_)) { $flag = 1 if $line =~ /\/\/<<\*/; if ($flag == 0 && $line !~ /\/\/<</) { - for ( @deletelines ) - { - if ($line =~ /$_/) - { + foreach ( @deletelines ) { + if ($line =~ /$_/) { $flag = 3; last; } } - - if ($flag != 3 ) - { + if ($flag != 3 ) { map { $line =~ s/$_/$substituate{$_}/eg } keys %substituate; push @newfile, $line; - } - - else - { + } else { $flag = 0; } } $flag = 0 if $line =~ /\/\/\*>>/; } - &fwrite($_, @newfile); - } - - elsif ( -d $_ ) - { - # Recursive + } elsif ( -d $_ ) { &remove_marked_lines($_); } } - chdir('..'); } -sub edit_yhttpd_conf -{ - my @old = fopen("etc/yhttpd.conf"); - my @new = @old[0..1]; - - my $flag = 0; - for (@old) - { - if ($flag == 0) - { - if (/<category name="httpd">/) - { - $flag = 1; - push @new, $_; - } - } - - else - { - push @new, $_; - } - } - - fwrite("etc/yhttpd.conf", @new); -} - -sub edit_version_numbers -{ - for (@_) - { - print " $_"; - my @file = fopen $_; - for (@file) - { - s/([0-9]+\.[0-9]+)\.[0-9]+(-*)/$1$2/g for @file; - s/RELEASE/DEVEL/g; - } - fwrite($_,@file); - } -} - print "\n"; + diff --git a/scripts/modules/file.pm b/scripts/modules/file.pm index b11e2b3..b11e2b3 100644..100755 --- a/scripts/modules/file.pm +++ b/scripts/modules/file.pm diff --git a/scripts/stats.pl b/scripts/stats.pl index 0eea04d..e5cc2b3 100755 --- a/scripts/stats.pl +++ b/scripts/stats.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# The yChat Project (2003 - 2005) +# The yChat Project (2003 - 2004) # # This script generates source code and project statistics @@ -71,12 +71,12 @@ sub filestats { $stats{"Number of gfx files"}++; } - elsif ( $shift =~ /(\.pl|\.pm|\.sh|configure.*|Makefile.*)$/ ) + elsif ( $shift =~ /(\.pl|\.sh|configure.*|Makefile.*)$/ ) { $stats{"Number of script files"}++; $stats{"Lines of scripts"} += countlines($shift); } - elsif ( $shift =~ /(\.txt|[A-Z]+)$/ ) + elsif ( $shift =~ /(\.txt|README|INSTALL|COPYING|NEWS|SNAPSHOT|ChangeLog)$/ ) { $stats{"Number of text files"}++; $stats{"Lines of text"} += countlines($shift); |
