7a14294a4cf3e478e7ed6f353af8c482ee6b8934 braney Wed Jan 13 11:36:28 2021 -0800 search only hg/lib for AS files to build the tableDescriptions table. diff --git src/test/buildTableDescriptions.pl src/test/buildTableDescriptions.pl index 3da3d2f..b9b00ad 100755 --- src/test/buildTableDescriptions.pl +++ src/test/buildTableDescriptions.pl @@ -13,30 +13,31 @@ use HgConf; use Getopt::Long; use DBI; use Carp; use strict; # # Default behaviors, changeable by command line args: # my $kentSrc = "/cluster/home/galt/kentclean/src"; # currently does not get checked-in to git: my $gbdDPath = "/cluster/home/galt/kentclean/src/hg/htdocs/goldenPath/gbdDescriptions.html"; my $noLoad = 0; my $verbose = 0; +my $subDir = ""; # Hard-coded behaviors: my $debug = 0; # These are ignored to avoid errors about duplicate table/object definitions. my %autoSqlIgnore = ( "hg/autoSql/tests/input/polyTest.as" => "", "hg/autoSql/tests/input/newTest.as" => "", "hg/autoSql/tests/input/doc.as" => "", "hg/autoSql/tests/input/doc2.as" => "", "hg/autoSql/doc.as" => "", "hg/autoSql/doc2.as" => "", "hg/instinct/instinctMember/members.as" => "", "hg/instinct/bioIntegrator/bioIntDb.as" => "", "hg/lib/bed.as" => "", "hg/lib/ggDbRep.as" => "", "hg/lib/genotype.as" => "", @@ -65,30 +66,31 @@ my $basename = $0; $basename =~ s@.*/@@; # # usage: Print help message and exit, happy or unhappy. # sub usage { print STDERR "Usage: $basename [-kentSrc dir] [-gbdDPath f] [-noLoad] [-help] -kentSrc dir: Use dir as the kent/src checkout. Default: $kentSrc. -gbdDPath f: Use f as the gbdDescriptions.html. Default: $gbdDPath. -db db: Work only on db, not on all active dbs. -hgConf file: Use file instead of ~/.hg.conf. -noLoad: Don't load the database, just create .sql files. + -subDir Grab AS files from this sub directory of kentSrc rather than kentSrc -help: Print this message. "; exit(@_); } # end usage # # getActiveDbs: connect to central db, get list of active dbs # sub getActiveDbs { my $hgConf = shift; confess "Too many arguments" if (defined shift); my $centdb = $hgConf->lookup('central.db'); my $host = $hgConf->lookup('central.host'); my $username = $hgConf->lookup('central.user'); @@ -152,33 +154,34 @@ warn "Case-insensitive duplicate for $db.$t... dropping."; } else { $tableFields{$t} = $fields; $tableNamesInsens{$tableInsens} = 1; } } $dbh->disconnect(); return %tableFields; } # # slurpAutoSql: find all .as files under rootDir, grab contents. # sub slurpAutoSql { my $rootDir = shift; + my $subDir = shift; confess "Too few arguments" if (! defined $rootDir); confess "Too many arguments" if (defined shift); - open(P, "find $rootDir -name '*.as' -print |") || die "Can't open pipe"; + open(P, "find $rootDir/$subDir -name '*.as' -print |") || die "Can't open pipe"; my %tableAS = (); my %objectAS = (); my $gotLeftParen = 0; while (
) {
chop;
my $filename = $_;
my $filetail = $filename; $filetail =~ s/^$kentSrc\///;
next if (defined $autoSqlIgnore{$filetail});
open(F, "$filename") || die "Can't open $filename";
my $as = "";
my $table = "";
my $object = "";
my $fields = "";
while (