summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2013-04-06 13:14:45 +0200
committerPaul Buetow <paul@buetow.org>2013-04-06 13:14:45 +0200
commit5f4e214740242513c837c8a005ca23779bab1d0c (patch)
tree3880f745b0d3376030e3342e60679f25b38bdc4c /scripts
parent23c5e7d57e1e9216f4da3446656df2dc7202975d (diff)
tagging ychat-0.8.2ychat-0.8.2
Diffstat (limited to 'scripts')
-rw-r--r--scripts/README2
-rwxr-xr-xscripts/astyle.sh2
-rwxr-xr-xscripts/buildnr.pl4
-rwxr-xr-xscripts/checkperl.sh2
-rwxr-xr-xscripts/config.pl81
-rwxr-xr-xscripts/makedist.sh2
-rwxr-xr-xscripts/screen.sh2
-rwxr-xr-xscripts/setglobvals.pl2
-rwxr-xr-xscripts/version.sh6
9 files changed, 46 insertions, 57 deletions
diff --git a/scripts/README b/scripts/README
index 4a94391..189b169 100644
--- a/scripts/README
+++ b/scripts/README
@@ -1,4 +1,4 @@
-All scripts should be run from the yhttpd main directory, example:
+All scripts should be run from the yChat main directory, example:
./scripts/makeyhttpd.pl
diff --git a/scripts/astyle.sh b/scripts/astyle.sh
index 8f67195..b9dbc45 100755
--- a/scripts/astyle.sh
+++ b/scripts/astyle.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# The yhttpd Project (2004)
+# The yChat Project (2004)
#
# This uses "astyle" to format C++ code into a specific code style!
diff --git a/scripts/buildnr.pl b/scripts/buildnr.pl
index edfffd6..ee3d3e2 100755
--- a/scripts/buildnr.pl
+++ b/scripts/buildnr.pl
@@ -1,8 +1,8 @@
#!/usr/bin/perl
-# The yhttpd Project (2003)
+# The yChat Project (2003)
#
-# This script increases the BUILNR of msgs,h each time the yhttpd
+# This script increases the BUILNR of msgs,h each time the yChat
# gets recompiled!
use strict;
diff --git a/scripts/checkperl.sh b/scripts/checkperl.sh
index 642938b..fa5e98f 100755
--- a/scripts/checkperl.sh
+++ b/scripts/checkperl.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# The yhttpd Project (2005)
+# The yChat Project (2005)
#
# This scripts checks for a perl installation
diff --git a/scripts/config.pl b/scripts/config.pl
index af58012..73b3ae5 100755
--- a/scripts/config.pl
+++ b/scripts/config.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# The yhttpd Project (2004, 2005)
+# The yChat Project (2004, 2005)
#
# This script modifues the src/glob.h file.
@@ -8,27 +8,24 @@ use strict;
use scripts::modules::file;
print <<END;
-Welcome to the yhttpd configurator!
+Welcome to the yChat configurator!
You may also edit the src/glob.h file manually instead of using
this configurator option. Please also notice that this are only
before-compile options. All setups which can be made after com-
-iling are placed in the yhttpd configuration file.
+iling are placed in the yChat configuration file.
END
my $sep = "================================================================\n";
my $stdin;
-for (;;)
-{
+for (;;) {
print "$sep Do you want to use the default before-compile options?\n";
print " (yes/no) [default is NO] ";
$stdin = <STDIN>;
chomp $stdin;
- prove_if_default(\$stdin);
print "\n";
- if ( $stdin eq "yes")
- {
+ if ( $stdin eq "yes") {
print " You chose to use all the default before-compile options. Exiti-\n";
print " ng the configurator now!\n";
print $sep;
@@ -44,46 +41,37 @@ for (;;)
my @glob = fopen("src/glob.h.org");
my $flag = 0;
-for (@glob)
-{
- if ( $flag == 0 && /- CONFIG -/ )
- {
+for (@glob) {
+ if ( $flag == 0 && /- CONFIG -/ ) {
print $sep;
$flag = 1;
next;
- }
- elsif ( $flag == 1 )
- {
- if ( /\*\// )
- {
+ } elsif ( $flag == 1 ) {
+ if ( /\*\// ) {
$flag = 2;
- }
- else
- {
+ } else {
print;
}
next;
- }
- elsif ( $flag == 2 )
- {
- if ( /#define (.+) (.+)/ )
- {
+ } elsif ( $flag == 2 ) {
+ if ( /#define (.+) (.+)/ ) {
my $def = $1;
my $val = $2;
my $flg = 0;
$flg = 1 if $val =~ s/"//g;
- print " [Press enter to use default value: $val] ";
+ print " [Press enter to use default value: $val or q to quit] ";
$stdin = <STDIN>;
chomp $stdin;
- unless ( prove_if_default(\$stdin) )
- {
+ finish() if $stdin eq "q" or $stdin eq "quit";
+
+ unless ( parse_input_value(\$stdin,\$val) ) {
$stdin = "\"$stdin\"" if $flg == 1;
$_ = "#define $def $stdin\n";
}
@@ -93,33 +81,28 @@ for (@glob)
next;
}
- elsif ( /#define .+/ )
- {
+ elsif ( /#define .+/ ) {
my $default = "true";
my $stdin;
- for (;;)
- {
+ for (;;) {
$default = "false" if /\/\/#define/;
- print " [Press enter to use default value: $default] ";
+ print " [Press enter to use default value: $default or q to quit] ";
$stdin = <STDIN>;
chomp $stdin;
+ finish() if $stdin eq "q" or $stdin eq "quit";
last if $stdin eq "" || $stdin eq "true" || $stdin eq "false";
print " Wrong input: You need to specify true or false!\n";
}
- if ( $default eq "true" )
- {
- $_ = "//$_"
- unless prove_if_default(\$stdin);
+ if ( $default eq "true" ) {
+ $_ = "//$_" unless parse_input_value(\$stdin,\$default);
}
- else
- {
- s/^\/\///
- unless prove_if_default(\$stdin);
+ else {
+ s/^\/\/// unless parse_input_value(\$stdin,\$default);
}
print "\n";
@@ -129,16 +112,22 @@ for (@glob)
}
} // for
- fwrite("src/glob.h", @glob);
+finish();
+
+sub finish() {
+ fwrite("src/glob.h", @glob);
+ exit 0;
+}
-sub prove_if_default
-{
+sub parse_input_value {
my $val = shift;
- if ( $$val eq "" )
- {
+ my $def = shift;
+
+ if ( $$val eq "" || $$val eq $$def) {
print " -> Using default option!\n";
return 1;
}
+
print " -> Using new option $$val!\n";
return 0;
}
diff --git a/scripts/makedist.sh b/scripts/makedist.sh
index 0814611..6c51a07 100755
--- a/scripts/makedist.sh
+++ b/scripts/makedist.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# The yhttpd Project (2005)
+# The yChat Project (2005)
#
# This script creates a .tar.bz2 ball.
diff --git a/scripts/screen.sh b/scripts/screen.sh
index 5c227fc..6d5b7aa 100755
--- a/scripts/screen.sh
+++ b/scripts/screen.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-screen -S yhttpd ./bin/yhttpd
+screen -S ychat ./bin/ychat
diff --git a/scripts/setglobvals.pl b/scripts/setglobvals.pl
index 1ee1de4..13288a5 100755
--- a/scripts/setglobvals.pl
+++ b/scripts/setglobvals.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# The yhttpd Project (2003)
+# The yChat Project (2003)
#
# This script sets up some variables in src/glob.h
diff --git a/scripts/version.sh b/scripts/version.sh
index 50c189c..46b9fc5 100755
--- a/scripts/version.sh
+++ b/scripts/version.sh
@@ -1,11 +1,11 @@
#!/bin/sh
-# The yhttpd Project (2005)
+# The yChat Project (2005)
#
-# This script shows yhttpd VERSION-BRANCH Build BUILDNUMBER
+# This script shows yChat VERSION-BRANCH Build BUILDNUMBER
version=`grep VERSION src/msgs.h | head -n 1 | cut -d'"' -f2`
branch=`grep BRANCH src/msgs.h | head -n 1 | cut -d'"' -f2`
build=`grep BUILD src/msgs.h | tail -n 1 | cut -d' ' -f3`
-echo "yhttpd $version-$branch Build $build"
+echo "yChat $version-$branch Build $build"