Update of /cvs/scoop/scoop/scripts
In directory lithium.sabren.com:/tmp/cvs-serv6920/scripts

Modified Files:
	boxtool 
Log Message:
Bugs 216 and 218 - bug fixes to boxtool.

-janra



Index: boxtool
===================================================================
RCS file: /cvs/scoop/scoop/scripts/boxtool,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** boxtool	7 Jan 2006 01:05:16 -0000	1.11
--- boxtool	7 Apr 2006 04:58:35 -0000	1.12
***************
*** 11,16 ****
  my $db_pass = $args->{P} || 'password';
  my $db_name = $args->{D} || 'scoop';
  my $db_host = $1         || 'localhost';
! my $db_port = $2         || 3306;
  my $editor  = $ENV{EDITOR} || ((-x '/bin/vi') ? '/bin/vi' : '/usr/bin/vi');
  
--- 11,22 ----
  my $db_pass = $args->{P} || 'password';
  my $db_name = $args->{D} || 'scoop';
+ my $db_type = $args->{d} || 'mysql';
  my $db_host = $1         || 'localhost';
! my $db_port = $2		 || 3306;
! if($2 == 0 && $db_type eq 'Pg')
! {
! 	$db_port = 5432;
! }
! 
  my $editor  = $ENV{EDITOR} || ((-x '/bin/vi') ? '/bin/vi' : '/usr/bin/vi');
  
***************
*** 307,311 ****
  	my $time = time;
  	warn "stamping cache $resource with $time\n";
! 	my $q = "UPDATE cache_time set last_update = $time where resource = '$resource' or resource = 'refresh_all'";
  
  	my $sth = $dbh->prepare($q) || die "couldn't prepare $q: $DBI::errstr\n";
--- 313,317 ----
  	my $time = time;
  	warn "stamping cache $resource with $time\n";
! 	my $q = "UPDATE cache_time set last_update = $time where resource LIKE '$resource%' or resource = 'refresh_all'";
  
  	my $sth = $dbh->prepare($q) || die "couldn't prepare $q: $DBI::errstr\n";
***************
*** 363,367 ****
  	return if $dbh;
  
! 	my $dsn = "DBI:mysql:database=$db_name:host=$db_host:port=$db_port";
  	$dbh = DBI->connect($dsn, $db_user, $db_pass) || 
  		die "Couldn't connect to database: $!";
--- 369,373 ----
  	return if $dbh;
  
! 	my $dsn = "DBI:$db_type:database=$db_name;host=$db_host;port=$db_port";
  	$dbh = DBI->connect($dsn, $db_user, $db_pass) || 
  		die "Couldn't connect to database: $!";
***************
*** 374,378 ****
  	# next, have Getopt::Std parse out the args
  	my $args = {};
! 	getopts('U:H:P:D::subpvf:', $args);
  	$args->{f} ||= "-";   # default to stdin/stdout
  
--- 380,384 ----
  	# next, have Getopt::Std parse out the args
  	my $args = {};
! 	getopts('U:H:P:D:d::subpvf:', $args);
  	$args->{f} ||= "-";   # default to stdin/stdout