Index: trunk/gsdl/bin/script/registerencoding.pl
===================================================================
--- trunk/gsdl/bin/script/registerencoding.pl	(revision 10704)
+++ 	(revision )
@@ -1,138 +1,0 @@
-#!/usr/bin/perl -w
-
-###########################################################################
-#
-# registerencoding.pl - Add "Encoding" entry to etc/main.cfg file
-#
-# A component of the Greenstone digital library software
-# from the New Zealand Digital Library Project at the 
-# University of Waikato, New Zealand.
-#
-# Copyright (C) 1999 New Zealand Digital Library Project
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-###########################################################################
-
-
-BEGIN {
-    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
-}
-
-
-###########################################################################
-#
-# CODE SYNOPSIS
-#
-# This script registers a new encoding by adding an "Encoding" entry to
-#   the $GSDLHOME/etc/main.cfg file. It:
-#
-# - Parses the three required arguments: encoding name, encoding
-#     description, and mapfile name.
-# - Checks if the encoding specified is already defined in main.cfg.
-# - If it isn't, add a new "Encoding" entry and rewrite main.cfg.
-#
-###########################################################################
-
-
-use util;
-
-
-sub main
-{
-    # Get the short name of the encoding being registered
-    local $encodingname = shift(@_);
-    # Get the long name of the encoding being registered
-    local $encodingdesc = shift(@_);
-    # Get the name of the map file for the encoding being registered
-    local $mapfilename = shift(@_);
-
-    # Read any extra arguments
-    local $option_multibyte_encoding = 0;
-    local $optionalarg = shift(@_);
-    while ($optionalarg) {
-	if ($optionalarg eq "-multibyte") { $option_multibyte_encoding = 1; }
-	$optionalarg = shift(@_);
-    }
-
-    # Check that the necessary arguments were supplied
-    if (!$encodingname || !$encodingdesc || !$mapfilename) {
-	print STDERR "Usage: registerencoding.pl <encoding-name> <encoding-desc> <mapfile-name> [-multibyte]\n";
-	die "Error: Required argument missing.\n";
-    }
-
-    # Casefold the encoding name
-    $encodingname =~ tr/A-Z/a-z/;
-
-    # Open and read the etc/main.cfg file
-    local $gsdldir = "$ENV{'GSDLHOME'}";
-    local $maincfgfile = &util::filename_cat($gsdldir, "etc", "main.cfg");
-    open(MAIN_CFG_FILE, "<$maincfgfile") or die "Error: Could not open $maincfgfile.\n";
-    local @maincfglines = <MAIN_CFG_FILE>;
-    close(MAIN_CFG_FILE);
-
-    # Check if the encoding is already defined in the main.cfg file
-    local $lastencline;
-    for ($i = 0; $i < scalar(@maincfglines); $i++) {
-	local $line = $maincfglines[$i];
-
-	# Remove any nasty whitespace at the end of the line
-	$line =~ s/(\s*)$//;
-
-	# Does this line contain an Encoding entry?
-	if ($line =~ /^Encoding\s+/i) {
-	    local @encodingparts = split(/\s+/, $line);
-
-	    # Read the encoding name
-	    local $encname = "";
-	    for ($j = 1; $j < scalar(@encodingparts); $j++) {
-		if ($encodingparts[$j] =~ /^shortname=(.*)$/i) {
-		    $encname = $1;
-		}
-	    }
-
-	    # Casefold the encoding name
-	    $encname =~ tr/A-Z/a-z/;
-
-	    # No need to register an encoding that is already defined
-	    if ($encname eq $encodingname) {
-		# print "Note: Encoding with name '$encodingname' is already defined.\n";
-		return;
-	    }
-
-	    # Remember the last line containing an Encoding entry
-	    $lastencline = $i;
-	}
-    }
-
-    # The encoding has not been defined, so add a new entry to the main.cfg file
-    local $encodingline = "Encoding shortname=$encodingname \"longname=$encodingdesc\"" .
-	                    " map=$mapfilename";
-    if ($option_multibyte_encoding == 1) {
-	$encodingline = $encodingline . " multibyte";
-    }
-    $maincfglines[$lastencline] = $maincfglines[$lastencline] . $encodingline . "\n";
-
-    # Rewrite the (modified) main.cfg file
-    open(MAIN_CFG_FILE, ">$maincfgfile") or die "Error: Could not write $maincfgfile.\n";
-    foreach $line (@maincfglines) {
-	print MAIN_CFG_FILE "$line";
-    }
-    close(MAIN_CFG_FILE);
-}
-
-
-&main(@ARGV);
Index: trunk/gsdl/bin/script/registerlanguage.pl
===================================================================
--- trunk/gsdl/bin/script/registerlanguage.pl	(revision 10704)
+++ 	(revision )
@@ -1,139 +1,0 @@
-#!/usr/bin/perl -w
-
-###########################################################################
-#
-# registerlanguage.pl - Add "Language" entry to etc/main.cfg file
-#
-# A component of the Greenstone digital library software
-# from the New Zealand Digital Library Project at the 
-# University of Waikato, New Zealand.
-#
-# Copyright (C) 1999 New Zealand Digital Library Project
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-###########################################################################
-
-
-BEGIN {
-    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
-}
-
-
-###########################################################################
-#
-# CODE SYNOPSIS
-#
-# This script registers a new interface language by adding a "Language"
-#   entry to the $GSDLHOME/etc/main.cfg file. It:
-#
-# - Parses the three required arguments: language name, ISO 639 language
-#     code, and encoding name.
-# - Checks if the language specified is already defined in main.cfg.
-# - If it isn't, add a new "Language" entry and rewrite main.cfg.
-#
-###########################################################################
-
-
-use util;
-
-
-sub main
-{
-    # Get the code of the language being registered
-    local $languagecode = shift(@_);
-    # Get the name of the language being registered
-    local $languagename = shift(@_);
-    # Get the name of the encoding for the language being registered
-    local $encodingname = shift(@_);
-
-    # Check that the necessary arguments were supplied
-    if (!$languagecode || !$languagename || !$encodingname) {
-	print STDERR "Usage: registerlanguage.pl <language-code> <language-name> <encoding-name>\n";
-	die "Error: Required argument missing.\n";
-    }
-
-    # Casefold the language code and name
-    $languagecode =~ tr/A-Z/a-z/;
-    $languagename =~ tr/A-Z/a-z/;
-
-    # Open and read the etc/main.cfg file
-    local $gsdldir = "$ENV{'GSDLHOME'}";
-    local $maincfgfile = &util::filename_cat($gsdldir, "etc", "main.cfg");
-    open(MAIN_CFG_FILE, "<$maincfgfile") or die "Error: Could not open $maincfgfile.\n";
-    local @maincfglines = <MAIN_CFG_FILE>;
-    close(MAIN_CFG_FILE);
-
-    # Check if the language is already defined in the main.cfg file
-    local $lastlangline;
-    for ($i = 0; $i < scalar(@maincfglines); $i++) {
-	local $line = $maincfglines[$i];
-
-	# Remove any nasty whitespace at the end of the line
-	$line =~ s/(\s*)$//;
-
-	# Does this line contain a Language entry?
-	if ($line =~ /^Language\s+/i) {
-	    local @languageparts = split(/\s+/, $line);
-
-	    # Read the language code and name
-	    local $langcode = "";
-	    local $langname = "";
-	    for ($j = 1; $j < scalar(@languageparts); $j++) {
-		if ($languageparts[$j] =~ /^shortname=(.*)$/i) {
-		    $langcode = $1;
-		}
-		if ($languageparts[$j] =~ /^longname=(.*)$/i) {
-		    $langname = $1;
-		}
-	    }
-
-	    # Casefold the language code and name
-	    $langcode =~ tr/A-Z/a-z/;
-	    $langname =~ tr/A-Z/a-z/;
-
-	    # No need to register a language that is already defined
-	    if ($langcode eq $languagecode) {
-		# print "Note: Language with code '$languagecode'";
-		# if ($langname eq $languagename) {
-		#     print " and name '$languagename'";
-		# }
-		# print " is already defined.\n";
-		return;
-	    }
-
-	    # Remember the last line containing a Language entry
-	    $lastlangline = $i;
-	}
-    }
-
-    # The language has not been defined, so add a new entry to the main.cfg file
-    local $languagenametc = $languagename;
-    substr($languagenametc, 0, 1) =~ tr/a-z/A-Z/;  # Change language name to title case
-    local $languageline = "Language shortname=$languagecode longname=$languagenametc" .
-	                   " default_encoding=$encodingname";
-    $maincfglines[$lastlangline] = $maincfglines[$lastlangline] . $languageline . "\n";
-
-    # Rewrite the (modified) main.cfg file
-    open(MAIN_CFG_FILE, ">$maincfgfile") or die "Error: Could not write $maincfgfile.\n";
-    foreach $line (@maincfglines) {
-	print MAIN_CFG_FILE "$line";
-    }
-    close(MAIN_CFG_FILE);
-}
-
-
-&main(@ARGV);
Index: trunk/gsdl/bin/script/registermacrofile.pl
===================================================================
--- trunk/gsdl/bin/script/registermacrofile.pl	(revision 10704)
+++ 	(revision )
@@ -1,134 +1,0 @@
-#!/usr/bin/perl -w
-
-###########################################################################
-#
-# registermacrofile.pl - Add macrofile entry to etc/main.cfg file
-#
-# A component of the Greenstone digital library software
-# from the New Zealand Digital Library Project at the 
-# University of Waikato, New Zealand.
-#
-# Copyright (C) 1999 New Zealand Digital Library Project
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-###########################################################################
-
-
-BEGIN {
-    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
-}
-
-
-###########################################################################
-#
-# CODE SYNOPSIS
-#
-# This script registers a new macrofile by adding it to the "macrofiles"
-#   list in the $GSDLHOME/etc/main.cfg file. It:
-#
-# - Parses the required argument: macrofile name.
-# - Checks if the macrofile specified is already defined in main.cfg.
-# - If it isn't, add a new macrofile entry and rewrite main.cfg.
-#
-###########################################################################
-
-
-use util;
-
-
-sub main
-{
-    # Get the name of the macrofile being registered
-    local $macrofilename = shift(@_);
-
-    # Check that the necessary arguments were supplied
-    if (!$macrofilename) {
-	print STDERR "Usage: registermacrofile.pl <macrofile-name>\n";
-	die "Error: Required argument missing.\n";
-    }
-
-    # Casefold the macrofile name
-    $macrofilename =~ tr/A-Z/a-z/;
-
-    # Open and read the etc/main.cfg file
-    local $gsdldir = "$ENV{'GSDLHOME'}";
-    local $maincfgfile = &util::filename_cat($gsdldir, "etc", "main.cfg");
-    open(MAIN_CFG_FILE, "<$maincfgfile") or die "Error: Could not open $maincfgfile.\n";
-    local @maincfglines = <MAIN_CFG_FILE>;
-    close(MAIN_CFG_FILE);
-
-    # Check if the macrofile is already specified in the main.cfg file
-    local $lastmacroline;
-    local $inmacrofiles = 0;
-    for ($i = 0; $i < scalar(@maincfglines); $i++) {
-	local $line = $maincfglines[$i];
-
-	# Remove any nasty whitespace at the end of the line
-	$line =~ s/(\s*)$//;
-
-	# Does this line signal the start of the list of macrofiles?
-	if ($line =~ /^macrofiles\s+/i) {
-	    $inmacrofiles = 1;
-	    $line =~ s/^macrofiles\s+//i;
-	}
-
-	if ($inmacrofiles == 1) {
-	    # Remove any whitespace before the macros
-	    $line =~ s/^\s*//;
-
-	    # If there isn't a trailing '\' on this line, it's the last line
-	    if ($line !~ /\\$/) {
-		$lastmacroline = $i;
-		$inmacrofiles = 0;
-	    }
-	    # Otherwise remove the '\'
-	    else {
-		$line =~ s/\\$//;
-	    }
-
-	    # Casefold the line
-	    $line =~ tr/A-Z/a-z/;
-	    local @macrofiles = split(/\s+/, $line);
-
-	    # No need to register a macrofile that is already defined
-	    for ($j = 0; $j < scalar(@macrofiles); $j++) {
-		if ($macrofiles[$j] eq $macrofilename) {
-		    # print "Note: Macrofile '$macrofilename' is already defined.\n";
-		    return;
-		}
-	    }
-	}
-    }
-
-    # The macrofile has not been defined, so add a new entry to the main.cfg file
-    $maincfglines[$lastmacroline] =~ s/(\s*)$//;
-    if (length($maincfglines[$lastmacroline]) > 60) {
-	$maincfglines[$lastmacroline] .= " \\\n";
-	$maincfglines[$lastmacroline] .= "               ";
-    }
-    $maincfglines[$lastmacroline] .= " $macrofilename\n";
-
-    # Rewrite the (modified) main.cfg file
-    open(MAIN_CFG_FILE, ">$maincfgfile") or die "Error: Could not write $maincfgfile.\n";
-    foreach $line (@maincfglines) {
-  	print MAIN_CFG_FILE "$line";
-    }
-    close(MAIN_CFG_FILE);
-}
-
-
-&main(@ARGV);
