diff options
| author | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-12-15 11:49:02 +0100 |
|---|---|---|
| committer | Paul Buetow (mars.fritz.box) <paul@buetow.org> | 2013-12-15 11:49:02 +0100 |
| commit | 3a96ab7e91145b367d05e98533b5f426f762f83f (patch) | |
| tree | ac7758a706066e14b785ab6e5f7071a54baa856b /yhttpd/scripts | |
| parent | 332d7b2107833018b3ef67b64ffe121bff1ef4fb (diff) | |
add packagespackages
Diffstat (limited to 'yhttpd/scripts')
| -rw-r--r-- | yhttpd/scripts/README | 6 | ||||
| -rwxr-xr-x | yhttpd/scripts/astyle.sh | 14 | ||||
| -rwxr-xr-x | yhttpd/scripts/buildnr.pl | 26 | ||||
| -rwxr-xr-x | yhttpd/scripts/checkperl.sh | 13 | ||||
| -rwxr-xr-x | yhttpd/scripts/config.pl | 133 | ||||
| -rwxr-xr-x | yhttpd/scripts/makedist.sh | 27 | ||||
| -rw-r--r-- | yhttpd/scripts/modules/file.pm | 28 | ||||
| -rwxr-xr-x | yhttpd/scripts/screen.sh | 3 | ||||
| -rwxr-xr-x | yhttpd/scripts/setglobvals.pl | 32 | ||||
| -rwxr-xr-x | yhttpd/scripts/stats.pl | 95 | ||||
| -rwxr-xr-x | yhttpd/scripts/version.sh | 11 |
11 files changed, 0 insertions, 388 deletions
diff --git a/yhttpd/scripts/README b/yhttpd/scripts/README deleted file mode 100644 index 4a94391..0000000 --- a/yhttpd/scripts/README +++ /dev/null @@ -1,6 +0,0 @@ -All scripts should be run from the yhttpd main directory, example: - -./scripts/makeyhttpd.pl - - -A ./makeyhttpd.pl WILL NOT work :) diff --git a/yhttpd/scripts/astyle.sh b/yhttpd/scripts/astyle.sh deleted file mode 100755 index 8f67195..0000000 --- a/yhttpd/scripts/astyle.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# The yhttpd Project (2004) -# -# This uses "astyle" to format C++ code into a specific code style! - -for f in h cpp tmpl -do - for i in `find . -name "*.$f"` - do - echo $i - astyle --style=ansi -s2 $i - rm -f $i.orig - done -done diff --git a/yhttpd/scripts/buildnr.pl b/yhttpd/scripts/buildnr.pl deleted file mode 100755 index edfffd6..0000000 --- a/yhttpd/scripts/buildnr.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/perl - -# The yhttpd Project (2003) -# -# This script increases the BUILNR of msgs,h each time the yhttpd -# gets recompiled! - -use strict; - -open MSGS, "src/msgs.h"; -my @msgs = <MSGS>; -close MSGS; - -foreach (@msgs) -{ - if ( /define BUILDNR/ ) - { - s/(BUILDNR )(.+)$/$1.($2+1)/e; - print; - next; - } -} - -open MSGS, ">src/msgs.h"; -print MSGS @msgs; -close MSGS; diff --git a/yhttpd/scripts/checkperl.sh b/yhttpd/scripts/checkperl.sh deleted file mode 100755 index 642938b..0000000 --- a/yhttpd/scripts/checkperl.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# The yhttpd Project (2005) -# -# This scripts checks for a perl installation - -if ! which perl >/dev/null -then - echo You need to have Perl in your PATH! - exit 1 -fi - -echo Using `which perl` -exit 0 diff --git a/yhttpd/scripts/config.pl b/yhttpd/scripts/config.pl deleted file mode 100755 index f82d5ba..0000000 --- a/yhttpd/scripts/config.pl +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/perl - -# The yhttpd Project (2004, 2005) -# -# This script modifues the src/glob.h file. - -use strict; -use scripts::modules::file; - -print <<END; -Welcome to the yhttpd 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. -END - -my $sep = "================================================================\n"; -my $stdin; - -for (;;) { - print "$sep Do you want to use the default before-compile options?\n"; - print " (yes/no) [default is NO] "; - $stdin = <STDIN>; - chomp $stdin; - print "\n"; - - 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; - exit(0); - } - - last if $stdin eq "no" or $stdin eq ""; - print " Wrong input: You need to specify yes or no!\n"; -} # for - -`cp src/glob.h src/glob.h.org` unless -f "src/glob.h.org"; - -my @glob = fopen("src/glob.h.org"); -my $flag = 0; - -for (@glob) { - if ( $flag == 0 && /- CONFIG -/ ) { - print $sep; - $flag = 1; - next; - - } elsif ( $flag == 1 ) { - if ( /\*\// ) { - $flag = 2; - - } else { - print; - } - - next; - - } 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 or q to quit] "; - $stdin = <STDIN>; - chomp $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"; - } - - print "\n"; - $flag = 0; - next; - } - - elsif ( /#define .+/ ) { - my $default = "true"; - my $stdin; - - for (;;) { - $default = "false" if /\/\/#define/; - - 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 parse_input_value(\$stdin,\$default); - } - - else { - s/^\/\/// unless parse_input_value(\$stdin,\$default); - } - - print "\n"; - $flag = 0; - next; - } - } -} // for - -finish(); - -sub finish() { - fwrite("src/glob.h", @glob); - exit 0; -} - -sub parse_input_value { - my $val = shift; - 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/yhttpd/scripts/makedist.sh b/yhttpd/scripts/makedist.sh deleted file mode 100755 index 0814611..0000000 --- a/yhttpd/scripts/makedist.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# The yhttpd Project (2005) -# -# This script creates a .tar.bz2 ball. - -pwd=`pwd` && base=`basename $pwd` && cd .. && -version=`grep VERSION $base/src/msgs.h | head -n 1 | cut -d'"' -f2` && -prefix="$base-$version" -package="$prefix.tar.bz2" - -echo Copying files... && -rm -Rf $prefix 2>/dev/null >/dev/null -cp -Rp $base $prefix && cd $prefix && - -echo Cleaning... && -gmake mrproper 2>/dev/null >/dev/null -find . -name CVS | xargs rm -Rf -cd .. && - -echo Compressing... && -if test -f $package; then rm -f $package; fi && -tar cjf $package $prefix && - -echo Finishing... && -rm -Rf $prefix 2>/dev/null >/dev/null -cd $base && -du -h ../$package diff --git a/yhttpd/scripts/modules/file.pm b/yhttpd/scripts/modules/file.pm deleted file mode 100644 index b11e2b3..0000000 --- a/yhttpd/scripts/modules/file.pm +++ /dev/null @@ -1,28 +0,0 @@ -sub dopen -{ - my $shift = shift; - opendir DIR, $shift or die "$shift: $!\n"; - my @dir = readdir(DIR); - closedir DIR; - return @dir; -} - -sub fopen -{ - my $shift = shift; - open FILE, $shift or die "$shift: $!\n"; - my @file = <FILE>; - close FILE; - return @file; -} - -sub fwrite -{ - my $shift = shift; - my @file = @_; - open FILE, ">$shift" or die "$shift: $!\n"; - print FILE @file; - close FILE; -} - -1; diff --git a/yhttpd/scripts/screen.sh b/yhttpd/scripts/screen.sh deleted file mode 100755 index 5c227fc..0000000 --- a/yhttpd/scripts/screen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -screen -S yhttpd ./bin/yhttpd diff --git a/yhttpd/scripts/setglobvals.pl b/yhttpd/scripts/setglobvals.pl deleted file mode 100755 index 1ee1de4..0000000 --- a/yhttpd/scripts/setglobvals.pl +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl - -# The yhttpd Project (2003) -# -# This script sets up some variables in src/glob.h - -use strict; - -use scripts::modules::file; - -my $file = 'src/glob.h'; -my $gmake = `which gmake`; -my @glob = fopen($file); -chomp($gmake); - -print "-> Setting values in $file\n"; - -my $modified = 0; -foreach (@glob) -{ - if (/^(#define GMAKE) "(.*)"/) - { - if ($2 ne "$gmake \\0") - { - s/^$1 "$2"/#define GMAKE "$gmake \\0"/; - print " -> Set $gmake\n"; - fwrite($file,@glob); - last; - } - } -} - diff --git a/yhttpd/scripts/stats.pl b/yhttpd/scripts/stats.pl deleted file mode 100755 index 96fbdf1..0000000 --- a/yhttpd/scripts/stats.pl +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/perl - -# The yhttpd Project (2003 - 2004) -# -# This script generates source code and project statistics - -use strict; - -use scripts::modules::file; - -my %stats; -my $param = shift; - -&recursive("."); - -$stats{"Lines total"} = $stats{"Lines of source"} - + $stats{"Lines of scripts"} - + $stats{"Lines of text"} - + $stats{"Lines of HTML"}; - -unless (defined $param) { - - print "$_ = " . $stats{$_} . "\n" - for ( sort keys %stats ); - -} else { - - print $stats{$_} . " " - for sort keys %stats; - -} - -print "\n"; - -sub recursive -{ - my $shift = shift; - my @dir = &dopen($shift); - - foreach (@dir) - { - next if /^\.$/ or /^\.{2}$/; - - if ( -f "$shift/$_" ) - { - $stats{"Number of files total"}++; - &filestats("$shift/$_"); - } - elsif ( -d "$shift/$_" ) - { - $stats{"Number of dirs total"}++; - &recursive("$shift/$_"); - } - } -} - -sub filestats -{ - my $shift = shift; - if ( $shift =~ /\.(cpp|h|tmpl)$/ ) - { - $stats{"Number of source files"}++; - $stats{"Lines of source"} += countlines($shift); - } - elsif ( $shift =~ /\.(html|css)$/ ) - { - $stats{"Number of HTML files"}++; - $stats{"Lines of HTML"} += countlines($shift); - } - elsif ( $shift =~ /\.(gif|png|jpg)$/ ) - { - $stats{"Number of gfx files"}++; - } - elsif ( $shift =~ /(\.pl|\.sh|configure.*|Makefile.*)$/ ) - { - $stats{"Number of script files"}++; - $stats{"Lines of scripts"} += countlines($shift); - } - elsif ( $shift =~ /(\.txt|[A-Z]+)$/ ) - { - $stats{"Number of text files"}++; - $stats{"Lines of text"} += countlines($shift); - } - elsif ( $shift =~ /\.so$/ ) - { - $stats{"Number of compiled module files"}++; - } -} - -sub countlines -{ - my $shift = shift; - my @file = fopen($shift); - return $#file; -} diff --git a/yhttpd/scripts/version.sh b/yhttpd/scripts/version.sh deleted file mode 100755 index 50c189c..0000000 --- a/yhttpd/scripts/version.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# The yhttpd Project (2005) -# -# This script shows yhttpd 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" - - |
