c8828612e3aba9e6c3072768129de10abe337878
hiram
  Fri May 29 11:29:04 2020 -0700
now allow orderList to be specifically stated and begin common set of html functions refs #23734

diff --git src/hg/makeDb/doc/asmHubs/mkSymLinks.pl src/hg/makeDb/doc/asmHubs/mkSymLinks.pl
index d681f8e..06a68b9 100755
--- src/hg/makeDb/doc/asmHubs/mkSymLinks.pl
+++ src/hg/makeDb/doc/asmHubs/mkSymLinks.pl
@@ -4,41 +4,46 @@
 use warnings;
 use File::Basename;
 
 my $argc = scalar(@ARGV);
 if ($argc != 1) {
   printf STDERR "mkSymLinks.pl [two column name list]\n";
   printf STDERR "e.g.: mkSymLinks.pl vgp.primary.assemblies.tsv\n";
   printf STDERR "the name list is found in \$HOME/kent/src/hg/makeDb/doc/asmHubs/\n";
   printf STDERR "\nthe two columns are 1: asmId (accessionId_assemblyName)\n";
   printf STDERR "column 2: common name for species, columns separated by tab\n";
   printf STDERR "the result will create symLinks from the build direcory\n";
   printf STDERR "into the appropriate /asmHubs/GC[AF]/.../ release directory\n";
   printf STDERR "hierarchy.  The output to stderr is merely a progress report.\n";
   exit 255;
 }
-my $orderList = shift;
 
 my $home = $ENV{'HOME'};
 my $toolsDir = "$home/kent/src/hg/makeDb/doc/asmHubs";
 
+my $inputList = shift;
+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, "<$toolsDir/${orderList}") or die "can not read ${orderList}";
+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{$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;
   ++$assemblyCount;
 }
 close (FH);