Commit 850a6db0 authored by Leigh Stoller's avatar Leigh Stoller

Minor fix for package/type names that have a dash in them, we were

regenerating the object more then once.
parent 08976c8e
......@@ -980,6 +980,7 @@ sub NewType($$)
# Note that type might be a class, and so Lookup() returns nothing.
#
my $typeinfo = NodeType->Lookup($type);
my $packname = "libossetup_${type}";
# Switches are special.
if (defined($typeinfo) && $typeinfo->isswitch()) {
......@@ -988,22 +989,20 @@ sub NewType($$)
print STDERR "$self libossetup_switch load failed: " . $@;
return undef;
}
# Dashes in type names are bad in this code.
$type =~ s/\-/\_/g;
}
elsif ($type eq "pcfedphys" || $type eq "pcfed") {
$type = "protogeni";
$packname = "libossetup_${type}";
# Dashes in package names are bad.
$packname =~ s/\-/\_/g;
}
elsif (defined($typeinfo) && $typeinfo->issubnode()) {
$type = "subnode";
$packname = "libossetup_subnode";
}
my $packname = "libossetup_${type}";
my $newtype = eval { $packname->New($self); };
# Not loaded?
if ($@) {
#print STDERR "module load failed: " . $@ . "\n";
eval "require libossetup_${type}";
eval "require $packname";
if ($@) {
if ($@ !~ /Can't locate libossetup_/) {
print STDERR "$self NewType($type): module load failed: " . $@;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment