419c9b44aca638612f184d11f406c6d01269e01f
hiram
  Tue Jan 6 09:42:11 2026 -0800
do not update groups.txt if it remains identical to template source refs #29545

diff --git src/hg/makeDb/doc/asmHubs/mkGenomes.pl src/hg/makeDb/doc/asmHubs/mkGenomes.pl
index a184fe6478b..c786867457f 100755
--- src/hg/makeDb/doc/asmHubs/mkGenomes.pl
+++ src/hg/makeDb/doc/asmHubs/mkGenomes.pl
@@ -1,20 +1,21 @@
 #!/usr/bin/env perl
 
 use strict;
 use warnings;
 use File::Basename;
+use File::Compare;
 
 my %commonName;	# key is asmId, value is common name
 my @monthNumber = qw( Zero Jan. Feb. Mar. Apr. May Jun. Jul. Aug. Sep. Oct. Nov. Dec. );
 
 my $argc = scalar(@ARGV);
 if ($argc != 3) {
   printf STDERR "mkGenomes.pl blatHost blatPort [two column name list] > .../hub/genomes.txt\n";
   printf STDERR "e.g.: mkGenomes.pl dynablat-01 4040 vgp.primary.assemblies.tsv > .../vgp/genomes.txt\n";
   printf STDERR "e.g.: mkGenomes.pl hgwdev 4040 vgp.primary.assemblies.tsv > .../vgp/download.genomes.txt\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 "result will write a local asmId.genomes.txt file for each hub\n";
   printf STDERR "and a local asmId.hub.txt file for each hub\n";
   printf STDERR "and a local asmId.groups.txt file for each hub\n";
@@ -410,35 +411,43 @@
   }
   printf GF "organism %s %s\n", $assemblyName, $asmDate;
   printf GF "defaultPos %s\n", $defPos;
   printf GF "scientificName %s\n", $descr;
   printf GF "htmlPath html/%s.description.html\n", $asmId;
   # until blat server host is ready for hgdownload, avoid these lines
   if ($blatHost ne $downloadHost) {
     if ( -s "${buildDir}/$accessionId.trans.gfidx" ) {
       printf GF "blat $blatHost$blatHostDomain %d dynamic $accessionDir/$accessionId\n", $blatPort + $hugeGenome;
       printf GF "transBlat $blatHost$blatHostDomain %d dynamic $accessionDir/$accessionId\n", $blatPort + $hugeGenome;
      printf GF "isPcr $blatHost$blatHostDomain %d dynamic $accessionDir/$accessionId\n", $blatPort + $hugeGenome;
     }
   }
   close (GF);
 
+  my $updateGroups = 1;
   my $localGroups = "$buildDir/${asmId}.groups.txt";
+  if ( -s "$buildDir/${asmId}.groups.txt" ) {
+    if (compare("$home/kent/src/hg/makeDb/doc/asmHubs/groups.txt", "$localGroups") == 0) {
+       $updateGroups = 0;	# already exists and is identical
+    }
+  }
+  if ($updateGroups) {
       open (GR, ">$localGroups") or die "can not write to $localGroups";
       printf GR "%s", $groupsTxt;
       close (GR);
   }
+}
 
 __END__
 
 description Mastacembelus armatus
 twoBitPath GCA_900324485.2_fMasArm1.2/trackData/addMask/GCA_900324485.2_fMasArm1.2.masked.2bit
 organism Zig-Zag eel
 defaultPos LR535842.1:14552035-14572034
 orderKey 1
 scientificName Mastacembelus armatus
 htmlPath GCA_900324485.2_fMasArm1.2/html/GCA_900324485.2_fMasArm1.2.description.html
 
 # head -25 GCA_002180035.3_HG00514_prelim_3.0_assembly_report.txt
 
 # Assembly name:  HG00514_prelim_3.0
 # Organism name:  Homo sapiens (human)