From c8b2ef7b899766d04562f7e04a84251cea8fa701 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:44 +0200 Subject: tagging ychat-0.8.0 --- scripts/makeyhttpd.pl | 87 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 75 insertions(+), 12 deletions(-) (limited to 'scripts/makeyhttpd.pl') diff --git a/scripts/makeyhttpd.pl b/scripts/makeyhttpd.pl index 101343a..5a44462 100644 --- a/scripts/makeyhttpd.pl +++ b/scripts/makeyhttpd.pl @@ -8,20 +8,19 @@ use strict; use scripts::modules::file; my @delete = ( - 'ChangeLog', + 'CHANGES', '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', @@ -41,6 +40,7 @@ my %substituate = ( 'yChat' => 'yhttpd', 'YCHAT' => 'YHTTPD', 'CHAT' => 'HTTPD', + 'yhttpd.org' => 'yChat.org', '//>>' => '' ); @@ -93,43 +93,106 @@ 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); - foreach (&dopen(".")) { + + for (&dopen(".")) + { next if /^\.+$/; print " $_"; - if ( -f $_ ) { + + if ( -f $_ ) + { my @newfile; my $flag = 0; - foreach my $line (fopen($_)) { + + for my $line (fopen($_)) + { $flag = 1 if $line =~ /\/\/<<\*/; if ($flag == 0 && $line !~ /\/\/<>/; } + &fwrite($_, @newfile); - } elsif ( -d $_ ) { + } + + elsif ( -d $_ ) + { + # Recursive &remove_marked_lines($_); } } + chdir('..'); } -print "\n"; +sub edit_yhttpd_conf +{ + my @old = fopen("etc/yhttpd.conf"); + my @new = @old[0..1]; + + my $flag = 0; + for (@old) + { + if ($flag == 0) + { + if (//) + { + $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/[PRE]{0,3}RELEASE/DEVEL/g; + } + fwrite($_,@file); + } +} + +print "\n"; -- cgit v1.2.3