Remove some very old unused scripts

This commit is contained in:
Reinhard Müller 2019-03-13 02:03:55 +01:00
parent d61933d381
commit 6f6e8ca4d6
4 changed files with 0 additions and 196 deletions

View File

@ -1,121 +0,0 @@
#! /usr/bin/perl
use strict;
use warnings;
use constant false => 0;
use constant true => 1;
use XML::LibXML;
#print areEqual("./thankgnus.en.xhtml", "./thankgnus.fr.xhtml")."\n";
sub areEqual {
my ($file1, $file2) = @_;
#my $dom = XML::LibXML->load_xml(location => $file1); # the load_xml() function is not part of libxml 1.66 which is used on the server
#my $don = XML::LibXML->load_xml(location => $file2);
my $parser = XML::LibXML->new();
my $dom = $parser->parse_file($file1);
my $don = $parser->parse_file($file2);
my $root = $dom->documentElement();
my $roon = $don->documentElement();
return nodesAreEqual($file1, $file2, $root, $roon, "/", '');
}
sub nodesAreEqual {
my ($file1, $file2, $node1, $node2, $uptree, $nodenb) = @_;
# test that two nodes at the same position have the same name
if (not $node1->nodeName eq $node2->nodeName) {
# short excerpts of these nodes' contents, to give a hint where the error is
my $hint1 = $node1->textContent;
$hint1 =~ s/\n//g; $hint1 =~ s/ //g; $hint1 =~ s/\t//g;
$hint1 = substr($hint1,0,40)."...";
my $hint2 = $node2->textContent;
$hint2 =~ s/\n//g; $hint2 =~ s/ //g; $hint2 =~ s/\t//g;
$hint2 = substr($hint2,0,40)."...";
return (false, "$file2:\n
en contains $uptree".$node1->nodeName."\t(".$hint1."), but\n".
"** contains $uptree".$node2->nodeName."\t(".$hint2.")");
}
$uptree .= $node1->nodeName.$nodenb."/";
# get all children of each node
my @nodes = $node1->getChildrenByTagName('*');
my @nodez = $node2->getChildrenByTagName('*');
#print "\t".$node1->nodeName."(".scalar(@nodes).")", "\t", $node2->nodeName."(".scalar(@nodez).")", "\n";
# remove <translator> and <timestamp> from the nodesz
for (my $i=scalar(@nodes)-1; $i>=0; $i--) {
if ( $nodes[$i]->nodeName eq "translator" or $nodes[$i]->nodeName eq "timestamp" ) {
splice(@nodes,$i,1);
}
}
for (my $i=scalar(@nodez)-1; $i>=0; $i--) {
if ( $nodez[$i]->nodeName eq "translator" or $nodez[$i]->nodeName eq "timestamp" ) {
splice(@nodez,$i,1);
}
}
# test the size of the two lists of nodes
if ( scalar(@nodes) != scalar(@nodez) ) {
foreach (@nodes) { $_ = $_->nodeName };
foreach (@nodez) { $_ = $_->nodeName };
return (false, "$file1: ".join(",", @nodes)."\t\t<-children differences under $uptree\n"."$file2: ".join(",", @nodez) );
}
# comparing the two lists of nodes
my $commons = "";
for my $i (0 .. $#nodes) {
if (not $nodes[$i]->nodeName eq $nodez[$i]->nodeName) {
return (false, "$file2: after common $commons, " . $nodes[$i]->nodeName . " != " . $nodez[$i]->nodeName );
}
$commons .= $nodes[$i]->nodeName.",";
}
# recur!
for my $i (0 .. $#nodes) {
my ($bool, $err) = nodesAreEqual($file1, $file2, $nodes[$i], $nodez[$i], $uptree, $i);
if (not $bool) {
return ($bool, $err);
}
}
# if we get here, it means we did not
return (true, "trees are equal");
}
return 1;

View File

@ -1,52 +0,0 @@
#!/bin/bash
#
# Create header and footer template files for the Fellowship Account Management System
#
# Headers and footers are extracted from the /fellowship/index.xx.html files,
# based on markers generated by /fellowship/default.xsl
# Directory where the /fellowship html files are written by the build process
#
# We assume that the script is called by build.sh passing $1 as the $DEST
# directory defined in build.sh (so that we can reuse this script in both production
# and test instances)
if [ -z "$1" ] ; then
echo "You must supply a DEST directory"
exit 1
else
FELLDIR=$1/global/fellowship
fi
# Directory where the template files are expected by the AMS
TPLDIR=$FELLDIR/tpl
mkdir -p $TPLDIR
# Temporary fix, until we re-enable automated generation of templates
cp -a /var/www/fellowship-ams/tpl/* $TPLDIR
chown -R www: $TPLDIR
exit 0
# Working directory for this script
WRKDIR=`mktemp -d`
cp $FELLDIR/index.*.html $WRKDIR
cd $WRKDIR
for i in `ls index.*.html` ; do
# Extract language code from file name
LANGUAGE=`echo $i | cut -d '.' -f 2`
# Split and save to h1xx
csplit -f h1 -s $i '%<!--Start-fellowship-header-->%'
# Split h100 and save to h2xx => h200 is our header template
csplit -f h2 -s h100 '/<!--Stop-fellowship-header-->/1'
mv h200 $TPLDIR/tpl_header.$LANGUAGE.html
# Split and save to f1xx => f100 is our footer template
csplit -f f1 -s $i '%<!--Start-fellowship-footer-->%-1'
mv f100 $TPLDIR/tpl_footer.$LANGUAGE.html
done
rm -rf $WRKDIR

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Paths for building FSFE website.
# FIXME: This does not apply to build.pl yet!
SOURCE=/home/www/fsfe
DEST=/home/www/html
TMP=/home/www/tmp.$$
STATUS=/var/www/web

View File

@ -1,13 +0,0 @@
#! /usr/bin/perl
#
# This is a simple wrapper to XML::LibXML. It will validate (more or less)
# an XML file. Use this before committing something to CVS to make sure that
# the file is at least parseable as XML.
#
use XML::LibXML;
my $parser = XML::LibXML->new;
foreach (@ARGV) {
my $doc = $parser->parse_file($_);
}