Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (23 sloc) 0.871 kb
#!/usr/bin/perl -w
=head1 Name
dist_sql.pl - script to create init scripts for the database sql files found
in sql directory depending in directory name
=head1 Description
This script is called during "make dist" to create the database init scripts
depending on the leading directory within sql (ex: sql/Pg will create inst/Pg.sql)
=head1 Author
Andrei Arsu <acidburn@asynet.ro>
=head1 See Also
L<Bric::Admin>
=cut
use strict;
my @rdbmss = map { s{^sql/}{}; $_ } grep { $_ !~ /[.]svn/ } @ARGV;
for my $rdbms (@rdbmss) {
for my $type qw(sql val con) {
my $dir = $type eq 'sql' ? '>' : '>>';
system (
"grep -vh '^--' `find sql/$rdbms -name '*.$type' | env "
. "LANG= LANGUAGE= LC_ALL=POSIX sort` $dir inst/$rdbms.sql"
) and die "Errror concatenating *.$type files in sql/$rdbms into inst/$rdbms.sql";
}
}
Jump to Line
Something went wrong with that request. Please try again.