
#
# Verify the solver's type in the software tree 
#

unless (-f "BRANCH") {
  exit 0;
}

$branch = `cat BRANCH`;
$branch =~ s/\s//g;
$branch = "\L$branch";

#
# Get current lists of types
#

chomp(@list =  `cat $ENV{SERVER_VAR}/lib/solver_tree`);
foreach (@list) {
  ($title, $path) = split(/\=/); 
  if ($branch eq $path) {
    print "Placing into $title($path) branch of tree.\n";
    $found=1;
    last;
  }
}

unless($found) {
  print "\"$branch\" is an invalid type.\n"; 
  print "Choose from the following:\n\n"; 
  foreach (@list) {
    ($title, $path) = split(/\=/); 
    print "$title = $path\n"; 
  }
  exit 1;
} else {
  system("echo $branch > BRANCH");
}









