6f3824a64a095636d23b144a7536a1f5a8779f07 hiram Tue Feb 2 14:54:54 2021 -0800 better error exit on broken orderList refs #23891 diff --git src/hg/makeDb/doc/asmHubs/mkGenomes.pl src/hg/makeDb/doc/asmHubs/mkGenomes.pl index d88f9ee..74f75fa 100755 --- src/hg/makeDb/doc/asmHubs/mkGenomes.pl +++ src/hg/makeDb/doc/asmHubs/mkGenomes.pl @@ -26,30 +26,34 @@ my $orderList = $inputList; if ( ! -s "$orderList" ) { $orderList = $toolsDir/$inputList; } my %commonName; # key is asmId, value is common name my @orderList; # asmId of the assemblies in order from the *.list files # the order to read the different .list files: my $assemblyCount = 0; open (FH, "<${orderList}") or die "can not read ${orderList}"; while (my $line = <FH>) { next if ($line =~ m/^#/); chomp $line; my ($asmId, $commonName) = split('\t', $line); + if (!defined($commonName)) { + printf STDERR "ERROR: missing tab sep common name:\n'%s'\n", $line; + exit 255; + } if (defined($commonName{$asmId})) { printf STDERR "ERROR: duplicate asmId: '%s'\n", $asmId; printf STDERR "previous name: '%s'\n", $commonName{$asmId}; printf STDERR "duplicate name: '%s'\n", $commonName; exit 255; } $commonName{$asmId} = $commonName; push @orderList, $asmId; printf STDERR "orderList[$assemblyCount] = $asmId\n"; ++$assemblyCount; } close (FH); my $buildDone = 0; my $orderKey = 0;