74f5343d5f22428477778d20a5dc6e9e39c213fd braney Thu Aug 13 14:36:56 2026 -0700 geneReviews otto: pin the locale so a hand-run matches the cron run, refs #38098 The NCBI GeneReviews files are Latin-1. GRtitle_shortname_NBKid.txt holds two titles with high bytes, "Cantu syndrome" and "Stromme Syndrome". Under a UTF-8 locale GNU grep decides the file is binary, drops those two lines and writes a note to stderr that the wrapper's mail never shows. cron runs with no locale set and is safe, but a hand-run from a login shell quietly loses two disease titles and three geneReviewsDetail rows. Set LC_ALL=C in all three scripts. This also keeps sort and join in agreement in validateGeneReviews.sh whichever way the job is started. diff --git src/hg/utils/otto/geneReviews/checkGeneReviews.sh src/hg/utils/otto/geneReviews/checkGeneReviews.sh index 2ca5b294971..e3a47850d31 100755 --- src/hg/utils/otto/geneReviews/checkGeneReviews.sh +++ src/hg/utils/otto/geneReviews/checkGeneReviews.sh @@ -1,25 +1,31 @@ #!/bin/sh -e # Do not modify this script, modify the source tree copy: # src/utils/geneReviews/checkGeneReviews.sh # This script is used via a cron job and kept in $HOME/bin/scripts/ # cron jobs need to ensure this is true # current login requires the user be chinhli umask 002 +# Pin the locale so a hand-run from a login shell behaves like the cron run. +# See the note in buildGeneReviews.sh: the NCBI files are Latin-1 and a UTF-8 +# locale makes grep drop lines, and sort and join order differently. +LC_ALL=C +export LC_ALL + WORKDIR=$1 export WORKDIR # Emit an error line on any failure so the wrapper's "mail -E" sends an alert. The # wget -q is silent and set -e (from the #!/bin/sh -e shebang) would otherwise abort # with no output, which mail -E suppresses entirely. set -E (errtrace) makes the ERR # trap fire for failures inside functions too. No-update runs stay silent. set -E trap 'echo "ERROR: GeneReviews build failed (exit $?)"' ERR function installGeneReviewTables() { for i in `cat ../geneReviews.tables` do n=$i"New" o=$i"Old"