summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/build_smb_interfaces.pl161
-rwxr-xr-xsource4/script/find_unused_makefilevars.pl27
-rwxr-xr-xsource4/script/harness2subunit.pl32
-rwxr-xr-xsource4/script/installlib.sh4
-rwxr-xr-xsource4/script/installmisc.sh13
-rwxr-xr-xsource4/script/installmodules.sh33
-rwxr-xr-xsource4/script/installscripts.sh47
-rwxr-xr-xsource4/script/uninstallheader.sh35
-rwxr-xr-xsource4/script/uninstallmodules.sh37
-rwxr-xr-xsource4/script/uninstallscripts.sh36
10 files changed, 22 insertions, 403 deletions
diff --git a/source4/script/build_smb_interfaces.pl b/source4/script/build_smb_interfaces.pl
deleted file mode 100755
index 5fac94ca6e..0000000000
--- a/source4/script/build_smb_interfaces.pl
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/perl
-#
-# Create ejs interfaces for structures in a C header file
-#
-
-use File::Basename;
-use Data::Dumper;
-
-#
-# Generate parse tree for header file
-#
-
-my $file = shift;
-require smb_interfaces;
-my $parser = new smb_interfaces;
-$header = $parser->parse($file);
-
-#
-# Make second pass over tree to make it easier to process.
-#
-
-sub flatten_structs($) {
- my $obj = shift;
- my $s = { %$obj };
-
- # Map NAME, STRUCT_NAME and UNION_NAME elements into a more likeable
- # property.
-
- if (defined($obj->{STRUCT_NAME}) or defined($obj->{UNION_NAME})) {
-
- $s->{TYPE_DEFINED} = defined($obj->{STRUCT_NAME}) ? $obj->{STRUCT_NAME}
- : $obj->{UNION_NAME};
-
- delete $s->{STRUCT_NAME};
- delete $s->{UNION_NAME};
- }
-
- # Create a new list of structure fields with flattened names
-
- foreach my $elt (@{$obj->{DATA}}) {
- foreach my $name (@{$elt->{NAME}}) {
- my $new_elt = { %$elt };
- $new_elt->{NAME} = $name;
-# $new_elt->{PARENT} = $s;
- push(@{$s->{FIELDS}}, flatten_structs($new_elt));
- }
- }
-
- delete $s->{DATA};
-
- return $s;
-}
-
-@newheader = map { flatten_structs($_) } @{$header};
-
-#
-# Generate implementation
-#
-
-my $basename = basename($file, ".h");
-stat "libcli/gen_raw" || mkdir("libcli/gen_raw") || die("mkdir");
-
-open(FILE, ">libcli/gen_raw/ejs_${basename}.c");
-
-print FILE "/* EJS wrapper functions auto-generated by build_smb_interfaces.pl */\n\n";
-
-print FILE "#include \"includes.h\"\n";
-print FILE "#include \"scripting/ejs/smbcalls.h\"\n";
-print FILE "#include \"lib/appweb/ejs/ejs.h\"\n";
-print FILE "#include \"scripting/ejs/ejsrpc.h\"\n"; # TODO: remove this
-print FILE "\n";
-
-sub transfer_element($$$) {
- my $dir = shift;
- my $prefix = shift;
- my $elt = shift;
-
- $type = $elt->{TYPE};
- $type =~ s/_t$//;
-
- print FILE "\tNDR_CHECK(ejs_${dir}_$type(ejs, v, \"$prefix.$elt->{NAME}\"));\n";
-}
-
-sub transfer_struct($$) {
- my $dir = shift;
- my $struct = shift;
-
- foreach my $field (@{$struct->{FIELDS}}) {
- next if $dir eq "pull" and $field->{NAME} eq "out";
- next if $dir eq "push" and $field->{NAME} eq "in";
-
- if ($field->{TYPE} eq "struct") {
- foreach $subfield (@{$field->{FIELDS}}) {
- transfer_element($dir, $field->{NAME}, $subfield);
- }
- } else {
- transfer_element($dir, $struct->{NAME}, $field);
- }
- }
-}
-
-# Top level call functions
-
-foreach my $s (@newheader) {
-
- if ($s->{TYPE} eq "struct") {
-
- # Push/pull top level struct
-
- print FILE "NTSTATUS ejs_pull_$s->{TYPE_DEFINED}(struct ejs_rpc *ejs, struct MprVar *v, struct $s->{TYPE_DEFINED} *r)\n";
- print FILE "{\n";
-
- transfer_struct("pull", $s);
-
- print FILE "\n\treturn NT_STATUS_OK;\n";
- print FILE "}\n\n";
-
- print FILE "NTSTATUS ejs_push_$s->{TYPE_DEFINED}(struct ejs_rpc *ejs, struct MprVar *v, const struct $s->{TYPE_DEFINED} *r)\n";
- print FILE "{\n";
-
- transfer_struct("push", $s);
-
- print FILE "\n\treturn NT_STATUS_OK;\n";
- print FILE "}\n\n";
-
- # Function call
-
- print FILE "static int ejs_$s->{TYPE_DEFINED}(int eid, int argc, struct MprVar **argv)\n";
- print FILE "{\n";
- print FILE "\treturn ejs_raw_call(eid, argc, argv, (ejs_pull_function_t)ejs_pull_$s->{TYPE_DEFINED}, (ejs_push_function_t)ejs_push_$s->{TYPE_DEFINED});\n";
- print FILE "}\n\n";
-
- } else {
-
- # Top level union
-
- foreach my $arm (@{$s->{FIELDS}}) {
-
- # Push/pull union arm
-
- print FILE "NTSTATUS ejs_pull_$s->{TYPE_DEFINED}_$arm->{NAME}(struct ejs_rpc *ejs, struct MprVar *v, union $s->{TYPE_DEFINED} *r)\n";
- print FILE "{\n";
-
- transfer_struct("pull", $arm);
-
- print FILE "\n\treturn NT_STATUS_OK;\n";
- print FILE "}\n\n";
-
- print FILE "NTSTATUS ejs_push_$s->{TYPE_DEFINED}_$arm->{NAME}(struct ejs_rpc *ejs, struct MprVar *v, const union $s->{TYPE_DEFINED} *r)\n";
- print FILE "{\n";
-
- transfer_struct("push", $arm);
-
- print FILE "\n\treturn NT_STATUS_OK;\n";
- print FILE "}\n\n";
-
- }
- }
-}
-
-close(FILE);
diff --git a/source4/script/find_unused_makefilevars.pl b/source4/script/find_unused_makefilevars.pl
index 1bed1228ec..23fc36ef6a 100755
--- a/source4/script/find_unused_makefilevars.pl
+++ b/source4/script/find_unused_makefilevars.pl
@@ -13,17 +13,26 @@ my %defines;
# First, make a list of defines in configure
$in = shift;
-open(IN, $in);
-while(<IN>) {
- my $line = $_;
- while($line =~ /^\b([a-zA-Z0-9_][a-zA-Z0-9_]*)\b[ \t]*=.*/sgm) {
- $defines{$1} = 1;
- }
- while($line =~ /\$\(([a-zA-Z0-9_][a-zA-Z0-9_]*)\)/sgm) {
- $references{$1} = 1;
+sub process_file($)
+{
+ my ($fn) = @_;
+ open(IN, $fn);
+ while(<IN>) {
+ my $line = $_;
+ while($line =~ /^\b([a-zA-Z0-9_][a-zA-Z0-9_]*)\b[ \t]*=.*/sgm) {
+ $defines{$1} = 1;
+ }
+ while($line =~ /\$\(([a-zA-Z0-9_][a-zA-Z0-9_]*)\)/sgm) {
+ $references{$1} = 1;
+ }
+ while ($line =~ /^include (.*)/sgm) {
+ process_file($1);
+ }
}
+ close IN;
}
-close IN;
+
+process_file($in);
print "##### DEFINED BUT UNUSED: #####\n";
foreach(%defines) {
diff --git a/source4/script/harness2subunit.pl b/source4/script/harness2subunit.pl
deleted file mode 100755
index 9f2391ad6c..0000000000
--- a/source4/script/harness2subunit.pl
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/perl
-
-my $firstline = 1;
-my $error = 0;
-while(<STDIN>) {
- if ($firstline) {
- $firstline = 0;
- next;
- }
- if (/^not ok (\d+) - (.*)$/) {
- print "test: $2\n";
- print "failure: $2\n";
- $error = 1;
- } elsif (/^ok (\d+) - (.*)$/) {
- print "test: $2\n";
- print "success: $2\n";
- } elsif (/^ok (\d+)$/) {
- print "test: $1\n";
- print "success: $1\n";
- } elsif (/^ok (\d+) # skip (.*)$/) {
- print "test: $1\n";
- print "skip: $1 [\n$2\n]\n";
- } elsif (/^not ok (\d+)$/) {
- print "test: $1\n";
- print "failure: $1\n";
- $error = 1;
- } else {
- print;
- }
-}
-exit $error;
-
diff --git a/source4/script/installlib.sh b/source4/script/installlib.sh
index 962c9562b1..cc9ff0b9ea 100755
--- a/source4/script/installlib.sh
+++ b/source4/script/installlib.sh
@@ -15,7 +15,9 @@ for p in $*; do
mv $LIBDIR/$p2 $LIBDIR/$p2.old
fi
cp $p $LIBDIR/
- ln -sf $p2 $LIBDIR/$lnname
+ if [ $p2 != $lnname ]; then
+ ln -sf $p2 $LIBDIR/$lnname
+ fi
done
cat << EOF
diff --git a/source4/script/installmisc.sh b/source4/script/installmisc.sh
index 5f7e11f083..2bd34b119f 100755
--- a/source4/script/installmisc.sh
+++ b/source4/script/installmisc.sh
@@ -2,16 +2,10 @@
# install miscellaneous files
SRCDIR="$1"
-JSDIR="$2"
-SETUPDIR="$3"
-BINDIR="$4"
+SETUPDIR="$2"
cd $SRCDIR || exit 1
-echo "Installing js libs"
-mkdir -p $JSDIR || exit 1
-cp scripting/libjs/*.js $JSDIR || exit 1
-
echo "Installing setup templates"
mkdir -p $SETUPDIR || exit 1
cp setup/schema-map-* $SETUPDIR || exit 1
@@ -30,9 +24,4 @@ cp setup/provision.smb.conf.dc $SETUPDIR || exit 1
cp setup/provision.smb.conf.member $SETUPDIR || exit 1
cp setup/provision.smb.conf.standalone $SETUPDIR || exit 1
-echo "Installing script tools"
-mkdir -p "$BINDIR"
-rm -f scripting/bin/*~
-cp scripting/bin/* $BINDIR/ || exit 1
-
exit 0
diff --git a/source4/script/installmodules.sh b/source4/script/installmodules.sh
deleted file mode 100755
index fb0ad90c14..0000000000
--- a/source4/script/installmodules.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-INSTALLPERMS=$1
-LIBDIR=$2
-shift
-shift
-shift
-
-if [ ! -d $LIBDIR ]; then
-mkdir $LIBDIR
-if [ ! -d $LIBDIR ]; then
- echo Failed to make directory $LIBDIR
- exit 1
-fi
-fi
-
-for p in $*; do
- p2=`basename $p`
- echo Installing $p as $LIBDIR/$p2
- cp -f $p $LIBDIR/
- chmod $INSTALLPERMS $LIBDIR/$p2
-done
-
-
-cat << EOF
-======================================================================
-The modules are installed. You may uninstall the modules using the
-command "make uninstallmodules" or "make uninstall" to uninstall
-binaries, man pages, shell scripts and modules.
-======================================================================
-EOF
-
-exit 0
diff --git a/source4/script/installscripts.sh b/source4/script/installscripts.sh
deleted file mode 100755
index bff5423e7c..0000000000
--- a/source4/script/installscripts.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-# this script courtesy of James_K._Foote.PARC@xerox.com
-# 5 July 96 Dan.Shearer@UniSA.Edu.Au Don't hardcode script names, get from Make
-
-INSTALLPERMS=$1
-BINDIR=$2
-
-shift
-shift
-
-echo Installing scripts in $BINDIR
-
-for d in $BINDIR; do
- if [ ! -d $d ]; then
- mkdir $d
- if [ ! -d $d ]; then
- echo Failed to make directory $d
- echo Have you run installbin first?
- exit 1
- fi
- fi
-done
-
-for p in $*; do
- p2=`basename $p`
- echo Installing $BINDIR/$p2
- if [ -f $BINDIR/$p2 ]; then
- rm -f $BINDIR/$p2.old
- mv $BINDIR/$p2 $BINDIR/$p2.old
- fi
- cp $p $BINDIR/
- chmod $INSTALLPERMS $BINDIR/$p2
- if [ ! -f $BINDIR/$p2 ]; then
- echo Cannot copy $p2... does $USER have privileges?
- fi
-done
-
-cat << EOF
-======================================================================
-The scripts have been installed. You may uninstall them using
-the command "make uninstallscripts" or "make install" to install binaries,
-man pages and shell scripts. You may recover the previous version (if any
-by "make revert".
-======================================================================
-EOF
-
-exit 0
diff --git a/source4/script/uninstallheader.sh b/source4/script/uninstallheader.sh
deleted file mode 100755
index cb491f071a..0000000000
--- a/source4/script/uninstallheader.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-# based on uninstallbin.sh:
-# 4 July 96 Dan.Shearer@UniSA.edu.au
-
-INCLUDEDIR=$1
-shift
-
-if [ ! -d $INCLUDEDIR ]; then
- echo Directory $INCLUDEDIR does not exist!
- echo Do a "make installbin" or "make install" first.
- exit 1
-fi
-
-for p in $*; do
- p2=`basename $p`
- if [ -f $INCLUDEDIR/$p2 ]; then
- echo Removing $INCLUDEDIR/$p2
- rm -f $INCLUDEDIR/$p2
- if [ -f $INCLUDEDIR/$p2 ]; then
- echo Cannot remove $INCLUDEDIR/$p2 ... does $USER have privileges?
- fi
- fi
-done
-
-
-cat << EOF
-======================================================================
-The headers have been uninstalled. You may restore the headers using
-the command "make installheader" or "make install" to install binaries,
-man pages, modules and shell scripts. You can restore a previous
-version of the headers (if there were any) using "make revert".
-======================================================================
-EOF
-
-exit 0
diff --git a/source4/script/uninstallmodules.sh b/source4/script/uninstallmodules.sh
deleted file mode 100755
index 30582a39fa..0000000000
--- a/source4/script/uninstallmodules.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-#4 July 96 Dan.Shearer@UniSA.edu.au
-
-INSTALLPERMS=$1
-BASEDIR=$2
-LIBDIR=$3
-shift
-shift
-shift
-
-if [ ! -d $LIBDIR ]; then
- echo Directory $LIBDIR does not exist!
- echo Do a "make installmodules" or "make install" first.
- exit 1
-fi
-
-for p in $*; do
- p2=`basename $p`
- if [ -f $LIBDIR/$p2 ]; then
- echo Removing $LIBDIR/$p2
- rm -f $LIBDIR/$p2
- if [ -f $LIBDIR/$p2 ]; then
- echo Cannot remove $LIBDIR/$p2 ... does $USER have privileges?
- fi
- fi
-done
-
-
-cat << EOF
-======================================================================
-The modules have been uninstalled. You may restore the modules using
-the command "make installmodules" or "make install" to install
-binaries, modules, man pages and shell scripts.
-======================================================================
-EOF
-
-exit 0
diff --git a/source4/script/uninstallscripts.sh b/source4/script/uninstallscripts.sh
deleted file mode 100755
index 13104acedd..0000000000
--- a/source4/script/uninstallscripts.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-# 5 July 96 Dan.Shearer@UniSA.Edu.Au - almost identical to uninstallbin.sh
-
-INSTALLPERMS=$1
-BINDIR=$2
-
-shift
-shift
-
-if [ ! -d $BINDIR ]; then
- echo Directory $BINDIR does not exist!
- echo Do a "make installscripts" or "make install" first.
- exit 1
-fi
-
-for p in $*; do
- p2=`basename $p`
- if [ -f $BINDIR/$p2 ]; then
- echo Removing $BINDIR/$p2
- rm -f $BINDIR/$p2
- if [ -f $BINDIR/$p2 ]; then
- echo Cannot remove $BINDIR/$p2 ... does $USER have privileges?
- fi
- fi
-done
-
-cat << EOF
-======================================================================
-The scripts have been uninstalled. You may reinstall them using
-the command "make installscripts" or "make install" to install binaries,
-man pages and shell scripts. You may recover a previous version (if any
-with "make revert".
-======================================================================
-EOF
-
-exit 0