472 lines
16 KiB
Perl
Executable File
472 lines
16 KiB
Perl
Executable File
#!/usr/sbin/perl
|
|
|
|
#**************************************************************************
|
|
#* *
|
|
#* Copyright (c) 1996 Silicon Graphics, Inc. *
|
|
#* All Rights Reserved *
|
|
#* *
|
|
#* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
|
|
#* *
|
|
#* The copyright notice above does not evidence any actual of intended *
|
|
#* publication of such source code, and is an unpublished work by Silicon *
|
|
#* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
|
|
#* the property of Silicon Graphics, Inc. Any use, duplication or *
|
|
#* disclosure not specifically authorized by Silicon Graphics is strictly *
|
|
#* prohibited. *
|
|
#* *
|
|
#* RESTRICTED RIGHTS LEGEND: *
|
|
#* *
|
|
#* Use, duplication or disclosure by the Government is subject to *
|
|
#* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
|
|
#* Technical Data and Computer Software clause at DFARS 52.227-7013, *
|
|
#* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
|
|
#* Supplement. Unpublished - rights reserved under the Copyright Laws of *
|
|
#* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
|
|
#* Shoreline Blvd., Mountain View, CA 94039-7311 *
|
|
#**************************************************************************
|
|
|
|
# DEMO_custom.pl
|
|
#
|
|
# Routines for dealing with custom lists
|
|
|
|
1; # Return true
|
|
|
|
sub Is_Custom_List {
|
|
return(&Number_Custom_Lists);
|
|
}
|
|
|
|
sub Number_Custom_Lists {
|
|
local($count);
|
|
&Parse_Name_Space;
|
|
$count = 0;
|
|
for (keys %name_space) {
|
|
++$count;
|
|
}
|
|
return($count);
|
|
}
|
|
|
|
sub List_Custom_List_Files {
|
|
&Parse_Name_Space;
|
|
return( values(%name_space) );
|
|
}
|
|
|
|
sub Get_Default_List {
|
|
open(FILE, "$FILE_DEFAULT_LIST") || &Print_Error("$ERROR_INFO","Can't open default list file for read.","$STATUS_MINOR");
|
|
$line = <FILE>;
|
|
chop if (grep(/\n/, $line));
|
|
local($output) = "$line";
|
|
close(FILE);
|
|
chomp($output);
|
|
return($output);
|
|
}
|
|
|
|
sub Set_Default_List {
|
|
local($list_name) = shift;
|
|
open(FILE, ">$FILE_DEFAULT_LIST") || &Print_Error("$ERROR_INFO","Can't open default list file for write.","$STATUS_MINOR");
|
|
print FILE "$list_name";
|
|
close(FILE);
|
|
}
|
|
|
|
sub Generate_Maint_Custom_Page {
|
|
&Parse_Name_Space;
|
|
if ($in{$CGI_CUSTOM_ADD_SWITCH}) {
|
|
if ($in{$CGI_CUSTOM_INCLUDE_SWITCH}) {
|
|
&Generate_Add_Results_Page;
|
|
} elsif ($in{$CGI_CHECKFORNONE_SWITCH}) {
|
|
&Generate_Add_Picker_Page(1);
|
|
} else {
|
|
&Generate_Add_Picker_Page;
|
|
}
|
|
} elsif ($in{$CGI_CUSTOM_EDIT_SWITCH}) {
|
|
if ($in{$CGI_CUSTOM_INCLUDE_SWITCH}) {
|
|
&Generate_Edit_Results_Page;
|
|
} elsif ($in{$CGI_CHECKFORNONE_SWITCH}) {
|
|
&Generate_Edit_Picker_Page(1);
|
|
} else {
|
|
&Generate_Edit_Picker_Page;
|
|
}
|
|
} elsif ($in{$CGI_CUSTOM_DELETE_SWITCH}) {
|
|
&Generate_Delete_List_Page;
|
|
} elsif ($in{$CGI_CUSTOM_OLD_NAME_SWITCH}) {
|
|
&Generate_Change_Name_Page;
|
|
} elsif ($in{$CGI_CUSTOM_VIEW_SWITCH}) {
|
|
&Pop_List_Demos($in{$CGI_CUSTOM_VIEW_SWITCH});
|
|
} else {
|
|
&Print_Main_Custom_Page;
|
|
}
|
|
}
|
|
|
|
sub Generate_Change_Name_Page {
|
|
$in{$CGI_CUSTOM_NEW_NAME_SWITCH} = &Make_HTTP_Safe("$in{$CGI_CUSTOM_NEW_NAME_SWITCH}");
|
|
&Print_Maint_Top("List Name Changed", "$IMGSRC_HEADER_CUSTOM");
|
|
&Change_Name($in{$CGI_CUSTOM_OLD_NAME_SWITCH}, $in{$CGI_CUSTOM_NEW_NAME_SWITCH}) if ("$in{$CGI_CUSTOM_OLD_NAME_SWITCH}" ne "$in{$CGI_CUSTOM_NEW_NAME_SWITCH}");
|
|
&Print_Name_Change_Success;
|
|
}
|
|
|
|
sub Change_Name {
|
|
$name_space{$_[1]} = $name_space{$_[0]};
|
|
delete $name_space{$_[0]};
|
|
&Print_Name_Space;
|
|
}
|
|
|
|
sub Print_Name_Change_Success {
|
|
&Print_Error("$ERROR_INFO","Custom Demo List \"$in{$CGI_CUSTOM_OLD_NAME_SWITCH}\" Changed To \"$in{$CGI_CUSTOM_NEW_NAME_SWITCH}\"","$STATUS_MINOR");
|
|
print "<font color=red size=+3>I</font><font color=red size=+1>NFORMATION</font><p>\n";
|
|
print "<p>\n";
|
|
print "The list <i>$in{$CGI_CUSTOM_OLD_NAME_SWITCH}</i> changed its name to <i>$in{$CGI_CUSTOM_NEW_NAME_SWITCH}</i>.";
|
|
print "<p>\n";
|
|
print "Use this utility to make further modifications to your custom list portfolio.\n";
|
|
print "<p>\n";
|
|
print "<p>\n<hr noshade>\n";
|
|
&Print_Main_Custom_Forms;
|
|
}
|
|
|
|
sub Generate_Delete_List_Page {
|
|
if (&Number_Custom_Lists == 1) {
|
|
&Print_Maint_Top("Deleted Custom Demo List: $in{$CGI_CUSTOM_DELETE_SWITCH}", "$IMGSRC_HEADER_CUSTOM", $PASSWD_NO_OVERRIDE, $CUSTOM_UPDATE_TOC);
|
|
} else {
|
|
&Print_Maint_Top("Deleted Custom Demo List: $in{$CGI_CUSTOM_DELETE_SWITCH}", "$IMGSRC_HEADER_CUSTOM");
|
|
}
|
|
&Delete_List($in{$CGI_CUSTOM_DELETE_SWITCH});
|
|
&Print_Delete_Success_Page;
|
|
}
|
|
|
|
sub Delete_List {
|
|
&Remove_List_File($_[0]);
|
|
delete $name_space{$_[0]};
|
|
&Print_Name_Space;
|
|
}
|
|
|
|
sub Remove_List_File {
|
|
`$CMD_RM $PATH_CUSTOM_DIR/$name_space{$_[0]} $CMD_NULLIFY`;
|
|
}
|
|
|
|
sub Print_Delete_Success_Page {
|
|
&Print_Error("$ERROR_INFO","Custom Demo List \"$in{$CGI_CUSTOM_DELETE_SWITCH}\" Deleted","$STATUS_MINOR");
|
|
print "<font color=red size=+3>I</font><font color=red size=+1>NFORMATION</font><p>\n";
|
|
print "<p>\n";
|
|
print "The custom list was successfully deleted.";
|
|
print "<p>\n";
|
|
print "Use this utility to make further modifications to your custom list portfolio.\n";
|
|
print "<p>\n";
|
|
print "<p>\n<hr noshade>\n";
|
|
&Print_Main_Custom_Forms;
|
|
}
|
|
|
|
sub Pop_List_Demos {
|
|
&Parse_Name_Space;
|
|
&Print_HTTP_Header("$in{$CGI_CUSTOM_VIEW_SWITCH}");
|
|
print "<body bgcolor=white>\n";
|
|
print "<center><b>$in{$CGI_CUSTOM_VIEW_SWITCH}</b></center>\n";
|
|
print "<p>\n";
|
|
print "<ul>\n";
|
|
@custom_demos = &Demos_On_List("$_[0]");
|
|
for (@custom_demos) {
|
|
($name, $tree) = split($TREES_DELIM, $_);
|
|
print "<li>$name\n";
|
|
}
|
|
close(LIST);
|
|
print "</ul>\n";
|
|
&Print_HTTP_Footer;
|
|
}
|
|
|
|
sub Generate_Add_Results_Page {
|
|
if (&Number_Custom_Lists == 0) {
|
|
&Print_Maint_Top("Added New Custom Demo List: $in{$CGI_CUSTOM_ADD_SWITCH}", "$IMGSRC_HEADER_CUSTOM", $PASSWD_NO_OVERRIDE, $CUSTOM_UPDATE_TOC);
|
|
} else {
|
|
&Print_Maint_Top("Added New Custom Demo List: $in{$CGI_CUSTOM_ADD_SWITCH}", "$IMGSRC_HEADER_CUSTOM");
|
|
}
|
|
&Add_List($in{$CGI_CUSTOM_ADD_SWITCH});
|
|
&Print_Error("$ERROR_INFO","Custom Demo List \"$in{$CGI_CUSTOM_ADD_SWITCH}\" Created","$STATUS_MINOR");
|
|
&Print_Success_Page;
|
|
}
|
|
|
|
sub Generate_Edit_Results_Page {
|
|
&Print_Maint_Top("Edited Custom Demo List: $in{$CGI_CUSTOM_EDIT_SWITCH}", "$IMGSRC_HEADER_CUSTOM");
|
|
&Print_Error("$ERROR_INFO","Custom Demo List \"$in{$CGI_CUSTOM_EDIT_SWITCH}\" Edited","$STATUS_MINOR");
|
|
&Edit_List($in{$CGI_CUSTOM_EDIT_SWITCH});
|
|
&Print_Success_Page;
|
|
}
|
|
|
|
sub Print_Success_Page {
|
|
print "<font color=red size=+3>I</font><font color=red size=+1>NFORMATION</font><p>\n";
|
|
print "<p>\n";
|
|
print "The custom demo list was successfully generated.";
|
|
print "<p>\n";
|
|
print "Use this utility to make further modifications to your custom list portfolio.\n";
|
|
print "<p>\n";
|
|
print "<p>\n<hr noshade>\n";
|
|
&Print_Main_Custom_Forms;
|
|
}
|
|
|
|
sub Add_List {
|
|
local($file_name, $demo);
|
|
$file_name = &Generate_File_Name;
|
|
open(NAMESPACE, ">>$FILE_NAMESPACE");
|
|
print NAMESPACE "$_[0]";
|
|
print NAMESPACE "$CUSTOM_DELIM";
|
|
print NAMESPACE "$file_name\n";
|
|
close(NAMESPACE);
|
|
&Write_List_File($file_name);
|
|
&Parse_Name_Space;
|
|
}
|
|
|
|
sub Edit_List {
|
|
local($file_name, $demo);
|
|
$file_name = $name_space{$_[0]};
|
|
&Write_List_File($file_name);
|
|
}
|
|
|
|
|
|
sub Write_List_File {
|
|
@demos_on_list = split(/\n/, $in{$CGI_CUSTOM_INCLUDE_SWITCH});
|
|
open(LISTFILE, ">$PATH_CUSTOM_DIR/$_[0]");
|
|
for $demo (@demos_on_list) {
|
|
print LISTFILE "$demo\n";
|
|
}
|
|
close(LISTFILE);
|
|
}
|
|
|
|
|
|
sub Generate_File_Name {
|
|
($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
|
|
return("$year.$mon.$mday.$hour.$min.$sec.$EXT_LIST")
|
|
}
|
|
|
|
sub Generate_Add_Picker_Page {
|
|
&Print_Maint_Top("Add Custom Demo List: $in{$CGI_CUSTOM_ADD_SWITCH}", "$IMGSRC_HEADER_CUSTOM");
|
|
if ($_[0]) {
|
|
print "<b>ERROR: You did not pick any demos for this list. Please\n";
|
|
print "select at least one demo, or <a href=\"javascript:cancelCustom()\">cancel</a>.<p>";
|
|
}
|
|
&Generate_Picker_Page_Bottom($CGI_CUSTOM_ADD_SWITCH);
|
|
}
|
|
|
|
sub Generate_Edit_Picker_Page {
|
|
&Print_Maint_Top("Edit Custom Demo List: $in{$CGI_CUSTOM_EDIT_SWITCH}", "$IMGSRC_HEADER_CUSTOM");
|
|
if ($_[0]) {
|
|
print "<b>ERROR: You did not pick any demos for this list. Please\n";
|
|
print "select at least one demo, or <a href=\"javascript:cancelCustom()\">cancel</a> and delete the list.<p>";
|
|
} else {
|
|
@demos_on_list = &Demos_On_List("$in{$CGI_CUSTOM_EDIT_SWITCH}");
|
|
}
|
|
&Generate_Picker_Page_Bottom($CGI_CUSTOM_EDIT_SWITCH);
|
|
}
|
|
|
|
sub Demos_On_List {
|
|
local($file_name, @demos);
|
|
$file_name = $name_space{$_[0]};
|
|
open(LISTFILE, "$PATH_CUSTOM_DIR/$file_name") || &Print_Error("$ERROR_NO_OPEN", "$file_name", "$STATUS_SERIOUS");
|
|
while(<LISTFILE>) {
|
|
chop;
|
|
$line = $_;
|
|
if (grep(/$TREES_DELIM/, $line)) {
|
|
push(@demos, $line);
|
|
} else { # Support old style custom lists
|
|
$name = &Tree_Name_From_Path("$TREE_DEFAULT_PATH", 1);
|
|
|
|
if ("$name" ne "") {
|
|
push(@demos, "$line$TREES_DELIM$name");
|
|
}
|
|
}
|
|
}
|
|
return(@demos);
|
|
}
|
|
|
|
sub Generate_Picker_Page_Bottom {
|
|
&Print_Picker_List($_[0]);
|
|
&Print_Look_At_Help;
|
|
&Print_Maint_Bottom;
|
|
&Print_HTTP_Footer;
|
|
}
|
|
|
|
sub Print_Picker_List {
|
|
local($firstCol);
|
|
print "<font color=red size=+3>I</font><font color=red size=+1>NSTRUCTIONS</font><p>\n";
|
|
print "Please select the demos you wish to include on the custom list.\n";
|
|
print "To select a demo, check the box next to the demo icon, then click\n";
|
|
print "on the <I>Make List</I> buttons.\n";
|
|
print "<br>\n";
|
|
print "<p>\n";
|
|
print "<p>\n<hr noshade>\n";
|
|
print "<p>\n";
|
|
print "<form target=$FRAME_MAIN action=\"$WWW_SCRIPT\">\n";
|
|
print "<input type=hidden name=\"$CGI_SWITCH\" value=\"$CGI_MAINT_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_SUB_SWITCH\" value=\"$CGI_MAINT_CUSTOM_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_MAINT_OUTSIDE_SWITCH\" value=\"$CGI_MAINT_FALSE_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_CHECKFORNONE_SWITCH\" value=\"$CGI_MAINT_TRUE_FLAG\">\n";
|
|
print "<input type=hidden name=\"$_[0]\" value=\"$in{$_[0]}\">\n";
|
|
print "<center>\n";
|
|
print "<table width=100%>\n";
|
|
$firstCol = 1;
|
|
for $demo ( @demo_list ) {
|
|
($demo_name, $tree_name) = split($TREES_DELIM, $demo);
|
|
print "<tr>\n" if ($firstCol);
|
|
print "<td>\n";
|
|
print "<input type=checkbox name=\"$CGI_CUSTOM_INCLUDE_SWITCH\" value=\"$demo\" ";
|
|
if (grep(/^$demo$/i, @demos_on_list)) {
|
|
print "checked";
|
|
}
|
|
print ">\n";
|
|
&Print_Demo_Bullet("$demo_name", "$tree_name");
|
|
print "</td>\n";
|
|
print "</tr>\n" if (!$firstCol);
|
|
$firstCol = (!$firstCol);
|
|
}
|
|
print "</table>\n";
|
|
print "<font color=blue>\n";
|
|
print "<input type=button value=\"Cancel\" onClick=\"cancelCustom();\">\n";
|
|
print "<input type=submit value=\"Make List\">\n";
|
|
print "</font>\n";
|
|
print "</form>\n";
|
|
print "</center>\n";
|
|
}
|
|
|
|
sub Print_Main_Custom_Page {
|
|
local(@lists, $list);
|
|
&Print_Maint_Top("Custom Demo Lists", "$IMGSRC_HEADER_CUSTOM");
|
|
print "<font color=red size=+3>I</font><font color=red size=+1>NFORMATION</font><p>\n";
|
|
print "<p>\n";
|
|
print "Add, view, edit, or delete custom <i>demo lists</i>.";
|
|
print "<p>\n<hr noshade>\n";
|
|
&Print_Main_Custom_Forms;
|
|
}
|
|
|
|
sub Print_Main_Custom_Forms {
|
|
@lists = &List_Custom_Lists;
|
|
&Print_Add_List_Form;
|
|
print "<p><hr align=left width=78%><p>\n";
|
|
if (@lists) {
|
|
print "<font color=red size=+3>P</font><font color=red size=+1>ICK </font> \n";
|
|
print "<font color=red size=+3>D</font><font color=red size=+1>EMO</font>\n";
|
|
print "<font color=red size=+3>L</font><font color=red size=+1>IST</font><p>\n";
|
|
print "<table border=0 cellpadding=5 cellspacing=0 bgcolor=$INPUT_BGCOLOR>\n";
|
|
}
|
|
foreach $list ( &alpha(@lists)) {
|
|
&Print_List_Bullet($list);
|
|
}
|
|
print "</table>\n<p>\n" if (@lists);
|
|
&Print_Look_At_Help;
|
|
&Print_Maint_Bottom;
|
|
&Print_HTTP_Footer;
|
|
}
|
|
|
|
sub Print_Add_List_Form {
|
|
print "<font color=red size=+3>A</font><font color=red size=+1>DD </font> \n";
|
|
print "<font color=red size=+3>L</font><font color=red size=+1>IST</font><p>\n";
|
|
print "<form target=$FRAME_MAIN action=\"$WWW_SCRIPT\">\n";
|
|
print "<input type=hidden name=\"$CGI_SWITCH\" value=\"$CGI_MAINT_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_SUB_SWITCH\" value=\"$CGI_MAINT_CUSTOM_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_MAINT_OUTSIDE_SWITCH\" value=\"$CGI_MAINT_FALSE_FLAG\">\n";
|
|
print "<table bgcolor=$INPUT_BGCOLOR>\n<tr>\n<td>\n";
|
|
print "<input name=\"$CGI_CUSTOM_ADD_SWITCH\">";
|
|
print "<font size=1 color=red>\n";
|
|
print "<input type=submit value=\"Add List\">\n";
|
|
print "</font>\n";
|
|
print "</td>\n</tr>\n</table>\n";
|
|
print "</form>\n";
|
|
}
|
|
|
|
|
|
sub Print_List_Bullet {
|
|
local($safe_custom_name);
|
|
undef $safe_custom_name;
|
|
$safe_custom_name = &HTTP_Syntax("$_[0]");
|
|
print "<form target=$FRAME_MAIN method=GET action=\"$WWW_SCRIPT\">\n";
|
|
print "<tr valign=middle bgcolor=$INPUT_BGCOLOR>\n";
|
|
print "<td colspan=4>\n";
|
|
print "<input type=hidden name=\"$CGI_SWITCH\" value=\"$CGI_MAINT_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_SUB_SWITCH\" value=\"$CGI_MAINT_CUSTOM_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_MAINT_OUTSIDE_SWITCH\" value=\"$CGI_MAINT_FALSE_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_CUSTOM_OLD_NAME_SWITCH\" value=\"$_[0]\">\n";
|
|
print "<input name=\"$CGI_CUSTOM_NEW_NAME_SWITCH\" value=\"$_[0]\" size=20>\n";
|
|
print "</td></tr>\n";
|
|
print "<tr><td valign=top>\n";
|
|
print "<font size=2 color=brown><input type=submit value=\"Change Name\">\n";
|
|
print "</font>\n";
|
|
print "</form>\n";
|
|
print "</td>\n";
|
|
print "<td>\n";
|
|
print "<form onSubmit=\"return PopCustomView(\'$safe_custom_name\')\">\n";
|
|
print "<font size=2 color=blue>\n";
|
|
print "<input type=submit value=\"View List\">\n";
|
|
print "</font>\n";
|
|
print "</form>\n";
|
|
print "</td>\n";
|
|
print "<td>\n";
|
|
print "<form target=$FRAME_MAIN method=GET action=\"$WWW_SCRIPT\">\n";
|
|
print "<input type=hidden name=\"$CGI_SWITCH\" value=\"$CGI_MAINT_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_SUB_SWITCH\" value=\"$CGI_MAINT_CUSTOM_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_MAINT_OUTSIDE_SWITCH\" value=\"$CGI_MAINT_FALSE_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_CUSTOM_EDIT_SWITCH\" value=\"$_[0]\">\n";
|
|
print "<font size=2 color=green>\n";
|
|
print "<input type=submit value=\"Edit List\">\n";
|
|
print "</font>\n";
|
|
print "</form>\n";
|
|
print "</td>\n";
|
|
print "<td>\n";
|
|
print "<form target=$FRAME_MAIN method=GET onSubmit=\"return confirmDelete(\'$_[0]\')\" action=\"$WWW_SCRIPT\">\n";
|
|
print "<input type=hidden name=\"$CGI_SWITCH\" value=\"$CGI_MAINT_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_SUB_SWITCH\" value=\"$CGI_MAINT_CUSTOM_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_MAINT_OUTSIDE_SWITCH\" value=\"$CGI_MAINT_FALSE_FLAG\">\n";
|
|
print "<input type=hidden name=\"$CGI_CUSTOM_DELETE_SWITCH\" value=\"$_[0]\">\n";
|
|
print "<font size=2 color=red>\n";
|
|
print "<input type=submit value=\"Delete List\">\n";
|
|
print "</font>\n";
|
|
print "</form>\n";
|
|
print "</td>\n";
|
|
print "</tr>\n";
|
|
print "<tr><td><p></td></tr>\n";
|
|
}
|
|
|
|
sub List_Custom_Lists {
|
|
local(@lists);
|
|
for (keys %name_space) {
|
|
push(@lists, $_);
|
|
}
|
|
return( &alpha(@lists));
|
|
}
|
|
|
|
sub Print_Name_Space {
|
|
local($key);
|
|
open(NAMESPACE, ">$FILE_NAMESPACE");
|
|
for $key (keys %name_space) {
|
|
if (defined $name_space{$key}) {
|
|
print NAMESPACE "$key";
|
|
print NAMESPACE "$CUSTOM_DELIM";
|
|
print NAMESPACE "$name_space{$key}\n";
|
|
}
|
|
}
|
|
close(NAMESPACE);
|
|
&Parse_Name_Space;
|
|
}
|
|
|
|
|
|
sub Custom_File_Exists {
|
|
local($file_name) = shift;
|
|
chdir("$PATH_CUSTOM_DIR");
|
|
return( (-r "$PATH_CUSTOM_DIR/$file_name") )
|
|
}
|
|
|
|
sub Parse_Name_Space {
|
|
local($isError) = 0;
|
|
undef(%name_space);
|
|
if(open(NAMESPACE, "$FILE_NAMESPACE")) {
|
|
while(<NAMESPACE>) {
|
|
chop if (grep(\n, $_));
|
|
($key, $val) = split(/$CUSTOM_DELIM/, $_) if ($_);
|
|
$name_space{$key} = $val if ($_);
|
|
}
|
|
}
|
|
# Test to make sure the file associated in the namespace still exists
|
|
for $list (keys(%name_space)) {
|
|
if (! &Custom_File_Exists("$name_space{$list}") ) {
|
|
&Print_Error("$ERROR_INFO","Removing custom list \"$list\". File is missing.","$STATUS_MINOR");
|
|
delete $name_space{$list}; # delete this part of the namespace
|
|
$isError = 1;
|
|
}
|
|
}
|
|
# If there are changes, reprint the NameSpace
|
|
&Print_Name_Space if ($isError);
|
|
}
|