3 # Copyright (C) 2011 Equinox Software, Inc.
4 # Galen Charlton <gmc@esilibrary.com>
6 # Extract 'comment on' statements from Evergreen's SQL initialization
7 # scripts. Useful for updating the comments after an upgrade.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
22 unless ($#ARGV == 0) {
23 print "usage: $0 sql_file_manifest\n";
24 print "output is a set of SQL statements to be run\n";
25 print "in an Evergreen database to update schema comments.\n";
29 open MANIFEST, '<', $ARGV[0];
35 next unless $file ne '' and $file !~ /^#/ and $file ne 'FTS_CONFIG_FILE';
36 open IN, '<', $file or next; # errors blithely ignored
37 my $contents = join('', <IN>);
38 print "$_\n\n" foreach $contents =~ /(comment on .*? is \$\$.*?\$\$;)/sig;
39 #my @comments = $contents =~ /(comment on .*? is \$\$.*?\$\$;)/sig;
40 #foreach my $comment (@comments) {
41 #print $comment, "\n\n";