Skip to content

Commit

Permalink
* Add directive DatabaseAutoIgnore which prevents DatabaseAuto
Browse files Browse the repository at this point in the history
  bringing in tables matching its regex.

  	DatabaseAutoIgnore  ^sql_
	DatabaseAuto   dbi:Pg:dbname=foo  someuser

  This prevents trying to bring in the new tables that get auto-added
  to ever PostgreSQL 7.4 schema; they were causing errors.

  Must be set before DatabaseAuto.
  • Loading branch information
perusionmike committed Jun 5, 2004
1 parent e324a2e commit 86635e7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/Vend/Config.pm
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
# $Id: Config.pm,v 2.140 2004-04-30 20:09:38 mheins Exp $
# $Id: Config.pm,v 2.141 2004-06-05 18:21:06 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
Expand Down Expand Up @@ -48,7 +48,7 @@ use Vend::Util;
use Vend::File;
use Vend::Data;

$VERSION = substr(q$Revision: 2.140 $, 10);
$VERSION = substr(q$Revision: 2.141 $, 10);

my %CDname;
my %CPname;
Expand Down Expand Up @@ -392,7 +392,7 @@ sub catalog_directives {
['Message', 'message', ''],
['Variable', 'variable', ''],
['VarName', 'varname', ''],
['Limit', 'hash', 'option_list 5000 chained_cost_levels 32'],
['Limit', 'hash', 'option_list 5000 chained_cost_levels 32 robot_expire 1'],
['ScratchDefault', 'hash', ''],
['Profile', 'locale', ''],
['ValuesDefault', 'hash', ''],
Expand Down Expand Up @@ -424,6 +424,7 @@ sub catalog_directives {
['SessionLockFile', undef, 'etc/session.lock'],
['DatabaseDefault', 'hash', ''],
['DatabaseAuto', 'dbauto', ''],
['DatabaseAutoIgnore', 'regex', ''],
['Database', 'database', ''],
['Autoload', undef, ''],
['AutoEnd', undef, ''],
Expand Down
15 changes: 13 additions & 2 deletions lib/Vend/Table/DBI.pm
@@ -1,6 +1,6 @@
# Vend::Table::DBI - Access a table stored in an DBI/DBD database
#
# $Id: DBI.pm,v 2.59 2004-04-11 18:18:43 mheins Exp $
# $Id: DBI.pm,v 2.60 2004-06-05 18:21:06 mheins Exp $
#
# Copyright (C) 2002-2004 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
Expand All @@ -21,7 +21,7 @@
# MA 02111-1307 USA.

package Vend::Table::DBI;
$VERSION = substr(q$Revision: 2.59 $, 10);
$VERSION = substr(q$Revision: 2.60 $, 10);

use strict;

Expand Down Expand Up @@ -2140,9 +2140,20 @@ sub auto_config {
}
};

my $re;
if(exists $Vend::Cfg->{DatabaseAutoIgnore}) {
$re = $Vend::Cfg->{DatabaseAutoIgnore};
}
elsif(exists $Vend::Config::C->{DatabaseAutoIgnore}) {
$re = $Vend::Config::C->{DatabaseAutoIgnore};
}
$re and $re = qr/$re/;
#::logDebug("ignore re=$re");

my %found;
return undef unless @tabs;
for my $t (@tabs) {
next if $re and $t =~ $re;
$found{$t} = 1;
push @out, [$t, "$t.txt $dsn"];
push @out, [$t, "USER $user"] if $user;
Expand Down

0 comments on commit 86635e7

Please sign in to comment.