[interchange-cvs] interchange - heins modified 3 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Sat Oct 5 20:04:01 2002


User:      heins
Date:      2002-10-06 00:03:34 GMT
Modified:  lib/Vend Data.pm
Modified:  lib/Vend/Table Common.pm DBI.pm
Log:
* Add database option:

	DatabaseDefault  HIDE_AUTO_FILES  1

  Result is to hide all .sql, .*dbm, and .autonumber files
  by putting a "." in front of them.

  I got sick of having the directory listing scroll off the
  screen.

  WARNING: If this is set after databases are imported, they
  will be overwritten! So do it at the beginning.

  I don't think this one should be recommended in the documentation...

Revision  Changes    Path
2.17      +4 -2      interchange/lib/Vend/Data.pm


rev 2.17, prev_rev 2.16
Index: Data.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Data.pm,v
retrieving revision 2.16
retrieving revision 2.17
diff -u -r2.16 -r2.17
--- Data.pm	16 Sep 2002 23:06:31 -0000	2.16
+++ Data.pm	6 Oct 2002 00:03:34 -0000	2.17
@@ -1,6 +1,6 @@
 # Vend::Data - Interchange databases
 #
-# $Id: Data.pm,v 2.16 2002/09/16 23:06:31 mheins Exp $
+# $Id: Data.pm,v 2.17 2002/10/06 00:03:34 mheins Exp $
 #=20
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -875,10 +875,12 @@
=20
 	$obj->{ObjectType} =3D $class_config->{Class};
=20
+	my $dot =3D $obj->{HIDE_AUTO_FILES} ? '.' : '';
+
 	if($class_config->{Extension}) {
 		$database_dbm =3D Vend::Util::catfile(
 												$dir,
-												"$base."     .
+												"$dot$base."     .
 												$class_config->{Extension}
 											);
 		$new_database_dbm =3D  Vend::Util::catfile(



2.21      +4 -3      interchange/lib/Vend/Table/Common.pm


rev 2.21, prev_rev 2.20
Index: Common.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.20
retrieving revision 2.21
diff -u -r2.20 -r2.21
--- Common.pm	10 Sep 2002 17:29:09 -0000	2.20
+++ Common.pm	6 Oct 2002 00:03:34 -0000	2.21
@@ -1,6 +1,6 @@
 # Vend::Table::Common - Common access methods for Interchange databases
 #
-# $Id: Common.pm,v 2.20 2002/09/10 17:29:09 mheins Exp $
+# $Id: Common.pm,v 2.21 2002/10/06 00:03:34 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -22,7 +22,7 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA  02111-1307  USA.
=20
-$VERSION =3D substr(q$Revision: 2.20 $, 10);
+$VERSION =3D substr(q$Revision: 2.21 $, 10);
 use strict;
=20
 package Vend::Table::Common;
@@ -1323,8 +1323,9 @@
 	delete $out->[$CONFIG]{_Dirty};
 	unlockfile(\*IN) or die "unlock\n";
     close(IN);
+	my $dot =3D $out->[$CONFIG]{HIDE_AUTO_FILES} ? '.' : '';
 	if($numeric_guess) {
-		my $fn =3D Vend::Util::catfile($out->[$CONFIG]{DIR}, $out->[$CONFIG]{fil=
e});
+		my $fn =3D Vend::Util::catfile($out->[$CONFIG]{DIR}, "$dot$out->[$CONFIG=
]{file}");
 		Vend::Util::writefile(
 					">$fn.numeric",
 					join " ", map { $field_names[$_] } @possible,



2.33      +5 -3      interchange/lib/Vend/Table/DBI.pm


rev 2.33, prev_rev 2.32
Index: DBI.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.32
retrieving revision 2.33
diff -u -r2.32 -r2.33
--- DBI.pm	16 Sep 2002 23:06:32 -0000	2.32
+++ DBI.pm	6 Oct 2002 00:03:34 -0000	2.33
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.32 2002/09/16 23:06:32 mheins Exp $
+# $Id: DBI.pm,v 2.33 2002/10/06 00:03:34 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -20,7 +20,7 @@
 # MA  02111-1307  USA.
=20
 package Vend::Table::DBI;
-$VERSION =3D substr(q$Revision: 2.32 $, 10);
+$VERSION =3D substr(q$Revision: 2.33 $, 10);
=20
 use strict;
=20
@@ -492,6 +492,8 @@
 sub open_table {
     my ($class, $config, $tablename) =3D @_;
=20=09
+	my $dot =3D $config->{HIDE_AUTO_FILES} ? '.' : '';
+
 	$config->{PRINTERROR} =3D 0 if ! defined $config->{PRINTERROR};
 	$config->{RAISEERROR} =3D 1 if ! defined $config->{RAISEERROR};
     my @call;
@@ -504,7 +506,7 @@
     if (! $config->{AUTO_SEQUENCE} and ! defined $config->{AutoNumberCount=
er}) {
 	    eval {
 			$config->{AutoNumberCounter} =3D new Vend::CounterFile
-									"$config->{DIR}/$config->{name}.autonumber",
+									"$config->{DIR}/$dot$config->{name}.autonumber",
 									$config->{AUTO_NUMBER} || '00001';
 		};
 		if($@) {